Mesa (staging/20.0): iris: fail screen creation when kernel support is not there
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 23 04:37:49 UTC 2020
Module: Mesa
Branch: staging/20.0
Commit: 3b4a9206f47587feaa61441e53c433d9302cf262
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b4a9206f47587feaa61441e53c433d9302cf262
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Mon Apr 20 17:09:42 2020 +0300
iris: fail screen creation when kernel support is not there
v2: Bump check to I915_PARAM_HAS_CONTEXT_ISOLATION (v4.16) (Ken)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2803
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4643>
(cherry picked from commit f402b7c57641dd2ab4d39032574294c03d75b595)
---
.pick_status.json | 2 +-
src/gallium/drivers/iris/iris_screen.c | 24 +++++++++++++++++++-----
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index a0abadd9378..0eb11a276cb 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -265,7 +265,7 @@
"description": "iris: fail screen creation when kernel support is not there",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index 4ab43e1b1da..6ba21451a62 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -559,22 +559,22 @@ iris_get_disk_shader_cache(struct pipe_screen *pscreen)
}
static int
-iris_getparam(struct iris_screen *screen, int param, int *value)
+iris_getparam(int fd, int param, int *value)
{
struct drm_i915_getparam gp = { .param = param, .value = value };
- if (ioctl(screen->fd, DRM_IOCTL_I915_GETPARAM, &gp) == -1)
+ if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) == -1)
return -errno;
return 0;
}
static int
-iris_getparam_integer(struct iris_screen *screen, int param)
+iris_getparam_integer(int fd, int param)
{
int value = -1;
- if (iris_getparam(screen, param, &value) == 0)
+ if (iris_getparam(fd, param, &value) == 0)
return value;
return -1;
@@ -631,6 +631,20 @@ iris_shader_perf_log(void *data, const char *fmt, ...)
struct pipe_screen *
iris_screen_create(int fd, const struct pipe_screen_config *config)
{
+ /* Here are the i915 features we need for Iris (in chronoligical order) :
+ * - I915_PARAM_HAS_EXEC_NO_RELOC (3.10)
+ * - I915_PARAM_HAS_EXEC_HANDLE_LUT (3.10)
+ * - I915_PARAM_HAS_EXEC_BATCH_FIRST (4.13)
+ * - I915_PARAM_HAS_EXEC_FENCE_ARRAY (4.14)
+ * - I915_PARAM_HAS_CONTEXT_ISOLATION (4.16)
+ *
+ * Checking the last feature availability will include all previous ones.
+ */
+ if (!iris_getparam_integer(fd, I915_PARAM_HAS_CONTEXT_ISOLATION)) {
+ debug_error("Kernel is too old for Iris. Consider upgrading to kernel v4.16.\n");
+ return NULL;
+ }
+
struct iris_screen *screen = rzalloc(NULL, struct iris_screen);
if (!screen)
return NULL;
@@ -700,7 +714,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
sizeof(struct iris_transfer), 64);
screen->subslice_total =
- iris_getparam_integer(screen, I915_PARAM_SUBSLICE_TOTAL);
+ iris_getparam_integer(screen->fd, I915_PARAM_SUBSLICE_TOTAL);
assert(screen->subslice_total >= 1);
struct pipe_screen *pscreen = &screen->base;
More information about the mesa-commit
mailing list