diff options
| author | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-19 08:18:47 +0200 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-29 22:50:55 +0100 |
| commit | 6c1cd97bdaffa2ae1dbdc8a0857931308ac647cd (patch) | |
| tree | 5a23cc28ebea931ff5d800dcff7a9268e3bb0fbe /drivers/gpu/drm/virtio/virtgpu_ioctl.c | |
| parent | 724cfdfd667a28dbfb5365b76df4ccf39cf9a09a (diff) | |
drm/virtio: fix resource id handling
Move virtio_gpu_resource_id_{get,put} to virtgpu_object.c and make them
static. Allocate and free the id on creation and destroy, drop all
other calls. That way objects have a valid handle for the whole
lifetime of the object.
Also fixes ids leaking. Worst offender are dumb buffers, and I think
some error paths too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20181019061847.18958-7-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_ioctl.c')
| -rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 6179d9316763..bc5afa4f906e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -253,7 +253,6 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, if (IS_ERR(qobj)) return PTR_ERR(qobj); obj = &qobj->gem_base; - virtio_gpu_resource_id_get(vgdev, &qobj->hw_res_handle); if (!vgdev->has_virgl_3d) { virtio_gpu_cmd_create_resource(vgdev, qobj, rc->format, |
