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

Eric Engestrom eric.engestrom at imgtec.com
Tue Sep 12 15:08:33 UTC 2017


On Wednesday, 2017-09-06 17:25:29 +0100, Emil Velikov wrote:
> On 6 September 2017 at 17:17, Adam Jackson <ajax at redhat.com> wrote:
> > On Fri, 2017-09-01 at 15:04 +0100, Eric Engestrom wrote:
> >> These fields were added in 2d94601582 but never used; hasPresent was
> >> never set, while the other ones were set but never read.
> >
> > I think this patch is wrong:
> >
> >> -   dri3_reply = xcb_dri3_query_version_reply(c, dri3_cookie, &error);
> >> -   if (!dri3_reply) {
> >> -      free(error);
> >> -      goto no_extension;
> >> -   }
> >
> > You're not just removing the dead stores into the display state, you're
> > also removing the checks for whether the extensions exist at all. The
> > DRI3 loader is definitely not going to work if DRI3 and Present aren't,
> > er, present.
> >
> I'm not that much of an expert on things XCB, so perhaps a silly question.
> Isn't the presence checked with the code just above the removed hunk? Namely:
> 
> extension = xcb_get_extension_data(c, &xcb_dri3_id);
> if (!(extension && extension->present))
>   return NULL;
> 
> extension = xcb_get_extension_data(c, &xcb_present_id);
> if (!(extension && extension->present))
>   return NULL;

I agree with Emil, but if I'm wrong I'm happy to keep the version
queries and simply store them in a local variable and drop the struct
fields.

Keith, can you chime in? In case you might remember something from when
you wrote this :)


More information about the mesa-dev mailing list