When we import a resource through Gallium, we need to take account of
the offset parameter passed.
Fixes a failure seen with the VIVID V4L2 driver, which would create NV12
resources within the same BO, with an offset. Sample pipeline to
reproduce (replace videoN with your actual VIVID device node):
gst-launch-1.0 v4l2src device=/dev/videoN ! video/x-raw,format=NV12 ! glimagesink
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
rsc->bo = panfrost_bo_import(screen, whandle->handle);
rsc->slices[0].stride = whandle->stride;
+ rsc->slices[0].offset = whandle->offset;
rsc->slices[0].initialized = true;
panfrost_resource_reset_damage(rsc);
handle->handle = rsrc->bo->gem_handle;
handle->stride = rsrc->slices[0].stride;
+ handle->offset = rsrc->slices[0].offset;
return TRUE;
} else if (handle->type == WINSYS_HANDLE_TYPE_FD) {
if (scanout) {
handle->handle = fd;
handle->stride = rsrc->slices[0].stride;
+ handle->offset = rsrc->slices[0].offset;
return true;
}
}