Lines Matching refs:vgdev

42 static void virtio_gpu_create_context_locked(struct virtio_gpu_device *vgdev,  in virtio_gpu_create_context_locked()  argument
46 virtio_gpu_cmd_context_create(vgdev, vfpriv->ctx_id, in virtio_gpu_create_context_locked()
54 virtio_gpu_cmd_context_create(vgdev, vfpriv->ctx_id, in virtio_gpu_create_context_locked()
64 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_create_context() local
71 virtio_gpu_create_context_locked(vgdev, vfpriv); in virtio_gpu_create_context()
80 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_map_ioctl() local
83 return virtio_gpu_mode_dumb_mmap(file, vgdev->ddev, in virtio_gpu_map_ioctl()
91 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_getparam_ioctl() local
97 value = vgdev->has_virgl_3d ? 1 : 0; in virtio_gpu_getparam_ioctl()
103 value = vgdev->has_resource_blob ? 1 : 0; in virtio_gpu_getparam_ioctl()
106 value = vgdev->has_host_visible ? 1 : 0; in virtio_gpu_getparam_ioctl()
109 value = vgdev->has_resource_assign_uuid ? 1 : 0; in virtio_gpu_getparam_ioctl()
112 value = vgdev->has_context_init ? 1 : 0; in virtio_gpu_getparam_ioctl()
115 value = vgdev->capset_id_mask; in virtio_gpu_getparam_ioctl()
118 value = vgdev->has_context_init ? 1 : 0; in virtio_gpu_getparam_ioctl()
132 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_resource_create_ioctl() local
141 if (vgdev->has_virgl_3d) { in virtio_gpu_resource_create_ioctl()
172 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, 0); in virtio_gpu_resource_create_ioctl()
175 ret = virtio_gpu_object_create(vgdev, &params, &qobj, fence); in virtio_gpu_resource_create_ioctl()
227 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_transfer_from_host_ioctl() local
236 if (vgdev->has_virgl_3d == false) in virtio_gpu_transfer_from_host_ioctl()
259 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, 0); in virtio_gpu_transfer_from_host_ioctl()
266 (vgdev, vfpriv->ctx_id, offset, args->level, args->stride, in virtio_gpu_transfer_from_host_ioctl()
269 virtio_gpu_notify(vgdev); in virtio_gpu_transfer_from_host_ioctl()
282 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_transfer_to_host_ioctl() local
301 if (!vgdev->has_virgl_3d) { in virtio_gpu_transfer_to_host_ioctl()
303 (vgdev, offset, in virtio_gpu_transfer_to_host_ioctl()
319 fence = virtio_gpu_fence_alloc(vgdev, vgdev->fence_drv.context, in virtio_gpu_transfer_to_host_ioctl()
325 (vgdev, in virtio_gpu_transfer_to_host_ioctl()
331 virtio_gpu_notify(vgdev); in virtio_gpu_transfer_to_host_ioctl()
371 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_get_caps_ioctl() local
380 if (vgdev->num_capsets == 0) in virtio_gpu_get_caps_ioctl()
387 spin_lock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
388 for (i = 0; i < vgdev->num_capsets; i++) { in virtio_gpu_get_caps_ioctl()
389 if (vgdev->capsets[i].id == args->cap_set_id) { in virtio_gpu_get_caps_ioctl()
390 if (vgdev->capsets[i].max_version >= args->cap_set_ver) { in virtio_gpu_get_caps_ioctl()
398 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
402 host_caps_size = vgdev->capsets[found_valid].max_size; in virtio_gpu_get_caps_ioctl()
406 list_for_each_entry(cache_ent, &vgdev->cap_cache, head) { in virtio_gpu_get_caps_ioctl()
409 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
413 spin_unlock(&vgdev->display_info_lock); in virtio_gpu_get_caps_ioctl()
416 ret = virtio_gpu_cmd_get_capset(vgdev, found_valid, args->cap_set_ver, in virtio_gpu_get_caps_ioctl()
420 virtio_gpu_notify(vgdev); in virtio_gpu_get_caps_ioctl()
423 ret = wait_event_timeout(vgdev->resp_wq, in virtio_gpu_get_caps_ioctl()
439 static int verify_blob(struct virtio_gpu_device *vgdev, in verify_blob() argument
445 if (!vgdev->has_resource_blob) in verify_blob()
452 if (!vgdev->has_resource_assign_uuid) in verify_blob()
471 if (!vgdev->has_virgl_3d) in verify_blob()
506 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_resource_create_blob_ioctl() local
510 if (verify_blob(vgdev, vfpriv, &params, rc_blob, in virtio_gpu_resource_create_blob_ioctl()
514 if (vgdev->has_virgl_3d) in virtio_gpu_resource_create_blob_ioctl()
526 virtio_gpu_cmd_submit(vgdev, buf, rc_blob->cmd_size, in virtio_gpu_resource_create_blob_ioctl()
531 ret = virtio_gpu_object_create(vgdev, &params, &bo, NULL); in virtio_gpu_resource_create_blob_ioctl()
533 ret = virtio_gpu_vram_create(vgdev, &params, &bo); in virtio_gpu_resource_create_blob_ioctl()
547 ret = virtio_gpu_resource_assign_uuid(vgdev, bo); in virtio_gpu_resource_create_blob_ioctl()
582 struct virtio_gpu_device *vgdev = dev->dev_private; in virtio_gpu_context_init_ioctl() local
589 if (!vgdev->has_context_init || !vgdev->has_virgl_3d) in virtio_gpu_context_init_ioctl()
619 if ((vgdev->capset_id_mask & (1ULL << value)) == 0) { in virtio_gpu_context_init_ioctl()
687 virtio_gpu_create_context_locked(vgdev, vfpriv); in virtio_gpu_context_init_ioctl()
688 virtio_gpu_notify(vgdev); in virtio_gpu_context_init_ioctl()