Hi all,

Don't hesitate to recycle parts of my old try at DriConf Replacement:

https://github.com/axeldavy/driCenter

It had automatic detection of prime system and of the device_id.
It detected also on which card apps run, and running apps.


Yours,

Axel

On 18/01/2018 11:07, Michel Dänzer wrote:
On 2018-01-17 09:50 PM, Jean Hertel wrote:
Hello Michel,
Hello Nicolai,

I have spent some more time reading the Mesa source code and trying to figure 
out how the prime configuration works.
If i understood correctly the driconf XML format should have an option inside each 
application indicating if PRIME should be used. This option is named 
"device_id" and defines the device which this application should run.

So when Mesa loads the configuration, if the application has the "device_id" it 
will run under this driver. Am I correct?
Yes, but note that this only works with DRI3. There's no way to select a
different GPU via driconf with DRI2.


If this is the case, then to correctly support PRIME the expected behavior of 
the configuration GUI should be:
1 - Find out if this is a PRIME setup
2 - If its PRIME, give the user an option to select on which device this 
application should run.
Sounds good to me.


Some more questions that I still have to understand:
- How do we detect at user-land that we are under a PRIME setup?

- I suppose there is some way to query the device_id directly from Mesa (maybe 
using Xlib). Any idea which API can be called for this?
I'm not sure there are high level APIs available for these. One might
have to resort to udev or libdrm or even peek around in /sys/ .


- Having the device_id, how can I get additional data for this device (for 
example the vendor name and the full hardware description). I assume there is 
already an API that makes this possible, as the actual driconf is capable of 
identifying the hardware correctly.
I'm afraid it may not be that simple. Keep in mind that driconf was
created long before PRIME, so the APIs for retrieving information about
supported options may not allow choosing different GPUs available via PRIME.



_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to