<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13-12-11 04:22 PM, <a class="moz-txt-link-abbreviated" href="mailto:davyaxel@free.fr">davyaxel@free.fr</a>
wrote:<br>
</div>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">On 11/12/2013, Gaetan Nadon wrote :
</pre>
<blockquote type="cite">
<pre wrap="">
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?
</pre>
</blockquote>
<pre wrap="">
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.</pre>
</blockquote>
Correct. I discovered that GBM is coined as one of the "platforms"
Mesa supports.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
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.</pre>
</blockquote>
It would be surprising, but not impossible. <br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
That's why I think the void* test is justified.</pre>
</blockquote>
Ok, no harm done. <br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">
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])
</pre>
</blockquote>
<pre wrap="">"default: yes if libgbm >= 9 is detected" should be changed</pre>
</blockquote>
Yes, more work there. Any "yes if" really means "auto". The final
result must be computed so the feature will not allows be enabled.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">
# 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
</pre>
</blockquote>
<pre wrap="">Is it possible to bypass the other checks if one fail?</pre>
</blockquote>
Yes, every test should be subject to the previous test result.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">
# 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
</pre>
</blockquote>
<pre wrap="">It's useless to restore CFLAGS here</pre>
</blockquote>
Yes, code not optimized in this draft.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">
# Check for this 32bpp format in drm_fourcc.h
SAVE_CFLAGS=$CFLAGS
</pre>
</blockquote>
<pre wrap="">We have already set SAVE_CFLAGS
</pre>
<blockquote type="cite">
<pre wrap="">
CFLAGS="$LIBDRM_CFLAGS"
AC_CHECK_DECLS([DRM_FORMAT_ARGB8888], [],
[GLAMOR_DRI3_HELPERS=no],[
AC_INCLUDES_DEFAULT
#include <drm_fourcc.h>
])
CFLAGS=$SAVE_CFLAGS
</pre>
</blockquote>
<pre wrap="">Same Comment
</pre>
<blockquote type="cite">
<pre wrap="">
# Check that EGLNativePixmapType is a struct gbm_bo
XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Werror])
XORG_TESTSET_CFLAG([COMPAT_CFLAGS], [-Wc++-compat])
SAVE_CFLAGS=$CFLAGS
</pre>
</blockquote>
<pre wrap="">Same comment
</pre>
<blockquote type="cite">
<pre wrap="">
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]
)
</pre>
</blockquote>
<pre wrap="">You forgot to add "bo = native_pixmap;"</pre>
</blockquote>
Yes I missed that.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
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.</pre>
</blockquote>
Not sure what you want. I'll try to add something like:<br>
<blockquote><tt>AC_DEFINE(EGL_NATIVE_PIXMAP_TYPE_AS_GBM_BO, 1, [Define
to 1 if EGLNativePixmapType is struct gbm_bo*])<br>
</tt></blockquote>
The clause [GLAMOR_DRI3_HELPERS=no] would remain.<br>
<blockquote
cite="mid:128079787.619741997.1386796954630.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap=""> 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])
# ---------------------------------------------------------------------
</pre>
</blockquote>
<pre wrap="">
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
<a class="moz-txt-link-abbreviated" href="mailto:Glamor@lists.freedesktop.org">Glamor@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/glamor">http://lists.freedesktop.org/mailman/listinfo/glamor</a>
</pre>
</blockquote>
<br>
</body>
</html>