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.
This commit is contained in:
Eric Anholt 2018-10-25 09:17:17 -07:00
parent cc0bc76a38
commit cc71bf529c

View file

@ -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: