mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02: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> (cherry picked from commit4be68b119e)
This commit is contained in:
parent
89527d22dc
commit
0a1a13fb21
4 changed files with 26 additions and 10 deletions
|
|
@ -114,7 +114,7 @@
|
|||
"description": "loader: Don't load nouveau GL on nvidia kmd",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "e99446fc5e6b773cd2a77f1315a08b5e200ae5b9",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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