Mesa (master): vc4: Don't return a vc4 BO handle on a renderonly screen.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 16 05:12:53 UTC 2018


Module: Mesa
Branch: master
Commit: cc71bf529c7184c59fbc66a978188473d925b7ea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc71bf529c7184c59fbc66a978188473d925b7ea

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 25 09:17:17 2018 -0700

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.

---

 src/gallium/drivers/vc4/vc4_resource.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index 2509456b95..e82fbeaafc 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:




More information about the mesa-commit mailing list