meson: Add a "prefer_iris" build option

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>
This commit is contained in:
Kenneth Graunke
2019-11-22 22:18:58 -08:00
parent bebfb17a2b
commit dbe923bff9
3 changed files with 18 additions and 3 deletions
+10 -3
View File
@@ -35,12 +35,19 @@ else
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'],
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,