mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
loader: Don't load nouveau GL on nvidia kmd
The vulkan driver already has a check for this. This prevents the GL
driver from loading too.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13484
Fixes: e99446fc ("egl: Add EGL_EXT_device_query_name and EGL_EXT_device_persistent_id")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36449>
This commit is contained in:
parent
6a217a06d9
commit
4be68b119e
3 changed files with 25 additions and 9 deletions
|
|
@ -47,6 +47,7 @@
|
|||
#include <GL/gl.h>
|
||||
#include "mesa_interface.h"
|
||||
#include "loader.h"
|
||||
#include "util/drm_is_nouveau.h"
|
||||
#include "util/libdrm.h"
|
||||
#include "util/os_file.h"
|
||||
#include "util/os_misc.h"
|
||||
|
|
@ -138,6 +139,10 @@ iris_predicate(int fd, const char *driver)
|
|||
bool
|
||||
nouveau_zink_predicate(int fd, const char *driver)
|
||||
{
|
||||
/* Never load on nv proprietary driver */
|
||||
if (!drm_fd_is_nouveau(fd))
|
||||
return false;
|
||||
|
||||
#if !defined(HAVE_NVK) || !defined(HAVE_ZINK)
|
||||
if (!strcmp(driver, "zink"))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "nouveau_device.h"
|
||||
#include "util/os_misc.h"
|
||||
#include "util/drm_is_nouveau.h"
|
||||
#include "vk_log.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
|
@ -21,15 +22,7 @@ drm_device_is_nouveau(const char *path)
|
|||
if (fd < 0)
|
||||
return false;
|
||||
|
||||
drmVersionPtr ver = drmGetVersion(fd);
|
||||
if (!ver) {
|
||||
close(fd);
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool is_nouveau = !strncmp("nouveau", ver->name, ver->name_len);
|
||||
|
||||
drmFreeVersion(ver);
|
||||
const bool is_nouveau = drm_fd_is_nouveau(fd);
|
||||
close(fd);
|
||||
|
||||
return is_nouveau;
|
||||
|
|
|
|||
18
src/util/drm_is_nouveau.h
Normal file
18
src/util/drm_is_nouveau.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef DRM_IS_NOUVEAU
|
||||
#define DRM_IS_NOUVEAU
|
||||
|
||||
#include "util/libdrm.h"
|
||||
|
||||
static inline bool
|
||||
drm_fd_is_nouveau(int fd)
|
||||
{
|
||||
drmVersionPtr ver = drmGetVersion(fd);
|
||||
if (!ver) {
|
||||
return false;
|
||||
}
|
||||
const bool is_nouveau = !strncmp("nouveau", ver->name, ver->name_len);
|
||||
drmFreeVersion(ver);
|
||||
return is_nouveau;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue