DRI2: Allow building without libdrm
Some drivers use DRI protocol but implement their own kernel rendering manager. For these drivers, libdrm becomes useless. --disable-libdrm configure parameter can be used to disable libdrm support in dri2. To provide ABI/API compatibility for libdrm based drivers, libdrm call is wrapped in ifdef. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
cdcb575664
commit
6eef70dc56
|
@ -644,6 +644,7 @@ AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with
|
|||
AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
|
||||
AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
|
||||
AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
|
||||
AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
|
||||
|
||||
dnl DDXes.
|
||||
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
|
||||
|
@ -1033,9 +1034,10 @@ esac
|
|||
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
|
||||
|
||||
if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
|
||||
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
|
||||
AC_SUBST(LIBDRM_CFLAGS)
|
||||
AC_SUBST(LIBDRM_LIBS)
|
||||
if test "x$DRM" = xyes; then
|
||||
AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
|
||||
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$DRI2" = xyes; then
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#ifdef WITH_LIBDRM
|
||||
#include <xf86drm.h>
|
||||
#endif
|
||||
#include "xf86Module.h"
|
||||
#include "list.h"
|
||||
#include "scrnintstr.h"
|
||||
|
@ -965,7 +967,7 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
|
|||
}
|
||||
|
||||
Bool
|
||||
DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
|
||||
DRI2Authenticate(ScreenPtr pScreen, uint32_t magic)
|
||||
{
|
||||
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
|
||||
|
||||
|
@ -1045,9 +1047,16 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
|||
ds->AuthMagic = info->AuthMagic;
|
||||
}
|
||||
|
||||
/*
|
||||
* if the driver doesn't provide an AuthMagic function or the info struct
|
||||
* version is too low, it relies on the old method (using libdrm) or fail
|
||||
*/
|
||||
if (!ds->AuthMagic)
|
||||
#ifdef WITH_LIBDRM
|
||||
ds->AuthMagic = drmAuthMagic;
|
||||
|
||||
#else
|
||||
goto err_out;
|
||||
#endif
|
||||
|
||||
/* Initialize minor if needed and set to minimum provied by DDX */
|
||||
if (!dri2_minor || dri2_minor > cur_minor)
|
||||
|
@ -1087,6 +1096,12 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
err_out:
|
||||
xf86DrvMsg(pScreen->myNum, X_WARNING,
|
||||
"[DRI2] Initialization failed for info version %d.\n", info->version);
|
||||
free(ds);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -206,7 +206,7 @@ extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
|
|||
const char **driverName,
|
||||
const char **deviceName);
|
||||
|
||||
extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic);
|
||||
extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic);
|
||||
|
||||
extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
|
||||
DrawablePtr pDraw,
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "scrnintstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "extnsionst.h"
|
||||
#include "xf86drm.h"
|
||||
#include "xfixes.h"
|
||||
#include "dri2.h"
|
||||
#include "protocol-versions.h"
|
||||
|
|
|
@ -139,4 +139,7 @@
|
|||
/* Support PC98 */
|
||||
#undef SUPPORT_PC98
|
||||
|
||||
/* Build with libdrm support */
|
||||
#undef WITH_LIBDRM
|
||||
|
||||
#endif /* _XORG_CONFIG_H_ */
|
||||
|
|
Loading…
Reference in New Issue