mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
egl: add HAVE_LIBDRM define, fix EGL X11 platform
Commit a594cec broke EGL X11 backend by adding dependency between
X11 and DRM backends requiring HAVE_EGL_PLATFORM_DRM defined for X11.
This patch fixes the issue by adding additional define for libdrm
detection independent of which backend is being compiled. Tested by
compiling Mesa with '--with-egl-platforms=x11' and running es2gears_x11
+ glbenchmark2.7 successfully.
v2: return true for dri2_auth if running without libdrm (Samuel)
v3: check libdrm when building EGL drm platform + AM_CFLAGS fix (Emil)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72062
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
parent
ad3937fd4e
commit
a057b837dd
2 changed files with 8 additions and 6 deletions
|
|
@ -761,6 +761,9 @@ AC_SUBST([MESA_LLVM])
|
||||||
# Check for libdrm
|
# Check for libdrm
|
||||||
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
|
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
|
||||||
[have_libdrm=yes], [have_libdrm=no])
|
[have_libdrm=yes], [have_libdrm=no])
|
||||||
|
if test "x$have_libdrm" = xyes; then
|
||||||
|
DEFINES="$DEFINES -DHAVE_LIBDRM"
|
||||||
|
fi
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
|
PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
|
||||||
have_libudev=yes, have_libudev=no)
|
have_libudev=yes, have_libudev=no)
|
||||||
|
|
@ -1439,6 +1442,8 @@ for plat in $egl_platforms; do
|
||||||
drm)
|
drm)
|
||||||
test "x$enable_gbm" = "xno" &&
|
test "x$enable_gbm" = "xno" &&
|
||||||
AC_MSG_ERROR([EGL platform drm needs gbm])
|
AC_MSG_ERROR([EGL platform drm needs gbm])
|
||||||
|
test "x$have_libdrm" != xyes &&
|
||||||
|
AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
|
||||||
;;
|
;;
|
||||||
|
|
||||||
android|fbdev|gdi|null)
|
android|fbdev|gdi|null)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_DRM_PLATFORM
|
#ifdef HAVE_LIBDRM
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
@ -608,7 +608,7 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||||
static EGLBoolean
|
static EGLBoolean
|
||||||
dri2_authenticate(_EGLDisplay *disp)
|
dri2_authenticate(_EGLDisplay *disp)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DRM_PLATFORM
|
#ifdef HAVE_LIBDRM
|
||||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||||
drm_magic_t magic;
|
drm_magic_t magic;
|
||||||
|
|
||||||
|
|
@ -621,11 +621,8 @@ dri2_authenticate(_EGLDisplay *disp)
|
||||||
_eglLog(_EGL_WARNING, "DRI2: failed to authenticate");
|
_eglLog(_EGL_WARNING, "DRI2: failed to authenticate");
|
||||||
return EGL_FALSE;
|
return EGL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EGL_TRUE;
|
|
||||||
#else
|
|
||||||
return EGL_FALSE;
|
|
||||||
#endif
|
#endif
|
||||||
|
return EGL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EGLBoolean
|
static EGLBoolean
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue