summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-10-25 09:17:17 -0700
committerEric Anholt <[email protected]>2018-11-15 21:11:44 -0800
commitcc71bf529c7184c59fbc66a978188473d925b7ea (patch)
treed6e099c0b27d6640c2c9660fba9ef9ca169b2bfd /src/gallium/drivers/vc4/vc4_resource.c
parentcc0bc76a382f908b4412ee8ab7a8409766ecf16a (diff)
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.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c6
1 files changed, 4 insertions, 2 deletions
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: