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

Eric Engestrom eric.engestrom at intel.com
Fri May 25 16:42:38 UTC 2018


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);
+
 static void
 swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
                      struct dri2_egl_surface * dri2_surf)
--->8---

> 
> > 
> >   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


More information about the mesa-dev mailing list