[Mesa-dev] [PATCH] egl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRM

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 22 08:52:06 PST 2015


On 14/01/15 19:36, Axel Davy wrote:
> To fix build when libdrm is not found,
> commit a594cec7e3ef275c386054127a357110a19dd823 did put several
> parts of egl code under #ifdef HAVE_DRM_PLATFORM.
> 
> HAVE_DRM_PLATFORM means the egl drm platform is being built.
> What should have been used instead is HAVE_LIBDRM.
> 
> At a few locations, the HAVE_DRM_PLATFORM introduced
> have already been replaced by HAVE_LIBDRM, this patch
> replaces the remaining occurences.
> 
> This patch makes for example EGL_EXT_image_dma_buf_import
> be advertised by egl under x11 when the drm egl platform
> is not built, whereas previously it required the drm egl
> platform to be built.
> 
It makes sense imho. CC-ing the author and committer of the "offending"
commit.

Samuel, Maarten
What's your take on the topic ?

Thanks
Emil

> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 86e5f24..6306483 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -534,7 +534,7 @@ dri2_setup_screen(_EGLDisplay *disp)
>           disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
>           disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
>        }
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>        if (dri2_dpy->image->base.version >= 8 &&
>            dri2_dpy->image->createImageFromDmaBufs) {
>           disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
> @@ -1335,7 +1335,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
>     return dri2_create_image_from_dri(disp, dri_image);
>  }
>  
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>  static _EGLImage *
>  dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
>  				  EGLClientBuffer buffer, const EGLint *attr_list)
> @@ -1571,7 +1571,7 @@ dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *dpy,
>     return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, dpy, img);
>  }
>  
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>  static EGLBoolean
>  dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
>  {
> @@ -1821,7 +1821,7 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
>        return dri2_create_image_khr_texture(disp, ctx, target, buffer, attr_list);
>     case EGL_GL_RENDERBUFFER_KHR:
>        return dri2_create_image_khr_renderbuffer(disp, ctx, buffer, attr_list);
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>     case EGL_DRM_BUFFER_MESA:
>        return dri2_create_image_mesa_drm_buffer(disp, ctx, buffer, attr_list);
>  #endif
> @@ -1829,7 +1829,7 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
>     case EGL_WAYLAND_BUFFER_WL:
>        return dri2_create_image_wayland_wl_buffer(disp, ctx, buffer, attr_list);
>  #endif
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>     case EGL_LINUX_DMA_BUF_EXT:
>        return dri2_create_image_dma_buf(disp, ctx, buffer, attr_list);
>  #endif
> @@ -1853,7 +1853,7 @@ dri2_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image)
>     return EGL_TRUE;
>  }
>  
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>  static _EGLImage *
>  dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
>  			   const EGLint *attr_list)
> @@ -2215,7 +2215,7 @@ _eglBuiltInDriverDRI2(const char *args)
>     dri2_drv->base.API.CreateImageKHR = dri2_create_image;
>     dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
>     dri2_drv->base.API.CreateWaylandBufferFromImageWL = dri2_create_wayland_buffer_from_image;
> -#ifdef HAVE_DRM_PLATFORM
> +#ifdef HAVE_LIBDRM
>     dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
>     dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
>  #endif
> 



More information about the mesa-dev mailing list