[Mesa-dev] [PATCH mesa] glx: remove dead code

Eric Engestrom eric.engestrom at imgtec.com
Fri Sep 1 14:04:36 UTC 2017


These fields were added in 2d94601582 but never used; hasPresent was
never set, while the other ones were set but never read.

Fixes: 2d94601582e4f0fcaf8c "Add DRI3+Present loader"
Cc: Keith Packard <keithp at keithp.com>
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
Keith, did you mean to do something with these, or are they just
remnants of earlier revisions?
---
 src/glx/dri3_glx.c  | 36 ------------------------------------
 src/glx/dri3_priv.h |  9 ---------
 2 files changed, 45 deletions(-)

diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index b79fec7335..cbf9e015cb 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -1000,11 +1000,6 @@ dri3_create_display(Display * dpy)
 {
    struct dri3_display                  *pdp;
    xcb_connection_t                     *c = XGetXCBConnection(dpy);
-   xcb_dri3_query_version_cookie_t      dri3_cookie;
-   xcb_dri3_query_version_reply_t       *dri3_reply;
-   xcb_present_query_version_cookie_t   present_cookie;
-   xcb_present_query_version_reply_t    *present_reply;
-   xcb_generic_error_t                  *error;
    const xcb_query_extension_reply_t    *extension;
 
    xcb_prefetch_extension_data(c, &xcb_dri3_id);
@@ -1018,38 +1013,10 @@ dri3_create_display(Display * dpy)
    if (!(extension && extension->present))
       return NULL;
 
-   dri3_cookie = xcb_dri3_query_version(c,
-                                        XCB_DRI3_MAJOR_VERSION,
-                                        XCB_DRI3_MINOR_VERSION);
-
-
-   present_cookie = xcb_present_query_version(c,
-                                   XCB_PRESENT_MAJOR_VERSION,
-                                   XCB_PRESENT_MINOR_VERSION);
-
    pdp = malloc(sizeof *pdp);
    if (pdp == NULL)
       return NULL;
 
-   dri3_reply = xcb_dri3_query_version_reply(c, dri3_cookie, &error);
-   if (!dri3_reply) {
-      free(error);
-      goto no_extension;
-   }
-
-   pdp->dri3Major = dri3_reply->major_version;
-   pdp->dri3Minor = dri3_reply->minor_version;
-   free(dri3_reply);
-
-   present_reply = xcb_present_query_version_reply(c, present_cookie, &error);
-   if (!present_reply) {
-      free(error);
-      goto no_extension;
-   }
-   pdp->presentMajor = present_reply->major_version;
-   pdp->presentMinor = present_reply->minor_version;
-   free(present_reply);
-
    pdp->base.destroyDisplay = dri3_destroy_display;
    pdp->base.createScreen = dri3_create_screen;
 
@@ -1058,9 +1025,6 @@ dri3_create_display(Display * dpy)
    pdp->loader_extensions = loader_extensions;
 
    return &pdp->base;
-no_extension:
-   free(pdp);
-   return NULL;
 }
 
 #endif /* GLX_DIRECT_RENDERING */
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index 1d3c03f999..605c5aae43 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -72,15 +72,6 @@ struct dri3_display
    __GLXDRIdisplay base;
 
    const __DRIextension **loader_extensions;
-
-   /* DRI3 bits */
-   int dri3Major;
-   int dri3Minor;
-
-   /* Present bits */
-   int hasPresent;
-   int presentMajor;
-   int presentMinor;
 };
 
 struct dri3_screen {
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list