[Glamor] Configuration for DRI3 support preview

Gaetan Nadon memsize at videotron.ca
Thu Dec 12 14:41:06 PST 2013


On 13-12-11 04:22 PM, davyaxel at free.fr wrote:
> 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.
Correct. I discovered that GBM is coined as one of the "platforms" Mesa
supports.
>
> 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.
It would be surprising, but not impossible.
>
> That's why I think the void* test is justified.
Ok, no harm done.
>> 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
Yes, more work there. Any "yes if" really means "auto". The final result
must be computed so the feature will not allows be enabled.
>>     # 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?
Yes, every test should be subject to the previous test result.
>>
>>     # 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
Yes, code not optimized in this draft.
>>
>>     # 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);
>>             c native_pixmap;
>>             native_pixmap = bo;])], [], [GLAMOR_DRI3_HELPERS=no]
>>     )
> You forgot to add "bo = native_pixmap;"
Yes I missed that.
> 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.
Not sure what you want. I'll try to add something like:

    AC_DEFINE(EGL_NATIVE_PIXMAP_TYPE_AS_GBM_BO, 1, [Define to 1 if
    EGLNativePixmapType is struct gbm_bo*])

The clause [GLAMOR_DRI3_HELPERS=no] would remain.
>
>
>>     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 
> _______________________________________________
> Glamor mailing list
> Glamor at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/glamor
>

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


More information about the Glamor mailing list