[Glamor] Configuration for DRI3 support preview

davyaxel at free.fr davyaxel at free.fr
Wed Dec 11 13:22:34 PST 2013


On 11/12/2013, Gaetan Nadon wrote :
>
> Axel,
>
> Here is a preview I have been drafted for the configuration tests.
>
> I am still concerned about the test for EGLNativePixmapType. If libgbm >= 9 is not found, then there is no dri3 support. If libgbm is found, then in glamor_egl.c, gbm.h is included and therefore EGLNativePixmapType will be of type struct gbm_bo, right?

If gbm.h is included, we expect __GBM__ to be defined.
For Mesa today, it'll result in EGLNativePixmapType beeing struct* gbm_bo, except if __WINSCW__, __SYMBIAN32__ or WL_EGL_PLATFORM (but this symbol shouldn't be defined) are defined.

libgbm can be present but link to other drivers that Mesa, and then in this situation we don't know in what EGLNativePixmapType will result.

That's why I think the void* test is justified.
>
> Under what circumstances do you see EGLNativePixmapType being of type void* when libgbm is present? According to eglplatform.h, Symbian and __GBM__ seem mutually exclusive.
>
> Better comments are welcome.
>
>     # ---------------------------------------------------------------------
>     #     Configure Glamor DRI3 Support
>     # ---------------------------------------------------------------------
>
>     # Define a configure option for DRI3 support
>     AC_ARG_ENABLE(glamor-dri3,
>         AS_HELP_STRING([--enable-glamor-dri3],
>                        [Build glamor DRI3 helpers (default: yes if libgbm >= 9 is detected)]),
>                        [GLAMOR_DRI3_HELPERS="$enableval"],
>                        [GLAMOR_DRI3_HELPERS=yes])
"default: yes if libgbm >= 9 is detected" should be changed
>
>     # Check if DRI3 support is possible, if requested by user
>     if test "x$GLAMOR_DRI3_HELPERS" = xyes -a "x$GBMv9" = xno; then
>        GLAMOR_DRI3_HELPERS=no
>     fi
Is it possible to bypass the other checks if one fail?
>
>
>     # Check for the presence of some EGL extensions
>     SAVE_CFLAGS=$CFLAGS
>     CFLAGS="$EGL_CFLAGS"
>     AC_CHECK_DECLS([EGL_KHR_image, EGL_KHR_gl_texture_2D_image, EGL_EXT_image_dma_buf_import], [],
>     [GLAMOR_DRI3_HELPERS=no],[
>          AC_INCLUDES_DEFAULT
>          #include <EGL/egl.h>
>          #include <EGL/eglext.h>
>     ])
>     CFLAGS=$SAVE_CFLAGS
It's useless to restore CFLAGS here
>
>
>     # Check for this 32bpp format in drm_fourcc.h
>     SAVE_CFLAGS=$CFLAGS
We have already set SAVE_CFLAGS
>
>     CFLAGS="$LIBDRM_CFLAGS"
>     AC_CHECK_DECLS([DRM_FORMAT_ARGB8888], [],
>     [GLAMOR_DRI3_HELPERS=no],[
>          AC_INCLUDES_DEFAULT
>          #include <drm_fourcc.h>
>     ])
>     CFLAGS=$SAVE_CFLAGS
Same Comment
>
>     # Check that EGLNativePixmapType is a struct gbm_bo
>     XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Werror])
>     XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Wc++-compat])
>     SAVE_CFLAGS=$CFLAGS
Same comment
>
>     CFLAGS="$EGL_CFLAGS $COMPAT_CFLAGS"
>     AC_COMPILE_IFELSE([
>         AC_LANG_PROGRAM([
>             #include <unistd.h>
>             #include <gbm.h>
>             #include <EGL/egl.h>
>             #include <EGL/eglext.h>],[
>             struct gbm_bo *bo = gbm_bo_create (gbm_create_device(1), 0, 0, GBM_FORMAT_ARGB8888,
>                                 GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
>             EGLNativePixmapType native_pixmap;
>             native_pixmap = bo;])], [], [GLAMOR_DRI3_HELPERS=no]
>     )
You forgot to add "bo = native_pixmap;"
I think the result of this test should be put also in another define,
so we can protect glamor_egl_create_textured_pixmap_from_gbm_bo with the define,
since it uses EGL_KHR_image with a gbm_bo too.


>     CFLAGS=$SAVE_CFLAGS
>
>     if test "x$GLAMOR_DRI3_HELPERS" = xyes; then
>         AC_DEFINE(GLAMOR_HAS_DRI3_SUPPORT, 1, [Enable Dri3 helpers])
>     fi
>
>     AC_MSG_CHECKING([Enable Glamor DRI3 helpers])
>     AC_MSG_RESULT([$GLAMOR_DRI3_HELPERS])
>     # ---------------------------------------------------------------------
>

Thanks for writing the patch.

I'm quite busy this week, but I'll do my best to give you new comments if you need some.

Axel Davy 


More information about the Glamor mailing list