Log when WLR_BACKENDS/WLR_RENDERER is set

Makes it easier to figure out why a backend/renderer is picked.
This commit is contained in:
Simon Ser 2021-04-28 21:06:41 +02:00
parent cc1b66364c
commit 1c1ef69326
2 changed files with 6 additions and 0 deletions

View File

@ -237,6 +237,9 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display) {
char *names = getenv("WLR_BACKENDS");
if (names) {
wlr_log(WLR_INFO, "Loading user-specified backends due to WLR_BACKENDS: %s",
names);
names = strdup(names);
if (names == NULL) {
wlr_log(WLR_ERROR, "allocation failed");

View File

@ -234,6 +234,9 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
struct wlr_renderer *wlr_renderer_autocreate_with_drm_fd(int drm_fd) {
const char *name = getenv("WLR_RENDERER");
if (name) {
wlr_log(WLR_INFO, "Loading user-specified renderer due to WLR_RENDERER: %s",
name);
#if WLR_HAS_GLES2_RENDERER
if (strcmp(name, "gles2") == 0) {
if (drm_fd < 0) {