Mesa (master): iris: Detect DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT kernel support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 1 19:13:07 UTC 2020


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Apr 29 13:53:50 2020 -0700

iris: Detect DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT kernel support

We will use this for implementing deferred flushes in the next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3802>

---

 src/gallium/drivers/iris/iris_screen.c | 10 ++++++++++
 src/gallium/drivers/iris/iris_screen.h |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index 7351b1d0027..ae486adc945 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -635,6 +635,14 @@ iris_shader_perf_log(void *data, const char *fmt, ...)
    va_end(args);
 }
 
+static void
+iris_detect_kernel_features(struct iris_screen *screen)
+{
+   /* Kernel 5.2+ */
+   if (gen_gem_supports_syncobj_wait(screen->fd))
+      screen->kernel_features |= KERNEL_HAS_WAIT_FOR_SUBMIT;
+}
+
 struct pipe_screen *
 iris_screen_create(int fd, const struct pipe_screen_config *config)
 {
@@ -724,6 +732,8 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
       iris_getparam_integer(screen->fd, I915_PARAM_SUBSLICE_TOTAL);
    assert(screen->subslice_total >= 1);
 
+   iris_detect_kernel_features(screen);
+
    struct pipe_screen *pscreen = &screen->base;
 
    iris_init_screen_fence_functions(pscreen);
diff --git a/src/gallium/drivers/iris/iris_screen.h b/src/gallium/drivers/iris/iris_screen.h
index 76d726fd9a4..6d5d1c58074 100644
--- a/src/gallium/drivers/iris/iris_screen.h
+++ b/src/gallium/drivers/iris/iris_screen.h
@@ -168,6 +168,10 @@ struct iris_screen {
       bool always_flush_cache;
    } driconf;
 
+   /** Does the kernel support various features (KERNEL_HAS_* bitfield)? */
+   unsigned kernel_features;
+#define KERNEL_HAS_WAIT_FOR_SUBMIT (1<<0)
+
    unsigned subslice_total;
 
    uint64_t aperture_bytes;



More information about the mesa-commit mailing list