[Glamor] [PATCH v3] Add DRI3 support to glamor

Gaetan Nadon memsize at videotron.ca
Mon Dec 9 07:53:19 PST 2013


On 13-12-09 04:28 AM, davyaxel at free.fr wrote:
> If EGLNativePixmapType is a pointer on another structure than gbm_bo, it raises an error, and the helpers are disabled.
> However if EGLNativePixmapType is (void *) the compilation works. Perhaps you know how we could have the compilation failing in this case too?

The concept I tried is to access a data member of the gbm_bo struct that
we are sure will not be a member of the struct in Android, Wayland or
what not. . It was not easy as it is an anonymous struct in which case
AC_CHECK_MEMBERS does not work. I modified your program to check for
"gbm" which we know will never in other structures.

    SAVE_CFLAGS=$CFLAGS
    CFLAGS="$EGL_CFLAGS -Werror"
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    #include <inttypes.h>
    #include <unistd.h>
    #include <gbm.h>
    struct gbm_bo {
       struct gbm_device *gbm;
       uint32_t width;
       uint32_t height;
       uint32_t stride;
       uint32_t format;
       union gbm_bo_handle  handle;
       void *user_data;
       void (*destroy_user_data)(struct gbm_bo *, void *);
    };
    #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 = bo;
        native_pixmap->gbm;
    ]])], [], [GLAMOR_DRI3_HELPERS=no])
    CFLAGS=$SAVE_CFLAGS

We cannot include gbmint.h which holds the definition of the structure,
so I copied it into the program. I did not test on a setup that does not
have gbm. I am not totally sure it works, I'll you dig into that. At
least your program works on all but Symbian systems, so it is not that
bad. There may be an indirect way of adding a check for that system.


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


More information about the Glamor mailing list