diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2020-09-24 03:32:12 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-29 12:23:49 +0300 |
commit | 4429b5de01ad974219ca81a98f152c53c3d34f9b (patch) | |
tree | 45f903bbd19789d5649de966c5d6d9ad4c305631 /drivers/gpu/drm | |
parent | 50c3d1938ee380e2d24714ea7058d2d3fc2662de (diff) | |
download | linux-4429b5de01ad974219ca81a98f152c53c3d34f9b.tar.xz |
drm/virtio: implement blob resources: report blob mem to userspace
The stride field has never been used, so repurpose it to be
"blob_mem". This way, userspace can know the memory properties
of the blob if it's passed between userspace processes and
no suitable userspace API exists to transmit that knowledge.
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-17-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_ioctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 0bf789f2bfde..b0c9dd171ad8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -301,6 +301,9 @@ static int virtio_gpu_resource_info_ioctl(struct drm_device *dev, void *data, ri->size = qobj->base.base.size; ri->res_handle = qobj->hw_res_handle; + if (qobj->host3d_blob || qobj->guest_blob) + ri->blob_mem = qobj->blob_mem; + drm_gem_object_put(gobj); return 0; } |