From: Gurchetan Singh Date: Thu, 24 Sep 2020 00:32:12 +0000 (-0700) Subject: drm/virtio: implement blob resources: report blob mem to userspace X-Git-Tag: v5.11-rc1~206^2~15^2~136 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4429b5de01ad974219ca81a98f152c53c3d34f9b;p=thirdparty%2Flinux.git 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 Acked-by: Tomeu Vizoso Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-17-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann --- diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 0bf789f2bfdec..b0c9dd171ad8a 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; }