[Mesa-dev] [RFC] add a config file for dri loader to choose a different dri driver

Yu, Qiang Qiang.Yu at amd.com
Wed Aug 1 01:03:03 UTC 2018

Good idea. But adding a new device attribute seems over-kill, how
about just use the driver attribute and prefix a "k:" for kernel driver
like this: <device driver="k:amdgpu"> ?


From: Michel Dänzer <michel at daenzer.net>
Sent: Tuesday, July 31, 2018 9:35:09 PM
To: Yu, Qiang
Cc: mesa-dev at lists.freedesktop.org; Emil Velikov
Subject: Re: [Mesa-dev] [RFC] add a config file for dri loader to choose a different dri driver

On 2018-07-31 10:03 AM, Yu, Qiang wrote:
> Seems the mesa driconf infrastructure is just what I need:
> https://dri.freedesktop.org/wiki/ConfigurationInfrastructure/
> So I can reference the loader_get_dri_config_device_id implementation
> for adding loader driver override functionality in /etc/drirc:
> <driconf>
>   <device driver="loader">
>     <option name="amdgpu" value="amdgpu" />
>   </device>
> </driconf>
> Thoughts?

Using the driconf infrastructure is definitely better than creating a
new mechanism. It'll even allow configuring the driver per application. :)

Grepping for device_id in src/util/xmlpool/t_options.h and
src/loader/loader.c might be useful.

Here's an example of how I imagine general and per-application driver
configuration could work:

 <device kernel_driver="amdgpu">

  <!-- Use radeonsi by default -->
  <option name="dri_driver" value="radeonsi" />

  <!-- Use amdgpu for a specific application -->
  <application executable="fgl_glxgears">
   <option name="dri_driver" value="amdgpu" />


Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

More information about the mesa-dev mailing list