summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio/virtgpu_gem.c
diff options
context:
space:
mode:
authorGerd Hoffmann2018-10-19 08:18:42 +0200
committerGerd Hoffmann2018-10-29 22:50:55 +0100
commit23c897d72ca8064c626be0ef73fe671488d584bb (patch)
tree7f3fb51dc44840cda5601e9cb2c2a92902a72519 /drivers/gpu/drm/virtio/virtgpu_gem.c
parentgpu: drm/lease: fix spelling mistake, EACCESS -> EACCES (diff)
downloadkernel-qcow2-linux-23c897d72ca8064c626be0ef73fe671488d584bb.tar.gz
kernel-qcow2-linux-23c897d72ca8064c626be0ef73fe671488d584bb.tar.xz
kernel-qcow2-linux-23c897d72ca8064c626be0ef73fe671488d584bb.zip
drm/virtio: track created object state
Track whenever the virtio_gpu_object is already created (i.e. host knows about it) in a new variable. Add checks to virtio_gpu_object_attach() to do nothing on objects not created yet. Make virtio_gpu_ttm_bo_destroy() use the new variable too, instead of expecting hw_res_handle indicating the object state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: http://patchwork.freedesktop.org/patch/msgid/20181019061847.18958-2-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_gem.c')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 82c817f37cf7..33dbd5aed705 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -103,8 +103,9 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
goto fail;
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888);
+ obj = gem_to_virtio_gpu_obj(gobj);
virtio_gpu_resource_id_get(vgdev, &resid);
- virtio_gpu_cmd_create_resource(vgdev, resid, format,
+ virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
args->width, args->height);
/* attach the object to the resource */