iris: fix fallback to swrast driver
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 10 Jul 2020 07:46:53 +0000 (10:46 +0300)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Jul 2020 17:40:21 +0000 (17:40 +0000)
The helper we use to query the kernel returns -1 if the getparam is
not supported.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f402b7c57641dd ("iris: fail screen creation when kernel support is not there")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188
Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5838>

src/gallium/drivers/iris/iris_screen.c

index 373a3533dc48aa51e6c8b37f7fd074790c8301b8..dc2295689ea4c3c645c433298de6268b17cb74b1 100644 (file)
@@ -675,7 +675,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
     *
     * Checking the last feature availability will include all previous ones.
     */
-   if (!iris_getparam_integer(fd, I915_PARAM_HAS_CONTEXT_ISOLATION)) {
+   if (iris_getparam_integer(fd, I915_PARAM_HAS_CONTEXT_ISOLATION) <= 0) {
       debug_error("Kernel is too old for Iris. Consider upgrading to kernel v4.16.\n");
       return NULL;
    }