summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-09-25 10:44:44 -0700
committerGurchetan Singh <[email protected]>2019-10-02 17:57:59 -0700
commita1a567211828731f263c977865b51832f90f15ea (patch)
treec67a6d9cb63bc9f0f20b30a782685d5d8839e9fc /src/gallium
parent9bde8f3a8fcb6c3e0bf1fe4b87155161b85cf9b6 (diff)
virgl: honor winsys supplied metadata
To truly to do this correctly, we'll have to fix the discrepancy between drm_virtgpu_3d_transfer_to_host and virtio_gpu_transfer_host_3d. However, this is a good starting point. Since virtio-gpu only supports self-import and export, this should be fine. Let's only do WINSYS_HANDLE_TYPE_FD for this currently. Reviewed by: Robert Tarasov <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 01e1f51d757..0fe61bbe465 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -313,10 +313,15 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
struct virgl_hw_res *res = NULL;
uint32_t handle = whandle->handle;
- if (whandle->offset != 0) {
+ if (whandle->offset != 0 && whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
_debug_printf("attempt to import unsupported winsys offset %u\n",
whandle->offset);
return NULL;
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
+ *plane = whandle->plane;
+ *stride = whandle->stride;
+ *plane_offset = whandle->offset;
+ *modifier = whandle->modifier;
}
mtx_lock(&qdws->bo_handles_mutex);