[Mesa-dev] [PATCH] egl/x11: Move dri2_format_for_depth prototype.

Marathe, Yogesh yogesh.marathe at intel.com
Tue May 29 04:21:02 UTC 2018


Hi Vinson, Eric,

> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On Behalf
> Of Vinson Lee
> Sent: Sunday, May 27, 2018 1:34 PM
> To: Engestrom, Eric <eric.engestrom at intel.com>
> Cc: Daniel Stone <daniels at collabora.com>; Emil Velikov
> <emil.l.velikov at gmail.com>; Eric Engestrom <eric at engestrom.ch>; Marathe,
> Yogesh <yogesh.marathe at intel.com>; ML mesa-dev <mesa-
> dev at lists.freedesktop.org>
> Subject: Re: [Mesa-dev] [PATCH] egl/x11: Move dri2_format_for_depth
> prototype.
> 
> On Fri, May 25, 2018 at 9:42 AM, Eric Engestrom <eric.engestrom at intel.com>
> wrote:
> > On Friday, 2018-05-25 16:06:26 +0100, Eric Engestrom wrote:
> >> On Friday, 2018-05-25 06:52:25 +0000, Vinson Lee wrote:
> >> > Fix build error without DRI3.
> >>
> >> D'uh!
> >> I forgot building dri3 was optional, sorry :/
> >>
> >> Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
> >
> > Actually, wait no, this doesn't look right, the function should be
> > named something else if it's exposed to everyone, since it's quite
> > specific to x11's case, or it should not be exposed to everyone.
> >
> > I feel like the best thing to do here is to just copy the prototype to
> > platform_x11.c:
> >
> > ---8<---
> > diff --git a/src/egl/drivers/dri2/platform_x11.c
> > b/src/egl/drivers/dri2/platform_x11.c
> > index b2a3000b252ec0ddb12f..ea9b0cc6d6fd04804d2a 100644
> > --- a/src/egl/drivers/dri2/platform_x11.c
> > +++ b/src/egl/drivers/dri2/platform_x11.c
> > @@ -55,6 +55,9 @@ static EGLBoolean
> >  dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface
> *surf,
> >                         EGLint interval);
> >
> > +uint32_t
> > +dri2_format_for_depth(uint32_t depth); u
> >  static void
> >  swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
> >                       struct dri2_egl_surface * dri2_surf)
> > --->8---
> >
> 
> This also fixes the build error.
> 
> Tested-by: Vinson Lee <vlee at freedesktop.org>
> 

Did we also check dri3 build after this?  I see platform_x11_dri3.c using it 
and we've removed it from  platform_x11_dri3.h, dri2_format_for_depth()  
prototype with extern in platform_x11_dri3.c shall help?

If not extern I'm inclining towards better name for the function in egl_dri2.h

> >>
> >> >
> >> >   CC       drivers/dri2/platform_x11.lo
> >> > drivers/dri2/platform_x11.c:1010:1: error: no previous prototype
> >> > for function 'dri2_format_for_depth' [-Werror,-Wmissing-prototypes]
> >> > dri2_format_for_depth(uint32_t depth) ^
> >> >
> >> > Fixes: 473af0b541b2 ("egl/x11: deduplicate depth-to-format logic")
> >> > Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> >> > ---
> >> >  src/egl/drivers/dri2/egl_dri2.h          | 3 +++
> >> >  src/egl/drivers/dri2/platform_x11_dri3.h | 3 ---
> >> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/src/egl/drivers/dri2/egl_dri2.h
> >> > b/src/egl/drivers/dri2/egl_dri2.h index adabc527f85b..b91a899e476c
> >> > 100644
> >> > --- a/src/egl/drivers/dri2/egl_dri2.h
> >> > +++ b/src/egl/drivers/dri2/egl_dri2.h
> >> > @@ -523,4 +523,7 @@ dri2_init_surface(_EGLSurface *surf,
> >> > _EGLDisplay *dpy, EGLint type,  void  dri2_fini_surface(_EGLSurface
> >> > *surf);
> >> >
> >> > +uint32_t
> >> > +dri2_format_for_depth(uint32_t depth);
> >> > +
> >> >  #endif /* EGL_DRI2_INCLUDED */
> >> > diff --git a/src/egl/drivers/dri2/platform_x11_dri3.h
> >> > b/src/egl/drivers/dri2/platform_x11_dri3.h
> >> > index e6fd01366978..96e7ee972d9f 100644
> >> > --- a/src/egl/drivers/dri2/platform_x11_dri3.h
> >> > +++ b/src/egl/drivers/dri2/platform_x11_dri3.h
> >> > @@ -38,7 +38,4 @@ extern struct dri2_egl_display_vtbl
> >> > dri3_x11_display_vtbl;  EGLBoolean  dri3_x11_connect(struct
> >> > dri2_egl_display *dri2_dpy);
> >> >
> >> > -uint32_t
> >> > -dri2_format_for_depth(uint32_t depth);
> >> > -
> >> >  #endif
> >> > --
> >> > 2.17.0
> >> >
> >> > _______________________________________________
> >> > mesa-dev mailing list
> >> > mesa-dev at lists.freedesktop.org
> >> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list