[Glamor] Configuration for DRI3 support preview

Gaetan Nadon memsize at videotron.ca
Tue Dec 10 16:03:33 PST 2013


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?

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

    # 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

    # 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

    # Check for this 32bpp format in drm_fourcc.h
    SAVE_CFLAGS=$CFLAGS
    CFLAGS="$LIBDRM_CFLAGS"
    AC_CHECK_DECLS([DRM_FORMAT_ARGB8888], [],
    [GLAMOR_DRI3_HELPERS=no],[
         AC_INCLUDES_DEFAULT
         #include <drm_fourcc.h>
    ])
    CFLAGS=$SAVE_CFLAGS

    # Check that EGLNativePixmapType is a struct gbm_bo
    XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Werror])
    XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Wc++-compat])
    SAVE_CFLAGS=$CFLAGS
    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]
    )
    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])
    # ---------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/glamor/attachments/20131210/6f64c970/attachment.html>


More information about the Glamor mailing list