loader: Add an environment variable to override driver name choice.
My vc4 simulator has been implemented so far by having an entrypoint claiming to be i965, which was a bit gross. The simulator would be a lot less special if we entered through the vc4 entrypoint like normal, so add a loader environment variable to allow the i965 fd to probe as vc4. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
61bb1a9795
commit
3f462050c2
|
@ -345,6 +345,17 @@ loader_get_driver_for_fd(int fd)
|
||||||
int vendor_id, chip_id, i, j;
|
int vendor_id, chip_id, i, j;
|
||||||
char *driver = NULL;
|
char *driver = NULL;
|
||||||
|
|
||||||
|
/* Allow an environment variable to force choosing a different driver
|
||||||
|
* binary. If that driver binary can't survive on this FD, that's the
|
||||||
|
* user's problem, but this allows vc4 simulator to run on an i965 host,
|
||||||
|
* and may be useful for some touch testing of i915 on an i965 host.
|
||||||
|
*/
|
||||||
|
if (geteuid() == getuid()) {
|
||||||
|
driver = getenv("MESA_LOADER_DRIVER_OVERRIDE");
|
||||||
|
if (driver)
|
||||||
|
return strdup(driver);
|
||||||
|
}
|
||||||
|
|
||||||
if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
|
if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
|
||||||
|
|
||||||
#if HAVE_LIBDRM
|
#if HAVE_LIBDRM
|
||||||
|
|
Loading…
Reference in New Issue