From ed5d16cec197d163a2de686d5dad44ef7518a716 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Tue, 13 Sep 2022 15:57:28 +1000 Subject: [PATCH] iris: check i915 features after hw gen when running recent Mesa on i855 (gen 2) without amber drivers: error: Kernel is too old for Iris. Consider upgrading to kernel v4.16. libGL error: glx: failed to create dri3 screen libGL error: failed to load driver: iris error: Kernel is too old for Iris. Consider upgrading to kernel v4.16. libGL error: glx: failed to create dri2 screen libGL error: failed to load driver: iris move the i915 feature check to after the hardware generation check which results in: MESA: warning: Driver does not support the 0x3582 PCI ID. libGL error: glx: failed to create dri3 screen libGL error: failed to load driver: iris MESA: warning: Driver does not support the 0x3582 PCI ID. libGL error: glx: failed to create dri2 screen libGL error: failed to load driver: iris Cc: mesa-stable Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_screen.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index c609dff1e52..00b8ddf40cb 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -775,6 +775,19 @@ iris_init_identifier_bo(struct iris_screen *screen) struct pipe_screen * iris_screen_create(int fd, const struct pipe_screen_config *config) { + struct iris_screen *screen = rzalloc(NULL, struct iris_screen); + if (!screen) + return NULL; + + if (!intel_get_device_info_from_fd(fd, &screen->devinfo)) + return NULL; + screen->pci_id = screen->devinfo.pci_device_id; + + p_atomic_set(&screen->refcount, 1); + + if (screen->devinfo.ver < 8 || screen->devinfo.platform == INTEL_PLATFORM_CHV) + return NULL; + /* Here are the i915 features we need for Iris (in chronological order) : * - I915_PARAM_HAS_EXEC_NO_RELOC (3.10) * - I915_PARAM_HAS_EXEC_HANDLE_LUT (3.10) @@ -789,19 +802,6 @@ iris_screen_create(int fd, const struct pipe_screen_config *config) return NULL; } - struct iris_screen *screen = rzalloc(NULL, struct iris_screen); - if (!screen) - return NULL; - - if (!intel_get_device_info_from_fd(fd, &screen->devinfo)) - return NULL; - screen->pci_id = screen->devinfo.pci_device_id; - - p_atomic_set(&screen->refcount, 1); - - if (screen->devinfo.ver < 8 || screen->devinfo.platform == INTEL_PLATFORM_CHV) - return NULL; - driParseConfigFiles(config->options, config->options_info, 0, "iris", NULL, NULL, NULL, 0, NULL, 0);