Lines Matching refs:vgdev
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()
244 virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, in virtio_gpu_execbuffer_ioctl()
247 virtio_gpu_notify(vgdev); in virtio_gpu_execbuffer_ioctl()
269 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_getparam_ioctl() local
275 value = vgdev->has_virgl_3d ? 1 : 0; in virtio_gpu_getparam_ioctl()
281 value = vgdev->has_resource_blob ? 1 : 0; in virtio_gpu_getparam_ioctl()
284 value = vgdev->has_host_visible ? 1 : 0; in virtio_gpu_getparam_ioctl()
287 value = vgdev->has_resource_assign_uuid ? 1 : 0; in virtio_gpu_getparam_ioctl()
290 value = vgdev->has_context_init ? 1 : 0; in virtio_gpu_getparam_ioctl()
293 value = vgdev->capset_id_mask; in virtio_gpu_getparam_ioctl()
307 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_resource_create_ioctl() local
316 if (vgdev->has_virgl_3d) { in virtio_gpu_resource_create_ioctl()
347 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, 0); in virtio_gpu_resource_create_ioctl()
350 ret = virtio_gpu_object_create(vgdev, ¶ms, &qobj, fence); in virtio_gpu_resource_create_ioctl()
402 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_transfer_from_host_ioctl() local
411 if (vgdev->has_virgl_3d == false) in virtio_gpu_transfer_from_host_ioctl()
434 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, 0); in virtio_gpu_transfer_from_host_ioctl()
441 (vgdev, vfpriv->ctx_id, offset, args->level, args->stride, in virtio_gpu_transfer_from_host_ioctl()
444 virtio_gpu_notify(vgdev); in virtio_gpu_transfer_from_host_ioctl()
457 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_transfer_to_host_ioctl() local
476 if (!vgdev->has_virgl_3d) { in virtio_gpu_transfer_to_host_ioctl()
478 (vgdev, offset, in virtio_gpu_transfer_to_host_ioctl()
494 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, in virtio_gpu_transfer_to_host_ioctl()
500 (vgdev, in virtio_gpu_transfer_to_host_ioctl()
506 virtio_gpu_notify(vgdev); in virtio_gpu_transfer_to_host_ioctl()
546 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_get_caps_ioctl() local
555 if (vgdev->num_capsets == 0) in virtio_gpu_get_caps_ioctl()
562 spin_lock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
563 for (i = 0; i < vgdev->num_capsets; i++) { in virtio_gpu_get_caps_ioctl()
564 if (vgdev->capsets[i].id == args->cap_set_id) { in virtio_gpu_get_caps_ioctl()
565 if (vgdev->capsets[i].max_version >= args->cap_set_ver) { in virtio_gpu_get_caps_ioctl()
573 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
577 host_caps_size = vgdev->capsets[found_valid].max_size; in virtio_gpu_get_caps_ioctl()
581 list_for_each_entry(cache_ent, &vgdev->cap_cache, head) { in virtio_gpu_get_caps_ioctl()
584 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
588 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
591 ret = virtio_gpu_cmd_get_capset(vgdev, found_valid, args->cap_set_ver, in virtio_gpu_get_caps_ioctl()
595 virtio_gpu_notify(vgdev); in virtio_gpu_get_caps_ioctl()
598 ret = wait_event_timeout(vgdev->resp_wq, in virtio_gpu_get_caps_ioctl()
614 static int verify_blob(struct virtio_gpu_device *vgdev, in verify_blob() argument
620 if (!vgdev->has_resource_blob) in verify_blob()
627 if (!vgdev->has_resource_assign_uuid) in verify_blob()
646 if (!vgdev->has_virgl_3d) in verify_blob()
681 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_resource_create_blob_ioctl() local
685 if (verify_blob(vgdev, vfpriv, ¶ms, rc_blob, in virtio_gpu_resource_create_blob_ioctl()
689 if (vgdev->has_virgl_3d) in virtio_gpu_resource_create_blob_ioctl()
701 virtio_gpu_cmd_submit(vgdev, buf, rc_blob->cmd_size, in virtio_gpu_resource_create_blob_ioctl()
706 ret = virtio_gpu_object_create(vgdev, ¶ms, &bo, NULL); in virtio_gpu_resource_create_blob_ioctl()
708 ret = virtio_gpu_vram_create(vgdev, ¶ms, &bo); in virtio_gpu_resource_create_blob_ioctl()
722 ret = virtio_gpu_resource_assign_uuid(vgdev, bo); in virtio_gpu_resource_create_blob_ioctl()
757 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_context_init_ioctl() local
764 if (!vgdev->has_context_init || !vgdev->has_virgl_3d) in virtio_gpu_context_init_ioctl()
794 if ((vgdev->capset_id_mask & (1ULL << value)) == 0) { in virtio_gpu_context_init_ioctl()
847 virtio_gpu_create_context_locked(vgdev, vfpriv); in virtio_gpu_context_init_ioctl()
848 virtio_gpu_notify(vgdev); in virtio_gpu_context_init_ioctl()