[Mesa-dev] [PATCH 4/7] broadcom/vc4: Detect syncobj support

Stefan Schake stschake at gmail.com
Sat Apr 21 22:41:22 UTC 2018


We need to know if the kernel supports syncobj submission since otherwise
all the DRM syncobj calls fail.

Signed-off-by: Stefan Schake <stschake at gmail.com>
---
 src/gallium/drivers/vc4/vc4_screen.c    | 2 ++
 src/gallium/drivers/vc4/vc4_screen.h    | 1 +
 src/gallium/drivers/vc4/vc4_simulator.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index cead71b77c..5b956001d9 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -683,6 +683,8 @@ vc4_screen_create(int fd, struct renderonly *ro)
                 vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_MADVISE);
         screen->has_perfmon_ioctl =
                 vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_PERFMON);
+        screen->has_syncobj =
+                vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_SYNCOBJ);
 
         if (!vc4_get_chip_info(screen))
                 goto fail;
diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h
index 0b884423ba..438e90a1a2 100644
--- a/src/gallium/drivers/vc4/vc4_screen.h
+++ b/src/gallium/drivers/vc4/vc4_screen.h
@@ -98,6 +98,7 @@ struct vc4_screen {
         bool has_madvise;
         bool has_tiling_ioctl;
         bool has_perfmon_ioctl;
+        bool has_syncobj;
 
         struct vc4_simulator_file *sim_file;
 };
diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c
index 37c098a04e..f4a8f5bc29 100644
--- a/src/gallium/drivers/vc4/vc4_simulator.c
+++ b/src/gallium/drivers/vc4/vc4_simulator.c
@@ -621,6 +621,7 @@ vc4_simulator_get_param_ioctl(int fd, struct drm_vc4_get_param *args)
 
         case DRM_VC4_PARAM_SUPPORTS_MADVISE:
         case DRM_VC4_PARAM_SUPPORTS_PERFMON:
+        case DRM_VC4_PARAM_SUPPORTS_SYNCOBJ:
                 errno = -EINVAL;
                 return -1;
 
-- 
2.14.1



More information about the mesa-dev mailing list