mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 09:59:48 +01:00
render/egl: query and display EGL driver name
GL_RENDERER typically displays a human-readable string for the name
of the GPU, and EGL_VENDOR typically displays a human-readable string
for the GPU manufacturer. EGL_DRIVER_NAME_EXT should give the name of
the driver in use.
References: e8baa0bf39
This commit is contained in:
parent
8008d21f5b
commit
101b9a193d
1 changed files with 11 additions and 1 deletions
12
render/egl.c
12
render/egl.c
|
@ -251,7 +251,7 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display) {
|
|||
"eglQueryWaylandBufferWL");
|
||||
}
|
||||
|
||||
const char *device_exts_str = NULL;
|
||||
const char *device_exts_str = NULL, *driver_name = NULL;
|
||||
if (check_egl_ext(client_exts_str, "EGL_EXT_device_query")) {
|
||||
load_egl_proc(&egl->procs.eglQueryDisplayAttribEXT,
|
||||
"eglQueryDisplayAttribEXT");
|
||||
|
@ -285,6 +285,13 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef EGL_DRIVER_NAME_EXT
|
||||
if (check_egl_ext(device_exts_str, "EGL_EXT_device_persistent_id")) {
|
||||
driver_name = egl->procs.eglQueryDeviceStringEXT(egl->device,
|
||||
EGL_DRIVER_NAME_EXT);
|
||||
}
|
||||
#endif
|
||||
|
||||
egl->exts.device_drm_ext =
|
||||
check_egl_ext(device_exts_str, "EGL_EXT_device_drm");
|
||||
}
|
||||
|
@ -309,6 +316,9 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display) {
|
|||
wlr_log(WLR_INFO, "Supported EGL device extensions: %s", device_exts_str);
|
||||
}
|
||||
wlr_log(WLR_INFO, "EGL vendor: %s", eglQueryString(egl->display, EGL_VENDOR));
|
||||
if (driver_name != NULL) {
|
||||
wlr_log(WLR_INFO, "EGL driver name: %s", driver_name);
|
||||
}
|
||||
|
||||
init_dmabuf_formats(egl);
|
||||
|
||||
|
|
Loading…
Reference in a new issue