From: Eric Anholt Date: Thu, 25 Oct 2018 16:17:17 +0000 (-0700) Subject: vc4: Don't return a vc4 BO handle on a renderonly screen. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc71bf529c7184c59fbc66a978188473d925b7ea;p=mesa.git vc4: Don't return a vc4 BO handle on a renderonly screen. The handles exported need to be on the KMS device's fd, anything else is failure. Also, this code is assuming that the scanout resource has been created already, so assert it. --- diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index 2509456b957..e82fbeaafcc 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -319,8 +319,10 @@ vc4_resource_get_handle(struct pipe_screen *pscreen, return vc4_bo_flink(rsc->bo, &whandle->handle); case WINSYS_HANDLE_TYPE_KMS: - if (screen->ro && renderonly_get_handle(rsc->scanout, whandle)) - return TRUE; + if (screen->ro) { + assert(rsc->scanout); + return renderonly_get_handle(rsc->scanout, whandle); + } whandle->handle = rsc->bo->handle; return TRUE; case WINSYS_HANDLE_TYPE_FD: