[22/24] drm/virtio: implement blob resources: report blob mem to userspace
diff mbox series

Message ID 20200814024000.2485-23-gurchetansingh@chromium.org
State New
Headers show
  • Blob prerequisites + blob resources
Related show

Commit Message

Gurchetan Singh Aug. 14, 2020, 2:39 a.m. UTC
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>
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 3 +++
 1 file changed, 3 insertions(+)

diff mbox series

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 0075995a9f5b..7dbe24248a20 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -300,6 +300,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;
 	return 0;