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

Gaetan Nadon memsize at videotron.ca
Sun Dec 8 12:15:07 PST 2013


On 13-12-08 10:38 AM, davyaxel at free.fr wrote:
> The Dri3 helpers rely on some EGL extension, and it would be great
> to disable automatically the compilation of the DRI3 code if the
> EGL extensions are not defined.
>
> For example EGL_EXT_image_dma_buf_import is recent, and the
> definition of the symbols around the extension might be missing in the
> OpenGL library.
Looks like AC_CHECK_DECLS might be the macro to use. Checking for one of
symbols from the extension might be good enough. For example,
EGL_LINUX_DMA_BUF_EXT.
>
> Another issue is that we need EGLNativePixmapType to be (struct gbm_bo*).

    typedef struct gbm_bo      *EGLNativePixmapType;

AC_CHECK_MEMBERS can be used to check for the declaration of members
that would only be defined in the gbm version of EGLNativePixmapType.
> I didn't know how to deal with the issue, that's why I've put the comment
> lines 242-245 in glamor_egl.c.
>
> Do you know how to solve these issues?
This is what we have to solve this configuration challenge in Autoconf:

AC_CHECK_DECLS (symbols, [action-if-found], [action-if-not-found],
[includes = 'AC_INCLUDES_DEFAULT'])

    For each of the symbols (comma-separated list with optional function
    argument types for C++ overloads), define HAVE_DECL_symbol (in all
    capitals) to '1' if symbol is declared, otherwise to '0'. If
    action-if-not-found is given, it is additional shell code to execute
    when one of the function declarations is needed, otherwise
    action-if-found is executed.

AC_CHECK_FUNCS (function..., [action-if-found], [action-if-not-found])

    For each function enumerated in the blank-or-newline-separated
    argument list, define HAVE_function (in all capitals) if it is
    available. If action-if-found is given, it is additional shell code
    to execute when one of the functions is found. You can give it a
    value of 'break' to break out of the loop on the first match. If
    action-if-not-found is given, it is executed when one of the
    functions is not found.

AC_CHECK_HEADERS (header-file..., [action-if-found],
[action-if-not-found], [includes])

    For each given system header file header-file in the blank-separated
    argument list that exists, define HAVE_header-file (in all
    capitals). If action-if-found is given, it is additional shell code
    to execute when one of the header files is found. You can give it a
    value of 'break' to break out of the loop on the first match. If
    action-if-not-found is given, it is executed when one of the header
    files is not found.

AC_CHECK_MEMBERS (members, [action-if-found], [action-if-not-found],
[includes = 'AC_INCLUDES_DEFAULT'])

    Check for the existence of each 'aggregate.member' of members using
    the previous macro. When member belongs to aggregate, define
    HAVE_aggregate_member (in all capitals, with spaces and dots
    replaced by underscores). If action-if-found is given, it is
    executed for each of the found members. If action-if-not-found is
    given, it is executed for each of the members that could not be found.

AC_CHECK_TYPES (types, [action-if-found], [action-if-not-found],
[includes = 'AC_INCLUDES_DEFAULT'])

    For each type of the types that is defined, define HAVE_type (in all
    capitals). Each type must follow the rules of AC_CHECK_TYPE. If no
    includes are specified, the default includes are used (see Default
    Includes). If action-if-found is given, it is additional shell code
    to execute when one of the types is found. If action-if-not-found is
    given, it is executed when one of the types is not found.

And if none of the above does the job, one can write any short  program
to be compiled:

AC_COMPILE_IFELSE (input, [action-if-true], [action-if-false])

    Run the compiler and compilation flags of the current language (see
    Language Choice) on the input, run the shell commands action-if-true
    on success, action-if-false otherwise. The input can be made by
    AC_LANG_PROGRAM and friends.



The AC_CHECK_[...] macros will add #define HAVE_[...]  in config.h,
similar to:

    #define HAVE_SYS_TYPES_H 1

Can you provide a list of "things" to check? I can write it up, test to
see if it works the way I expect and you can then use the #define it the
code. If you need something other than the new #define in config.h, let
me know what that might be. It could be, for example, to abort the
configuration, or print a warning like "you asked for [...], but it is
not possible because [...] is not available.

In the mean time, I'll get back to the libgbm v9 issue. I suppose one
part of the code can make do with <9 and another part needs >=9. Seems
ok. I need to spend some more time understanding this module. I was
surprised glamor_egl.c was not being compiled by the makefile given I
have all the prereqs.






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


More information about the Glamor mailing list