[Mesa-dev] [PATCH] glx: set the custom logger across all DRI impls.

Emil Velikov emil.l.velikov at gmail.com
Fri Sep 13 10:52:59 UTC 2019


From: Emil Velikov <emil.velikov at collabora.com>

Earlier commit refactored common code into the loader, yet did not set
the custom logger (one that honours LIBGL_DEBUG).

Thus LIBGL_DEBUG=verbose was working only with DRI3.

Fixes: d971a4230d5 ("loader: Factor out the common driver opening logic from each loader.")
Cc: Eric Anholt <eric at anholt.net>
Cc: Eric Engestrom <eric.engestrom at intel.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/glx/dri2_glx.c  | 2 ++
 src/glx/dri3_glx.c  | 4 ++--
 src/glx/dri_glx.c   | 2 ++
 src/glx/drisw_glx.c | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index d6a543c8da0..3105e01983b 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1425,6 +1425,8 @@ dri2CreateDisplay(Display * dpy)
    struct dri2_display *pdp;
    int eventBase, errorBase, i;
 
+   loader_set_logger(dri_message);
+
    if (!DRI2QueryExtension(dpy, &eventBase, &errorBase))
       return NULL;
 
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index a5cf0e3bf32..b700871fefc 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -1061,6 +1061,8 @@ dri3_create_display(Display * dpy)
    xcb_generic_error_t                  *error;
    const xcb_query_extension_reply_t    *extension;
 
+   loader_set_logger(dri_message);
+
    xcb_prefetch_extension_data(c, &xcb_dri3_id);
    xcb_prefetch_extension_data(c, &xcb_present_id);
 
@@ -1105,8 +1107,6 @@ dri3_create_display(Display * dpy)
    pdp->base.destroyDisplay = dri3_destroy_display;
    pdp->base.createScreen = dri3_create_screen;
 
-   loader_set_logger(dri_message);
-
    pdp->loader_extensions = loader_extensions;
 
    return &pdp->base;
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index 6e9412d3fb1..ae7b5a736d2 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -987,6 +987,8 @@ driCreateDisplay(Display * dpy)
    int eventBase, errorBase;
    int major, minor, patch;
 
+   loader_set_logger(dri_message);
+
    if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
       return NULL;
    }
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index f38dbbca2df..2efee2aa841 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -973,6 +973,8 @@ driswCreateDisplay(Display * dpy)
 {
    struct drisw_display *pdpyp;
 
+   loader_set_logger(dri_message);
+
    pdpyp = malloc(sizeof *pdpyp);
    if (pdpyp == NULL)
       return NULL;
-- 
2.23.0



More information about the mesa-dev mailing list