mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 07:00:45 +02:00
v3d, vc4: Fix dmabuf import for non-scanout buffers
Failure to create a buffer for scanout should not be fatal when importing a buffer. Buffers allocated from a render-only device may not be able to scanned out directly but can still be used for other rendering purposes (e.g. as a texture). Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12081>
This commit is contained in:
parent
b3e1f45cfb
commit
7bcb223639
3 changed files with 6 additions and 12 deletions
|
|
@ -208,7 +208,7 @@ spec@ext_framebuffer_object@fbo-blending-formats,Fail
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB10,Fail
|
spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB10,Fail
|
||||||
spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail
|
spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail
|
||||||
spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail
|
spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export-tex,Crash
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export-tex,Fail
|
||||||
spec@ext_packed_depth_stencil@texwrap formats bordercolor,Fail
|
spec@ext_packed_depth_stencil@texwrap formats bordercolor,Fail
|
||||||
spec@ext_packed_depth_stencil@texwrap formats bordercolor@GL_DEPTH24_STENCIL8- border color only,Fail
|
spec@ext_packed_depth_stencil@texwrap formats bordercolor@GL_DEPTH24_STENCIL8- border color only,Fail
|
||||||
spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled,Fail
|
spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled,Fail
|
||||||
|
|
|
||||||
|
|
@ -432,10 +432,11 @@ v3d_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
return v3d_bo_flink(bo, &whandle->handle);
|
return v3d_bo_flink(bo, &whandle->handle);
|
||||||
case WINSYS_HANDLE_TYPE_KMS:
|
case WINSYS_HANDLE_TYPE_KMS:
|
||||||
if (screen->ro) {
|
if (screen->ro) {
|
||||||
assert(rsc->scanout);
|
if (renderonly_get_handle(rsc->scanout, whandle)) {
|
||||||
bool ok = renderonly_get_handle(rsc->scanout, whandle);
|
whandle->stride = rsc->slices[0].stride;
|
||||||
whandle->stride = rsc->slices[0].stride;
|
return true;
|
||||||
return ok;
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
whandle->handle = bo->handle;
|
whandle->handle = bo->handle;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -928,10 +929,6 @@ v3d_resource_from_handle(struct pipe_screen *pscreen,
|
||||||
renderonly_create_gpu_import_for_resource(prsc,
|
renderonly_create_gpu_import_for_resource(prsc,
|
||||||
screen->ro,
|
screen->ro,
|
||||||
NULL);
|
NULL);
|
||||||
if (!rsc->scanout) {
|
|
||||||
fprintf(stderr, "Failed to create scanout resource.\n");
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsc->tiled && whandle->stride != slice->stride) {
|
if (rsc->tiled && whandle->stride != slice->stride) {
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,6 @@ vc4_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
return vc4_bo_flink(rsc->bo, &whandle->handle);
|
return vc4_bo_flink(rsc->bo, &whandle->handle);
|
||||||
case WINSYS_HANDLE_TYPE_KMS:
|
case WINSYS_HANDLE_TYPE_KMS:
|
||||||
if (screen->ro) {
|
if (screen->ro) {
|
||||||
assert(rsc->scanout);
|
|
||||||
return renderonly_get_handle(rsc->scanout, whandle);
|
return renderonly_get_handle(rsc->scanout, whandle);
|
||||||
}
|
}
|
||||||
whandle->handle = rsc->bo->handle;
|
whandle->handle = rsc->bo->handle;
|
||||||
|
|
@ -689,8 +688,6 @@ vc4_resource_from_handle(struct pipe_screen *pscreen,
|
||||||
renderonly_create_gpu_import_for_resource(prsc,
|
renderonly_create_gpu_import_for_resource(prsc,
|
||||||
screen->ro,
|
screen->ro,
|
||||||
NULL);
|
NULL);
|
||||||
if (!rsc->scanout)
|
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsc->tiled && whandle->stride != slice->stride) {
|
if (rsc->tiled && whandle->stride != slice->stride) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue