/linux-6.1.9/drivers/gpu/drm/virtio/ |
D | virtgpu_kms.c | 37 struct virtio_gpu_device *vgdev = in virtio_gpu_config_changed_work_func() local 43 virtio_cread_le(vgdev->vdev, struct virtio_gpu_config, in virtio_gpu_config_changed_work_func() 46 if (vgdev->has_edid) in virtio_gpu_config_changed_work_func() 47 virtio_gpu_cmd_get_edids(vgdev); in virtio_gpu_config_changed_work_func() 48 virtio_gpu_cmd_get_display_info(vgdev); in virtio_gpu_config_changed_work_func() 49 virtio_gpu_notify(vgdev); in virtio_gpu_config_changed_work_func() 50 drm_helper_hpd_irq_event(vgdev->ddev); in virtio_gpu_config_changed_work_func() 53 virtio_cwrite_le(vgdev->vdev, struct virtio_gpu_config, in virtio_gpu_config_changed_work_func() 65 static void virtio_gpu_get_capsets(struct virtio_gpu_device *vgdev, in virtio_gpu_get_capsets() argument 70 struct drm_device *drm = vgdev->ddev; in virtio_gpu_get_capsets() [all …]
|
D | virtgpu_vq.c | 59 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_ctrl_ack() local 61 schedule_work(&vgdev->ctrlq.dequeue_work); in virtio_gpu_ctrl_ack() 67 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_cursor_ack() local 69 schedule_work(&vgdev->cursorq.dequeue_work); in virtio_gpu_cursor_ack() 72 int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev) in virtio_gpu_alloc_vbufs() argument 74 vgdev->vbufs = kmem_cache_create("virtio-gpu-vbufs", in virtio_gpu_alloc_vbufs() 78 if (!vgdev->vbufs) in virtio_gpu_alloc_vbufs() 83 void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) in virtio_gpu_free_vbufs() argument 85 kmem_cache_destroy(vgdev->vbufs); in virtio_gpu_free_vbufs() 86 vgdev->vbufs = NULL; in virtio_gpu_free_vbufs() [all …]
|
D | virtgpu_debugfs.c | 47 struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; in virtio_gpu_features() local 49 virtio_gpu_add_bool(m, "virgl", vgdev->has_virgl_3d); in virtio_gpu_features() 50 virtio_gpu_add_bool(m, "edid", vgdev->has_edid); in virtio_gpu_features() 51 virtio_gpu_add_bool(m, "indirect", vgdev->has_indirect); in virtio_gpu_features() 54 vgdev->has_resource_assign_uuid); in virtio_gpu_features() 56 virtio_gpu_add_bool(m, "blob resources", vgdev->has_resource_blob); in virtio_gpu_features() 57 virtio_gpu_add_bool(m, "context init", vgdev->has_context_init); in virtio_gpu_features() 58 virtio_gpu_add_int(m, "cap sets", vgdev->num_capsets); in virtio_gpu_features() 59 virtio_gpu_add_int(m, "scanouts", vgdev->num_scanouts); in virtio_gpu_features() 60 if (vgdev->host_visible_region.len) { in virtio_gpu_features() [all …]
|
D | virtgpu_ioctl.c | 72 static void virtio_gpu_create_context_locked(struct virtio_gpu_device *vgdev, in virtio_gpu_create_context_locked() argument 78 virtio_gpu_cmd_context_create(vgdev, vfpriv->ctx_id, in virtio_gpu_create_context_locked() 87 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_create_context() local 94 virtio_gpu_create_context_locked(vgdev, vfpriv); in virtio_gpu_create_context() 103 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_map_ioctl() local 106 return virtio_gpu_mode_dumb_mmap(file, vgdev->ddev, in virtio_gpu_map_ioctl() 121 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_execbuffer_ioctl() local 135 fence_ctx = vgdev->fence_drv.context; in virtio_gpu_execbuffer_ioctl() 138 if (vgdev->has_virgl_3d == false) in virtio_gpu_execbuffer_ioctl() 222 out_fence = virtio_gpu_fence_alloc(vgdev, fence_ctx, ring_idx); in virtio_gpu_execbuffer_ioctl() [all …]
|
D | virtgpu_drv.h | 129 typedef void (*virtio_gpu_resp_cb)(struct virtio_gpu_device *vgdev, 311 void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev, 316 int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev); 317 void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev); 318 void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, 323 void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, 325 void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, 331 void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev, 337 void virtio_gpu_cmd_set_scanout(struct virtio_gpu_device *vgdev, 341 void virtio_gpu_object_attach(struct virtio_gpu_device *vgdev, [all …]
|
D | virtgpu_object.c | 34 int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid) in virtio_gpu_resource_id_get() argument 49 int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); in virtio_gpu_resource_id_get() 57 static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id) in virtio_gpu_resource_id_put() argument 60 ida_free(&vgdev->resource_ida, id - 1); in virtio_gpu_resource_id_put() 66 struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; in virtio_gpu_cleanup_object() local 68 virtio_gpu_resource_id_put(vgdev, bo->hw_res_handle); in virtio_gpu_cleanup_object() 74 spin_lock(&vgdev->host_visible_lock); in virtio_gpu_cleanup_object() 78 spin_unlock(&vgdev->host_visible_lock); in virtio_gpu_cleanup_object() 89 struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; in virtio_gpu_free_object() local 92 virtio_gpu_cmd_unref_resource(vgdev, bo); in virtio_gpu_free_object() [all …]
|
D | virtgpu_gem.c | 37 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_gem_create() local 42 ret = virtio_gpu_object_create(vgdev, params, &obj, NULL); in virtio_gpu_gem_create() 67 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_mode_dumb_create() local 84 if (vgdev->has_resource_blob && !vgdev->has_virgl_3d) { in virtio_gpu_mode_dumb_create() 120 struct virtio_gpu_device *vgdev = obj->dev->dev_private; in virtio_gpu_gem_object_open() local 124 if (!vgdev->has_virgl_3d) in virtio_gpu_gem_object_open() 137 virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, in virtio_gpu_gem_object_open() 140 virtio_gpu_notify(vgdev); in virtio_gpu_gem_object_open() 147 struct virtio_gpu_device *vgdev = obj->dev->dev_private; in virtio_gpu_gem_object_close() local 151 if (!vgdev->has_virgl_3d) in virtio_gpu_gem_object_close() [all …]
|
D | virtgpu_vram.c | 9 struct virtio_gpu_device *vgdev = obj->dev->dev_private; in virtio_gpu_vram_free() local 14 spin_lock(&vgdev->host_visible_lock); in virtio_gpu_vram_free() 16 spin_unlock(&vgdev->host_visible_lock); in virtio_gpu_vram_free() 19 virtio_gpu_cmd_unmap(vgdev, bo); in virtio_gpu_vram_free() 21 virtio_gpu_cmd_unref_resource(vgdev, bo); in virtio_gpu_vram_free() 22 virtio_gpu_notify(vgdev); in virtio_gpu_vram_free() 36 struct virtio_gpu_device *vgdev = obj->dev->dev_private; in virtio_gpu_vram_mmap() local 44 wait_event(vgdev->resp_wq, vram->map_state != STATE_INITIALIZING); in virtio_gpu_vram_mmap() 73 struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; in virtio_gpu_vram_map_dma_buf() local 86 if (!is_virtio_device(dev) || !vgdev->has_resource_assign_uuid) { in virtio_gpu_vram_map_dma_buf() [all …]
|
D | virtgpu_display.c | 89 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_crtc_mode_set_nofb() local 92 virtio_gpu_cmd_set_scanout(vgdev, output->index, 0, in virtio_gpu_crtc_mode_set_nofb() 95 virtio_gpu_notify(vgdev); in virtio_gpu_crtc_mode_set_nofb() 107 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_crtc_atomic_disable() local 110 virtio_gpu_cmd_set_scanout(vgdev, output->index, 0, 0, 0, 0, 0); in virtio_gpu_crtc_atomic_disable() 111 virtio_gpu_notify(vgdev); in virtio_gpu_crtc_atomic_disable() 254 static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index) in vgdev_output_init() argument 256 struct drm_device *dev = vgdev->ddev; in vgdev_output_init() 257 struct virtio_gpu_output *output = vgdev->outputs + index; in vgdev_output_init() 270 primary = virtio_gpu_plane_init(vgdev, DRM_PLANE_TYPE_PRIMARY, index); in vgdev_output_init() [all …]
|
D | virtgpu_plane.c | 101 static void virtio_gpu_update_dumb_bo(struct virtio_gpu_device *vgdev, in virtio_gpu_update_dumb_bo() argument 120 virtio_gpu_cmd_transfer_to_host_2d(vgdev, off, w, h, x, y, in virtio_gpu_update_dumb_bo() 129 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_resource_flush() local 143 virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, x, y, in virtio_gpu_resource_flush() 145 virtio_gpu_notify(vgdev); in virtio_gpu_resource_flush() 152 virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, x, y, in virtio_gpu_resource_flush() 154 virtio_gpu_notify(vgdev); in virtio_gpu_resource_flush() 164 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_primary_plane_update() local 178 virtio_gpu_cmd_set_scanout(vgdev, output->index, 0, in virtio_gpu_primary_plane_update() 182 virtio_gpu_notify(vgdev); in virtio_gpu_primary_plane_update() [all …]
|
D | virtgpu_fence.c | 74 struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev, in virtio_gpu_fence_alloc() argument 79 struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv; in virtio_gpu_fence_alloc() 101 void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, in virtio_gpu_fence_emit() argument 105 struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv; in virtio_gpu_fence_emit() 127 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev, in virtio_gpu_fence_event_process() argument 130 struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv; in virtio_gpu_fence_event_process() 135 atomic64_set(&vgdev->fence_drv.last_fence_id, fence_id); in virtio_gpu_fence_event_process() 156 drm_send_event(vgdev->ddev, &curr->e->base); in virtio_gpu_fence_event_process() 166 drm_send_event(vgdev->ddev, &signaled->e->base); in virtio_gpu_fence_event_process()
|
D | virtgpu_prime.c | 35 struct virtio_gpu_device *vgdev = obj->dev->dev_private; in virtgpu_virtio_get_uuid() local 37 wait_event(vgdev->resp_wq, bo->uuid_state != STATE_INITIALIZING); in virtgpu_virtio_get_uuid() 90 int virtio_gpu_resource_assign_uuid(struct virtio_gpu_device *vgdev, in virtio_gpu_resource_assign_uuid() argument 101 return virtio_gpu_cmd_resource_assign_uuid(vgdev, objs); in virtio_gpu_resource_assign_uuid() 109 struct virtio_gpu_device *vgdev = dev->dev_private; in virtgpu_gem_prime_export() local 116 if (vgdev->has_resource_assign_uuid) { in virtgpu_gem_prime_export() 117 ret = virtio_gpu_resource_assign_uuid(vgdev, bo); in virtgpu_gem_prime_export() 121 virtio_gpu_notify(vgdev); in virtgpu_gem_prime_export()
|
D | virtgpu_drv.c | 127 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_config_changed() local 129 schedule_work(&vgdev->config_changed_work); in virtio_gpu_config_changed()
|