meson: Add a "prefer_iris" build option
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 23 Nov 2019 06:18:58 +0000 (22:18 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Dec 2019 20:56:27 +0000 (12:56 -0800)
Enabling this option makes Intel Gen8-11 hardware load the 'iris'
driver by default instead of the older 'i965' driver.

Regardless of how this option is set, users can still override which
driver the loader selects via two methods.  The first is to create a
~/.drirc or /etc/drirc file with the following snippet:

   <driconf>
     <device driver="loader" kernel_driver="i915">
       <option name="dri_driver" value="i965" />
     </device>
   </driconf>

The other option is to set an environment variable:

   export MESA_LOADER_DRIVER_OVERRIDE=i965

For now, "prefer_iris" defaults to i965 (the historical choice).
A separate future patch will change the default driver to iris.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1893
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
include/pci_ids/i965_pci_ids.h
meson_options.txt
src/loader/meson.build

index 18eff721214dce12d0a53870d3a9ebfa864679eb..4ec79870b9efa9982c8b47828bb8446eab40558d 100644 (file)
@@ -95,6 +95,7 @@ CHIPSET(0x22B0, chv,     "Intel(R) HD Graphics (Cherrytrail)")
 CHIPSET(0x22B1, chv,     "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */
 CHIPSET(0x22B2, chv,     "Intel(R) HD Graphics (Cherryview)")
 CHIPSET(0x22B3, chv,     "Intel(R) HD Graphics (Cherryview)")
 CHIPSET(0x22B1, chv,     "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */
 CHIPSET(0x22B2, chv,     "Intel(R) HD Graphics (Cherryview)")
 CHIPSET(0x22B3, chv,     "Intel(R) HD Graphics (Cherryview)")
+#ifndef PREFER_IRIS
 CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1")
 CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1")
 CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1")
 CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1")
 CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1")
 CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1")
@@ -240,3 +241,4 @@ CHIPSET(0x4500, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)")
 CHIPSET(0x4571, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)")
 CHIPSET(0x4551, ehl_4x4, "Intel(R) HD Graphics (Elkhart Lake 4x4)")
 CHIPSET(0x4541, ehl_2x4, "Intel(R) HD Graphics (Elkhart Lake 2x4)")
 CHIPSET(0x4571, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)")
 CHIPSET(0x4551, ehl_4x4, "Intel(R) HD Graphics (Elkhart Lake 4x4)")
 CHIPSET(0x4541, ehl_2x4, "Intel(R) HD Graphics (Elkhart Lake 2x4)")
+#endif
index 8c3e9978529310baafa852d0e1260c30f6df079a..dd7bf4bccaa4bce79bbf2b64cce098d6eea2e0e0 100644 (file)
@@ -347,6 +347,12 @@ option(
   value : false,
   description : 'Allow work-in-progress freedreno vulkan driver to be enabled',
 )
   value : false,
   description : 'Allow work-in-progress freedreno vulkan driver to be enabled',
 )
+option(
+  'prefer-iris',
+  type : 'boolean',
+  value : false,
+  description : 'Prefer new Intel iris driver over older i965 driver'
+)
 option('egl-lib-suffix',
   type : 'string',
   value : '',
 option('egl-lib-suffix',
   type : 'string',
   value : '',
index 00ba1491c45da0b1c1befd64c686ae7c3102d4c9..e7dce88d443e3d746d88d0b17642c00716e2295c 100644 (file)
@@ -35,12 +35,19 @@ else
   libloader_dri3_helper = []
 endif
 
   libloader_dri3_helper = []
 endif
 
+loader_c_args = [
+  c_vis_args, '-DUSE_DRICONF',
+  '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
+]
+
+if with_gallium_iris and get_option('prefer-iris')
+  loader_c_args += ['-DPREFER_IRIS']
+endif
+
 libloader = static_library(
   'loader',
   ['loader.c', 'pci_id_driver_map.c'],
 libloader = static_library(
   'loader',
   ['loader.c', 'pci_id_driver_map.c'],
-  c_args : [c_vis_args, '-DUSE_DRICONF',
-            '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
-],
+  c_args : loader_c_args,
   include_directories : [inc_include, inc_src, inc_util],
   dependencies : [dep_libdrm, dep_thread, idep_xmlconfig_headers],
   build_by_default : false,
   include_directories : [inc_include, inc_src, inc_util],
   dependencies : [dep_libdrm, dep_thread, idep_xmlconfig_headers],
   build_by_default : false,