summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_screen.c
diff options
context:
space:
mode:
authorStefan Schake <[email protected]>2018-04-25 00:01:00 +0200
committerEric Anholt <[email protected]>2018-05-17 16:04:30 +0100
commitb0acc3a5628c6c6dd669cbb7cff2d974b175605e (patch)
treeef0d04117ae2f56fc3c891e4baf1cb93974af265 /src/gallium/drivers/vc4/vc4_screen.c
parent44036c354d800dda08d3688b042130039f3d592a (diff)
broadcom/vc4: Native fence fd support
With the syncobj support in place, lets use it to implement the EGL_ANDROID_native_fence_sync extension. This mostly follows previous implementations in freedreno and etnaviv. v2: Drop the flags (Eric) Handle in_fence_fd already in job_submit (Eric) Drop extra vc4_fence_context_init (Eric) Dup fds with CLOEXEC (Eric) Mention exact extension name (Eric) Signed-off-by: Stefan Schake <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_screen.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 5476b8cf10c..d497cd2e869 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -148,6 +148,9 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TEXTURE_BARRIER:
return 1;
+ case PIPE_CAP_NATIVE_FENCE_FD:
+ return screen->has_syncobj;
+
case PIPE_CAP_TILE_RASTER_ORDER:
return vc4_has_feature(screen,
DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER);
@@ -263,7 +266,6 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
- case PIPE_CAP_NATIVE_FENCE_FD:
case PIPE_CAP_TGSI_FS_FBFETCH:
case PIPE_CAP_TGSI_MUL_ZERO_WINS:
case PIPE_CAP_DOUBLES:
@@ -708,7 +710,7 @@ vc4_screen_create(int fd, struct renderonly *ro)
slab_create_parent(&screen->transfer_pool, sizeof(struct vc4_transfer), 16);
- vc4_fence_init(screen);
+ vc4_fence_screen_init(screen);
vc4_debug = debug_get_option_vc4_debug();
if (vc4_debug & VC4_DEBUG_SHADERDB)