[openchrome-devel] xf86-video-openchrome: Branch 'main' - 20 commits - configure.ac src/drmmode_display.h src/Makefile.am src/via_dri.c src/via_driver.c src/via_driver.h src/via_eng_regs.h src/via_exa.c src/via_memmgr.c src/via_priv.h src/via_ums.c src/via_xv.c src/via_xvmc.c src/via_xv_overlay.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Mon Aug 31 21:52:19 UTC 2020
configure.ac | 102 ++++++++++++++++++++++++++++++++++++--------------
src/Makefile.am | 4 -
src/drmmode_display.h | 8 +--
src/via_dri.c | 2
src/via_driver.c | 60 ++++++++++++++---------------
src/via_driver.h | 20 ++++-----
src/via_eng_regs.h | 2
src/via_exa.c | 28 ++++++-------
src/via_memmgr.c | 44 ++++++++++-----------
src/via_priv.h | 2
src/via_ums.c | 64 +++++++++++++++----------------
src/via_xv.c | 14 +++---
src/via_xv_overlay.c | 2
src/via_xvmc.c | 4 -
14 files changed, 201 insertions(+), 155 deletions(-)
New commits:
commit 598b7f03c3d6427ef0e4c66fc421a74111babb6f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 14:45:30 2020 -0700
Version bumped to 0.6.308
Modernized the configure.ac build script.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 76bd5e1..ad1ba88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-openchrome],
- [0.6.307],
+ [0.6.308],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
[xf86-video-openchrome])
commit d2a8c9e22bc9bba7ce5385004e7baceb920a7da4
Author: Pino Toscano <toscano.pino at tiscali.it>
Date: Mon Aug 31 14:44:15 2020 -0700
Do not require libdrm as base pkg-config module
Remove libdrm from the list of mandatory Xorg modules, as it is an
optional component whose presence is checked later. Needed for
Hurd support since libdrm is not present yet.
Signed-off-by: Pino Toscano <toscano.pino at tiscali.it>
Reviewed-by: James Simmons <jsimmons at infradead.org>
diff --git a/configure.ac b/configure.ac
index 96c11d5..76bd5e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm glproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto glproto $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
commit 775a4154fb3ee56bd0dbf6362f8319077a4087c8
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 14:42:22 2020 -0700
Add glproto to XORG module check
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 21f4f86..96c11d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm glproto $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
commit ec3b4d192afb97a407cdbdd4f8bdc08abff83b91
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 14:40:46 2020 -0700
Bring back KMS support in configure.ac
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 2d724fc..21f4f86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,6 +142,21 @@ if test "$DRI" = yes; then
PKG_CHECK_MODULES(DRI, [libdrm xf86driproto])
AC_DEFINE(OPENCHROMEDRI,1,[Enable DRI driver support])
AC_DEFINE(OPENCHROMEDRI_DEVEL,1,[Enable developmental DRI driver support])
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $CFLAGS"
+ AC_CHECK_HEADER(xf86drmMode.h,
+ [DRM_MODE=yes], [DRM_MODE=no],
+ [#include <stdint.h>
+ #include <stdlib.h>])
+ if test "x$DRM_MODE" = xyes; then
+ PKG_CHECK_MODULES(LIBUDEV, [libudev],
+ [LIBUDEV=yes], [LIBUDEV=no])
+ if test "x$LIBUDEV" = xyes; then
+ AC_DEFINE(HAVE_LIBUDEV, 1, [libudev support])
+ fi
+ fi
+ CFLAGS="$save_CFLAGS"
+
case "$host_cpu" in
i*86)
XVMC=yes ;;
diff --git a/src/Makefile.am b/src/Makefile.am
index 1b89ede..a4d3e2b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,7 +29,7 @@ SUBDIRS = xvmc
BUILT_SOURCES = version.h
EXTRA_DIST = version.h
CONFIG_CLEAN_FILES= version.h
-AM_CFLAGS = @XORG_CFLAGS@ $(CWARNFLAGS) @DRI_CFLAGS@
+AM_CFLAGS = @XORG_CFLAGS@ $(CWARNFLAGS) @DRI_CFLAGS@ @LIBUDEV_CFLAGS@
openchrome_drv_la_LTLIBRARIES = openchrome_drv.la
openchrome_drv_la_LDFLAGS = -module -avoid-version
openchrome_drv_ladir = @moduledir@/drivers
commit 4cb2c88c7c22eaeade9f6d635edb34ca94f872b6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Mon Aug 31 14:25:24 2020 -0700
Untangle XF86DRI from the driver-specific DRI define
XF86DRI is defined by xorg-server.h, so --disable-dri in the driver
itself does exactly nothing other than not fill in the CFLAGS and thus stop
the driver from compiling.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/configure.ac b/configure.ac
index 49f31b5..2d724fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,8 +140,8 @@ AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
if test "$DRI" = yes; then
PKG_CHECK_MODULES(DRI, [libdrm xf86driproto])
- AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
- AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
+ AC_DEFINE(OPENCHROMEDRI,1,[Enable DRI driver support])
+ AC_DEFINE(OPENCHROMEDRI_DEVEL,1,[Enable developmental DRI driver support])
case "$host_cpu" in
i*86)
XVMC=yes ;;
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 0f3022c..a71079f 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -27,7 +27,7 @@
#ifndef DRMMODE_DISPLAY_H
#define DRMMODE_DISPLAY_H
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "xf86drmMode.h"
#endif
#ifdef HAVE_LIBUDEV
@@ -37,7 +37,7 @@
typedef struct {
int fd;
uint32_t fb_id;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
drmModeResPtr mode_res;
drmModeFBPtr mode_fb;
drmEventContext event_context;
@@ -54,7 +54,7 @@ typedef struct {
typedef struct {
drmmode_ptr drmmode;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
drmModeCrtcPtr mode_crtc;
#endif
struct buffer_object *cursor_bo;
@@ -62,7 +62,7 @@ typedef struct {
int index;
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
typedef struct {
drmModePropertyPtr mode_prop;
uint64_t value;
diff --git a/src/via_driver.c b/src/via_driver.c
index fe881f2..acc5964 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -49,7 +49,7 @@
#endif
#include "xf86Crtc.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "dri.h"
#else
#include "drm_fourcc.h"
@@ -277,7 +277,7 @@ VIAEnterVT_internal(ScrnInfoPtr pScrn, int flags)
viaRestoreVideo(pScrn);
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
kickVblank(pScrn);
VIADRIRingBufferInit(pScrn);
@@ -310,7 +310,7 @@ VIALeaveVT_internal(ScrnInfoPtr pScrn, int flags)
"Entered %s.\n", __func__));
if (!flags) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *) DRIGetSAREAPrivate(pScrn->pScreen);
@@ -733,7 +733,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
scrn->virtualY = height;
scrn->displayWidth = width;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->KMS) {
ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
scrn->bitsPerPixel, width * cpp,
@@ -792,7 +792,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
}
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->KMS && old_fb_id) {
drmModeRmFB(drmmode->fd, old_fb_id);
}
@@ -834,7 +834,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
EntityInfoPtr pEnt;
VIAPtr pVia;
MessageType from = X_DEFAULT;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
char *busId = NULL;
drmVersionPtr drmVer;
#endif
@@ -1012,7 +1012,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
pVia->directRenderingType = DRI_NONE;
pVia->KMS = FALSE;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
busId = DRICreatePCIBusID(pVia->PciInfo);
/* Look for OpenChrome DRM first. */
@@ -1299,7 +1299,7 @@ VIACreateScreenResources(ScreenPtr pScreen)
rootPixmap = pScreen->GetScreenPixmap(pScreen);
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
drmmode_uevent_init(pScrn, &pVia->drmmode);
#endif
surface = drm_bo_map(pScrn, pVia->drmmode.front_bo);
@@ -1359,13 +1359,13 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
if (pScrn->vtSema)
VIALeaveVT(VT_FUNC_ARGS(0));
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
drmmode_uevent_fini(pScrn, &pVia->drmmode);
#endif
xf86_cursors_fini(pScreen);
if (pVia->drmmode.front_bo) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->KMS && pVia->drmmode.fb_id)
drmModeRmFB(pVia->drmmode.fd, pVia->drmmode.fb_id);
#endif
@@ -1381,7 +1381,7 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
*/
drm_bo_free(pScrn, iga->cursor_bo);
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1)
VIADRICloseScreen(pScreen);
@@ -1478,7 +1478,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
}
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->KMS) {
if (drmSetMaster(pVia->drmmode.fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1500,9 +1500,9 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
}
#endif
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType != DRI_2)
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
{
if (!viaUMSScreenInit(pScrn)) {
return FALSE;
@@ -1511,9 +1511,9 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
if ((!pVia->NoAccel) &&
((pVia->directRenderingType == DRI_NONE)
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
)) {
if (!viaUMSAccelInit(pScrn)) {
return FALSE;
@@ -1613,7 +1613,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
return FALSE;
if (pVia->directRenderingType != DRI_2) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
if (!VIADRIFinishScreenInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
diff --git a/src/via_driver.h b/src/via_driver.h
index 4f8de0c..6b0b95a 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -55,7 +55,7 @@
#include "xf86RandR12.h"
#include "xf86cmap.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#define _XF86DRI_SERVER_
#include "xf86dri.h"
#include "sarea.h"
@@ -141,7 +141,7 @@ enum dri_type {
DRI_2
};
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#define VIA_XVMC_MAX_BUFFERS 2
#define VIA_XVMC_MAX_CONTEXTS 4
@@ -267,7 +267,7 @@ typedef struct _VIA {
char * scratchAddr;
Bool noComposite;
struct buffer_object *scratchBuffer;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
struct buffer_object *texAGPBuffer;
char * dBounce;
#endif
@@ -285,7 +285,7 @@ typedef struct _VIA {
drmmode_rec drmmode;
enum dri_type directRenderingType;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
Bool XvMCEnabled;
DRIInfoPtr pDRIInfo;
int numVisualConfigs;
@@ -450,7 +450,7 @@ extern vidCopyFunc viaVidCopyInit(const char *copyType, ScreenPtr pScreen );
/* In via_xwmc.c */
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
/* Basic init and exit functions */
void ViaInitXVMC(ScreenPtr pScreen);
void ViaCleanupXVMC(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr *XvAdaptors, int XvAdaptorCount);
@@ -460,7 +460,7 @@ int viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt);
unsigned long viaXvMCPutImageSize(ScrnInfoPtr pScrn);
#endif
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
Bool VIADRI1ScreenInit(ScreenPtr pScreen);
void VIADRICloseScreen(ScreenPtr pScreen);
Bool VIADRIFinishScreenInit(ScreenPtr pScreen);
@@ -470,6 +470,6 @@ void viaDRIOffscreenRestore(ScrnInfoPtr pScrn);
void viaDRIOffscreenSave(ScrnInfoPtr pScrn);
Bool VIADRIBufferInit(ScrnInfoPtr pScrn);
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
#endif /* _VIA_DRIVER_H_ */
diff --git a/src/via_exa.c b/src/via_exa.c
index 1699a51..7358a40 100644
--- a/src/via_exa.c
+++ b/src/via_exa.c
@@ -133,7 +133,7 @@ viaFlushPCI(ViaCommandBuffer *cb)
cb->has3dState = FALSE;
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
/*
* Flush the command buffer using DRM. If in PCI mode, we can bypass DRM,
* but not for command buffers that contain 3D engine state, since then
@@ -186,7 +186,7 @@ viaFlushDRIEnabled(ViaCommandBuffer *cb)
static int
viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size)
{
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
VIAPtr pVia = VIAPTR(pScrn);
#endif
@@ -202,7 +202,7 @@ viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size)
cb->rindex = 0;
cb->has3dState = FALSE;
cb->flushFunc = viaFlushPCI;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
cb->flushFunc = viaFlushDRIEnabled;
}
@@ -277,7 +277,7 @@ viaCheckUpload(ScrnInfoPtr pScrn, Via3DState * v3d)
forceUpload = (pVia->lastToUpload != v3d);
pVia->lastToUpload = v3d;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
DRIGetSAREAPrivate(pScrn->pScreen);
@@ -525,7 +525,7 @@ viaAccelWaitMarker(ScreenPtr pScreen, int marker)
}
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
static int
viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
unsigned srcPitch, unsigned char *dst,
@@ -786,7 +786,7 @@ viaExaTexUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
return TRUE;
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
int
viaEXAOffscreenAlloc(ScrnInfoPtr pScrn, struct buffer_object *obj,
@@ -817,7 +817,7 @@ exit:
Bool
viaIsAGP(VIAPtr pVia, PixmapPtr pPix, unsigned long *offset)
{
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
unsigned long offs;
if (pVia->directRenderingType && !pVia->IsPCI) {
@@ -863,7 +863,7 @@ viaInitExa(ScreenPtr pScreen)
* Also some CLE266 hardware may not allow nPOT textures for
* texture engine 1. We need to figure that out.
*/
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
nPOTSupported = ((!pVia->directRenderingType) ||
(pVia->drmVerMajor > 2) ||
((pVia->drmVerMajor == 2) && (pVia->drmVerMinor >= 11)));
@@ -935,7 +935,7 @@ viaInitExa(ScreenPtr pScreen)
break;
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
#ifdef linux
pExa->DownloadFromScreen = viaExaDownloadFromScreen;
@@ -950,7 +950,7 @@ viaInitExa(ScreenPtr pScreen)
break;
}
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
if (!pVia->noComposite) {
switch (pVia->Chipset) {
@@ -998,7 +998,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
VIAPtr pVia = VIAPTR(pScrn);
int size;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType && pVia->useEXA) {
pVia->dBounce = calloc(VIA_DMA_DL_SIZE * 2, 1);
@@ -1031,7 +1031,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
}
}
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
if (!pVia->scratchAddr && pVia->useEXA) {
size = pVia->exaScratchSize * 1024 + 32;
pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_SYSTEM);
@@ -1060,7 +1060,7 @@ viaExitAccel(ScreenPtr pScreen)
viaTearDownCBuffer(&pVia->cb);
if (pVia->useEXA) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (pVia->directRenderingType == DRI_1) {
if (pVia->texAGPBuffer) {
drm_bo_free(pScrn, pVia->texAGPBuffer);
@@ -1074,7 +1074,7 @@ viaExitAccel(ScreenPtr pScreen)
}
if (pVia->dBounce)
free(pVia->dBounce);
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
if (pVia->scratchBuffer) {
drm_bo_free(pScrn, pVia->scratchBuffer);
pVia->scratchBuffer = NULL;
diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 900068a..3435070 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -31,13 +31,13 @@
#include "xf86_OSproc.h"
#include "xf86fbman.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "xf86drm.h"
#endif
#include "drm_fourcc.h"
#include "via_driver.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "via_drm.h"
#include "openchrome_drm.h"
@@ -124,7 +124,7 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
obj->handle));
}
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
} else if (pVia->directRenderingType == DRI_1) {
drm_via_mem_t drm;
@@ -201,22 +201,22 @@ void*
drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
{
VIAPtr pVia = VIAPTR(pScrn);
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
struct drm_openchrome_gem_map args;
int ret;
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
if ((pVia->directRenderingType == DRI_NONE)
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
) {
switch (obj->domain) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
case TTM_PL_FLAG_TT:
obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
break;
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
case TTM_PL_FLAG_VRAM:
obj->ptr = pVia->FBBase + obj->offset;
break;
@@ -224,7 +224,7 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
obj->ptr = NULL;
break;
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
} else if (pVia->directRenderingType == DRI_2) {
memset(&args, 0, sizeof(args));
args.handle = obj->handle;
@@ -243,12 +243,12 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
DEBUG(ErrorF("mmap failed with error %d\n", -errno));
obj->ptr = NULL;
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
exit:
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
return obj->ptr;
}
@@ -256,17 +256,17 @@ void
drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
{
VIAPtr pVia = VIAPTR(pScrn);
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
struct drm_openchrome_gem_unmap args;
int ret;
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
if ((pVia->directRenderingType == DRI_NONE)
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
} else if (pVia->directRenderingType == DRI_2) {
munmap(obj->ptr, obj->size);
@@ -279,12 +279,12 @@ drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
if (ret) {
goto exit;
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
exit:
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
obj->ptr = NULL;
}
@@ -309,7 +309,7 @@ drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj)
exaOffscreenFree(pScrn->pScreen, pArea);
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
} else if (pVia->directRenderingType == DRI_1) {
drm_via_mem_t drm;
diff --git a/src/via_priv.h b/src/via_priv.h
index 921b716..34a4b42 100644
--- a/src/via_priv.h
+++ b/src/via_priv.h
@@ -27,7 +27,7 @@
#ifndef _VIA_PRIV_H_
#define _VIA_PRIV_H_ 1
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "via_drm.h"
#endif
#include "exa.h"
diff --git a/src/via_ums.c b/src/via_ums.c
index 6a45277..e680e12 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -689,10 +689,10 @@ viaUMSAccelInit(ScrnInfoPtr pScrn)
pVia->curMarker = 0;
pVia->lastMarkerRead = 0;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
pVia->dBounce = NULL;
pVia->scratchAddr = NULL;
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
ret = TRUE;
err:
if (!ret) {
@@ -865,7 +865,7 @@ viaUMSScreenInit(ScrnInfoPtr pScrn)
ret = FALSE;
}
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
} else if (pVia->directRenderingType == DRI_1) {
if (!VIADRIKernelInit(pScrn)) {
ret = FALSE;
diff --git a/src/via_xv.c b/src/via_xv.c
index 9b8d8a7..4fee066 100644
--- a/src/via_xv.c
+++ b/src/via_xv.c
@@ -592,7 +592,7 @@ viaExitVideo(ScrnInfoPtr pScrn)
DBG_DD(ErrorF(" via_xv.c : viaExitVideo : \n"));
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
ViaCleanupXVMC(pScrn, viaAdaptPtr, XV_ADAPT_NUM);
#endif
@@ -642,7 +642,7 @@ viaInitVideo(ScreenPtr pScreen)
num_new = 0;
pVia->useDmaBlit = FALSE;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
pVia->useDmaBlit = (pVia->directRenderingType == DRI_1) &&
((pVia->Chipset == VIA_CLE266) ||
(pVia->Chipset == VIA_KM400) ||
@@ -700,7 +700,7 @@ viaInitVideo(ScreenPtr pScreen)
if (num_adaptors) {
xf86XVScreenInit(pScreen, allAdaptors, num_adaptors);
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
ViaInitXVMC(pScreen);
#endif
viaSetColorSpace(pVia, 0, 0, 0, 0, TRUE);
@@ -795,7 +795,7 @@ viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors)
}
usedPorts += j;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
viaXvMCInitXv(pScrn, viaAdaptPtr[i]);
#endif
@@ -1022,7 +1022,7 @@ nv12cp(unsigned char *dst, const unsigned char *src, int dstPitch,
src + srcVOffset, w >> 1, w >>1, dstPitch, h >> 1);
}
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
static int
viaDmaBlitImage(VIAPtr pVia,
@@ -1240,7 +1240,7 @@ viaPutImage(ScrnInfoPtr pScrn,
dstPitch = pVia->swov.SWDevice.dwPitch;
if (pVia->useDmaBlit) {
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
if (viaDmaBlitImage(pVia, pPriv, buf,
(CARD32) pVia->swov.SWDevice.dwSWPhysicalAddr[pVia->dwFrameNum & 1],
width, height, dstPitch, id)) {
@@ -1448,7 +1448,7 @@ viaQueryImageAttributes(ScrnInfoPtr pScrn,
break;
case FOURCC_XVMC:
*h = (*h + 1) & ~1;
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
size = viaXvMCPutImageSize(pScrn);
#else
size = 0;
diff --git a/src/via_xv_overlay.c b/src/via_xv_overlay.c
index 95feee1..b2d9e7b 100644
--- a/src/via_xv_overlay.c
+++ b/src/via_xv_overlay.c
@@ -30,7 +30,7 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "xf86drm.h"
#include "via_drmclient.h"
#include "via_drm.h"
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index c5a5ca5..b2a5cc9 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -36,7 +36,7 @@
#include "xf86Pci.h"
#include "regionstr.h"
-#ifdef XF86DRI
+#ifdef OPENCHROMEDRI
#include "via_drmclient.h"
#include "via_drm.h"
@@ -994,4 +994,4 @@ viaXvMCPutImageSize(ScrnInfoPtr pScrn)
return 0;
}
-#endif /* XF86DRI */
+#endif /* OPENCHROMEDRI */
commit 4a6f7af6a1bf7dd31aa0a4b9a63a7e7aa11ad6ad
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 13:15:11 2020 -0700
Check for DRI related header files differently
It is based on xf86-video-r128 commit 11b230b (Fix for cross build
failure).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index e6a12ff..49f31b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,15 +101,30 @@ if test x$XSERVER_LIBPCIACCESS = xyes; then
fi
if test "$DRI" != no; then
- PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
- AC_CHECK_HEADER([${sdkdir}/dri.h],
- [have_dri_h="yes"], [have_dri_h="no"],[-])
- AC_CHECK_HEADER([${sdkdir}/sarea.h],
- [have_sarea_h="yes"], [have_sarea_h="no"],[-])
- AC_CHECK_HEADER([${sdkdir}/dristruct.h],
- [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
+ PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
+ if test -f "${sdkdir}/dri.h"; then
+ have_dri_h="yes"
+ else
+ have_dri_h="no"
+ fi
+ if test -f "${sdkdir}/sarea.h"; then
+ have_sarea_h="yes"
+ else
+ have_sarea_h="no"
+ fi
+ if test -f "${sdkdir}/dristruct.h"; then
+ have_dristruct_h="yes"
+ else
+ have_dristruct_h="no"
+ fi
+ if test -f "${sdkdir}/damage.h"; then
+ have_damage_h="yes"
+ else
+ have_damage_h="no"
+ fi
fi
+
AC_MSG_CHECKING([whether to include DRI support])
if test x$DRI = xauto; then
if test "$have_dri_h" = yes -a \
commit 1aed7a3a24eae547c6d02697b909b68e28b16004
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 12:19:13 2020 -0700
Whitespace conversion for AC_ARG_ENABLE section of configure.ac
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 3115dc4..e6a12ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,17 +58,17 @@ AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
[DRI=auto])
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
- [Enable debugging support [[default=no]]]),
+ [Enable debugging support [[default=no]]]),
[DEBUG="$enableval"],
[DEBUG=no])
AC_ARG_ENABLE(xv-debug, AS_HELP_STRING([--enable-xv-debug],
- [Enable XVideo debugging support [[default=no]]]),
+ [Enable XVideo debugging support [[default=no]]]),
[XV_DEBUG="$enableval"],
[XV_DEBUG=no])
AC_ARG_ENABLE(viaregtool, AS_HELP_STRING([--enable-viaregtool],
- [Enable build of registers dumper tool [[default=no]]]),
+ [Enable build of registers dumper tool [[default=no]]]),
[TOOLS="$enableval"],
[TOOLS=no])
commit e8dcaeba3a34a63459c6224ca41ebcfe4af91fad
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 11:19:29 2020 -0700
Remove configure.ac remnants that checks for pre-xorg 7.1rc1 Xv ABI
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 82fb35b..3115dc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,10 +149,6 @@ AC_MSG_RESULT([$XVMC])
AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
-# Check the ABI_VIDEODRV_VERSION
-SAVE_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $XORG_CFLAGS"
-
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test x$XSERVER_LIBPCIACCESS = xyes)
if test "$XSERVER_LIBPCIACCESS" = yes; then
AC_DEFINE(XSERVER_LIBPCIACCESS,1,[Enable libpciaccess])
commit 9d2df860cc6dc7e2d4f96faffcb3d2fcc1580e27
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:51:31 2020 -0700
Save C++ flags when checking for libpciaccess
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 6b78a5a..82fb35b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,9 +89,12 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
+CPPFLAGS="$SAVE_CPPFLAGS"
if test x$XSERVER_LIBPCIACCESS = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
commit 762bddbc4f7ba55db3172bd17f03c80638825604
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:51:20 2020 -0700
Change the xorg-server.h inclusion location when libpciaccess is used
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 0e5250c..6b78a5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,7 +91,7 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
- [#include "xorg/xorg-server.h"])
+ [#include "xorg-server.h"])
if test x$XSERVER_LIBPCIACCESS = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
commit c622f5e50caec4dd8c3497555eb2f81b45cf069c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:51:11 2020 -0700
Remove a rogue (unnecessary) check for xf86Modes.h
This one line came from commit 2cfabf3 (libpciaccess support). It
should have never been included.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index ff2cd99..0e5250c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,6 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
-AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg/xorg-server.h"])
commit 6a2f32a0d91bab5a22f3426116670a0044effceb
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:50:58 2020 -0700
Virtually identical reversion of commit 69bac26
The original commit in question is commit 69bac26 (Fix from
Schlichter so xorg driver can be built on embedded platforms).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 359af05..ff2cd99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,17 +85,14 @@ PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
+sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
-
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$XORG_CFLAGS $CPPFLAGS"
AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
- [#include "xorg-server.h"])
-CPPFLAGS="$save_CPPFLAGS"
+ [#include "xorg/xorg-server.h"])
if test x$XSERVER_LIBPCIACCESS = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
commit 3eab6c7a0b556bd0b48c90d018cc27b8be181852
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:50:43 2020 -0700
Revert "More fixes for DRI. Also add support for UDEV for hotplug events."
This reverts commit f0018c1e5a94afe7d47ade9b73d0e4926d0c8fba.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 4b20bbb..359af05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,20 +103,12 @@ fi
if test "$DRI" != no; then
PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
- AC_CHECK_HEADER([dri.h],
+ AC_CHECK_HEADER([${sdkdir}/dri.h],
[have_dri_h="yes"], [have_dri_h="no"],[-])
- AC_CHECK_HEADER([sarea.h],
+ AC_CHECK_HEADER([${sdkdir}/sarea.h],
[have_sarea_h="yes"], [have_sarea_h="no"],[-])
-AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#include <xorg-server.h>
-#include <dristruct.h>
- ]])],
+ AC_CHECK_HEADER([${sdkdir}/dristruct.h],
[have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
- AC_CHECK_HEADER([damage.h],
- [have_damage_h="yes"], [have_damage_h="no"],[-])
- CPPFLAGS="$save_CPPFLAGS"
fi
AC_MSG_CHECKING([whether to include DRI support])
@@ -133,24 +125,9 @@ AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
if test "$DRI" = yes; then
+ PKG_CHECK_MODULES(DRI, [libdrm xf86driproto])
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
- if test "$have_damage_h" = yes; then
- AC_DEFINE(DAMAGE,1,[Use Damage extension])
- fi
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $CFLAGS"
-AC_CHECK_HEADER(xf86drmMode.h,[DRM_MODE=yes],[DRM_MODE=no],[#include <stdint.h>
-#include <stdlib.h>])
- if test "x$DRM_MODE" = xyes; then
- PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
- if test "x$LIBUDEV" = xyes; then
- AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])
- fi
- fi
- CFLAGS="$save_CFLAGS"
-
case "$host_cpu" in
i*86)
XVMC=yes ;;
commit b6eb82e6e08e1aff532c441b019e18f0d620c869
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:50:20 2020 -0700
Revert "Lower libdrm requirement to 2.0"
This reverts commit f5c1627ff0cbac097173e509f96f62b6021397ca.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 51e427a..4b20bbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@ if test x$XSERVER_LIBPCIACCESS = xyes; then
fi
if test "$DRI" != no; then
- PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
+ PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
AC_CHECK_HEADER([dri.h],
commit 4d4ef41ef29af49a96a3762186a295caefd062ef
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:49:21 2020 -0700
Virtually identical reversion of commit 592fbd1
The original commit in question is commit 592fbd1 (Remove
--(enable|disable)-dri configure option, it depends on . . .).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 150e456..51e427a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,11 @@ AC_ARG_WITH(xorg-module-dir,
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
+AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
+ [Disable DRI support [[default=auto]]]),
+ [DRI="$enableval"],
+ [DRI=auto])
+
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
[Enable debugging support [[default=no]]]),
[DEBUG="$enableval"],
@@ -96,29 +101,33 @@ if test x$XSERVER_LIBPCIACCESS = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
fi
-PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
-AC_CHECK_HEADER([dri.h],
- [have_dri_h="yes"], [have_dri_h="no"],[-])
-AC_CHECK_HEADER([sarea.h],
- [have_sarea_h="yes"], [have_sarea_h="no"],[-])
+if test "$DRI" != no; then
+ PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
+ AC_CHECK_HEADER([dri.h],
+ [have_dri_h="yes"], [have_dri_h="no"],[-])
+ AC_CHECK_HEADER([sarea.h],
+ [have_sarea_h="yes"], [have_sarea_h="no"],[-])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <xorg-server.h>
#include <dristruct.h>
- ]])],
- [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
-AC_CHECK_HEADER([damage.h],
- [have_damage_h="yes"], [have_damage_h="no"],[-])
-CPPFLAGS="$save_CPPFLAGS"
+ ]])],
+ [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
+ AC_CHECK_HEADER([damage.h],
+ [have_damage_h="yes"], [have_damage_h="no"],[-])
+ CPPFLAGS="$save_CPPFLAGS"
+fi
AC_MSG_CHECKING([whether to include DRI support])
-if test "$have_dri_h" = yes -a \
- "$have_sarea_h" = yes -a \
- "$have_dristruct_h" = yes; then
- DRI="yes"
-else
- DRI="no"
+if test x$DRI = xauto; then
+ if test "$have_dri_h" = yes -a \
+ "$have_sarea_h" = yes -a \
+ "$have_dristruct_h" = yes; then
+ DRI="yes"
+ else
+ DRI="no"
+ fi
fi
AC_MSG_RESULT([$DRI])
commit e505d7a8b8ba034cfd6208768f19c87fa60685c7
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 10:48:13 2020 -0700
Revert “XSERVER_LIBPCIACCESS is now decrepide . . ."
Not a verbatim reversion (code has changed somewhat since the original
commit), but revert commit 6f75bbc (XSERVER_LIBPCIACCESS is now
decrepide . . .).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index fd524e4..150e456 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,11 +87,14 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$XORG_CFLAGS $CPPFLAGS"
AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
-PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.11.0],
- HAVE_PCIACCESS="yes"; AC_DEFINE(HAVE_PCIACCESS, 1, [libpciacces available]),
- HAVE_PCIACCESS="no")
-AC_SUBST([PCIACCESS_CFLAGS])
-AC_SUBST([PCIACCESS_LIBS])
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+ [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
+ [#include "xorg-server.h"])
+CPPFLAGS="$save_CPPFLAGS"
+
+if test x$XSERVER_LIBPCIACCESS = xyes; then
+ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+fi
PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
save_CPPFLAGS="$CPPFLAGS"
@@ -161,6 +164,15 @@ AC_MSG_RESULT([$XVMC])
AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
+# Check the ABI_VIDEODRV_VERSION
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $XORG_CFLAGS"
+
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test x$XSERVER_LIBPCIACCESS = xyes)
+if test "$XSERVER_LIBPCIACCESS" = yes; then
+ AC_DEFINE(XSERVER_LIBPCIACCESS,1,[Enable libpciaccess])
+fi
+
AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes)
if test "$DEBUG" = yes; then
AC_DEFINE(HAVE_DEBUG,1,[Enable debug support])
diff --git a/src/via_dri.c b/src/via_dri.c
index ec46fa0..4ffc034 100644
--- a/src/via_dri.c
+++ b/src/via_dri.c
@@ -120,7 +120,7 @@ VIADRIIrqInit(ScrnInfoPtr pScrn, VIADRIPtr pVIADRI)
pVIADRI->irqEnabled = drmGetInterruptFromBusID
(pVia->drmmode.fd,
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus),
pVia->PciInfo->dev, pVia->PciInfo->func
#else
diff --git a/src/via_driver.c b/src/via_driver.c
index 576b8ad..fe881f2 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -72,10 +72,10 @@ static const ViaDRMVersion drmOpenChromeDRMVersion = { 3, 3, 0 };
/* Prototypes. */
static void VIAIdentify(int flags);
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
static Bool via_pci_probe(DriverPtr drv, int entity_num,
struct pci_device *dev, intptr_t match_data);
-#else /* !HAVE_PCIACCESS */
+#else /* !XSERVER_LIBPCIACCESS */
static Bool VIAProbe(DriverPtr drv, int flags);
#endif
@@ -85,7 +85,7 @@ static Bool VIAScreenInit(SCREEN_INIT_ARGS_DECL);
int gVIAEntityIndex = -1;
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#define VIA_DEVICE_MATCH(d,i) \
{ 0x1106, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
@@ -106,13 +106,13 @@ static const struct pci_id_match via_device_match[] = {
{ 0, 0, 0 },
};
-#endif /* HAVE_PCIACCESS */
+#endif /* XSERVER_LIBPCIACCESS */
_X_EXPORT DriverRec VIA = {
VIA_DRIVER_VERSION,
VIA_DRIVER_NAME,
VIAIdentify,
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
NULL,
#else
VIAProbe,
@@ -121,7 +121,7 @@ _X_EXPORT DriverRec VIA = {
NULL,
0,
NULL,
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
via_device_match,
via_pci_probe
#endif
@@ -197,7 +197,7 @@ VIASetup(pointer module, pointer opts, int *errmaj, int *errmin)
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&VIA, module,
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
HaveDriverFuncs
#else
0
@@ -420,7 +420,7 @@ VIAIdentify(int flags)
VIAChipsets);
}
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
static Bool
via_pci_probe(DriverPtr driver, int entity_num,
struct pci_device *device, intptr_t match_data)
@@ -455,7 +455,7 @@ via_pci_probe(DriverPtr driver, int entity_num,
}
return scrn != NULL;
}
-#else /* !HAVE_PCIACCESS */
+#else /* !XSERVER_LIBPCIACCESS */
static Bool
VIAProbe(DriverPtr drv, int flags)
{
@@ -565,7 +565,7 @@ VIAProbe(DriverPtr drv, int flags)
return foundScreen;
} /* VIAProbe */
-#endif /* !HAVE_PCIACCESS */
+#endif /* !XSERVER_LIBPCIACCESS */
static int
LookupChipSet(PciChipsets *pset, int chipSet)
@@ -916,7 +916,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
pVia = VIAPTR(pScrn);
pVia->IsSecondary = FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-#ifndef HAVE_PCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
if (pEnt->resources) {
free(pEnt);
goto free_rec;
@@ -964,7 +964,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
pVia->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
-#ifndef HAVE_PCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
xf86RegisterResources(pEnt->index, NULL, ResNone);
#endif
if (pEnt->device->chipset && *pEnt->device->chipset) {
@@ -994,7 +994,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
pVia->ChipRev);
} else {
/* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip revision */
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *bridge = pci_device_get_parent_bridge(pVia->PciInfo);
uint8_t rev = 0;
diff --git a/src/via_driver.h b/src/via_driver.h
index d17a5d9..4f8de0c 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -78,7 +78,7 @@
#include "via_xv_overlay.h"
#include "via_eng_regs.h"
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#include <pciaccess.h>
#endif
#include <errno.h>
@@ -226,10 +226,8 @@ typedef struct _VIA {
CreateScreenResourcesProcPtr CreateScreenResources;
CloseScreenProcPtr CloseScreen;
-#ifdef HAVE_PCIACCESS
struct pci_device *PciInfo;
-#else
- pciVideoPtr PciInfo;
+#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
#endif
int Chipset;
diff --git a/src/via_eng_regs.h b/src/via_eng_regs.h
index 6022960..4f1f8e8 100644
--- a/src/via_eng_regs.h
+++ b/src/via_eng_regs.h
@@ -722,7 +722,7 @@
#define MPG_SLICE_LENGTH 0x9C
#define MPG_SLICE_DATA 0xA0
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#define VIA_MEMBASE(p,n) (p)->regions[(n)].base_addr
#define VENDOR_ID(p) (p)->vendor_id
#define DEVICE_ID(p) (p)->device_id
diff --git a/src/via_ums.c b/src/via_ums.c
index a17746c..6a45277 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -97,7 +97,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
VIAPtr pVia = VIAPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
CARD8 val;
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
int err;
#else
unsigned char *tmp;
@@ -106,7 +106,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Entered viaMapMMIO.\n"));
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pVia->MmioBase = pVia->PciInfo->regions[1].base_addr;
#else
pVia->MmioBase = pVia->PciInfo->memBase[1];
@@ -117,7 +117,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
"size %u KB.\n",
pVia->MmioBase, VIA_MMIO_REGSIZE / 1024);
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
err = pci_device_map_range(pVia->PciInfo,
pVia->MmioBase,
VIA_MMIO_REGSIZE, PCI_DEV_MAP_FLAG_WRITABLE,
@@ -146,7 +146,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
"size %u KB.\n",
pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE / 1024);
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
err = pci_device_map_range(pVia->PciInfo,
pVia->MmioBase + VIA_MMIO_BLTBASE,
VIA_MMIO_BLTSIZE, PCI_DEV_MAP_FLAG_WRITABLE,
@@ -196,7 +196,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
fail:
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
if (pVia->BltBase) {
pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->BltBase,
VIA_MMIO_BLTSIZE);
@@ -236,7 +236,7 @@ viaUnmapMMIO(ScrnInfoPtr pScrn)
viaMMIODisable(pScrn);
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
if (pVia->BltBase) {
pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->BltBase,
VIA_MMIO_BLTSIZE);
@@ -269,7 +269,7 @@ static Bool
viaMapFB(ScrnInfoPtr pScrn)
{
VIAPtr pVia = VIAPTR(pScrn);
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
int err;
#else
unsigned char *tmp;
@@ -285,7 +285,7 @@ viaMapFB(ScrnInfoPtr pScrn)
goto exit;
}
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
if (pVia->Chipset == VIA_VX900) {
pVia->FrameBufferBase = pVia->PciInfo->regions[2].base_addr;
} else {
@@ -299,7 +299,7 @@ viaMapFB(ScrnInfoPtr pScrn)
}
#endif
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase,
pVia->videoRambytes,
PCI_DEV_MAP_FLAG_WRITABLE |
@@ -380,7 +380,7 @@ viaUnmapFB(ScrnInfoPtr pScrn)
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Entered %s.\n", __func__));
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
if (pVia->FBBase) {
pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase,
pVia->videoRambytes);
@@ -796,7 +796,7 @@ viaUMSMapIOResources(ScrnInfoPtr pScrn)
pScrn->fbOffset = pScrn->videoRam << 10;
}
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
if (pVia->Chipset == VIA_VX900) {
pScrn->memPhysBase = pVia->PciInfo->regions[2].base_addr;
} else {
@@ -890,7 +890,7 @@ exit:
static Bool
viaProbeVRAM(ScrnInfoPtr pScrn)
{
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *hostBridge = NULL;
struct pci_device *dramController = NULL;
#endif
@@ -903,7 +903,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Entered viaProbeVRAM.\n"));
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
hostBridge = pci_device_find_by_slot(0, 0, 0, 0);
hostBridgeVendorID = VENDOR_ID(hostBridge);
#else
@@ -915,7 +915,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
goto exit;
}
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
hostBridgeDeviceID = DEVICE_ID(hostBridge);
#else
hostBridgeDeviceID = pciReadWord(pciTag(0, 0, 0), 0x02);
@@ -923,7 +923,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
if ((hostBridgeDeviceID != PCI_DEVICE_ID_VIA_CLE266_HB) &&
(hostBridgeDeviceID != PCI_DEVICE_ID_VIA_KM400_HB)) {
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
dramController = pci_device_find_by_slot(0, 0, 0, 3);
dramControllerVendorID = VENDOR_ID(dramController);
#else
@@ -939,7 +939,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_CLE266_HB:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"CLE266 chipset host bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(hostBridge, &videoRAM, 0xE1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 0), 0xE1);
@@ -949,7 +949,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_KM400_HB:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"KM400 chipset host bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(hostBridge, &videoRAM, 0xE1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 0), 0xE1);
@@ -959,7 +959,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_P4M800_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"P4M800 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -969,7 +969,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_P4M800_PRO_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"P4M800 Pro chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -979,7 +979,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_PM800_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"PM800 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -989,7 +989,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_K8M800_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"K8M800 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -999,7 +999,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_CX700_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"CX700 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1009,7 +1009,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_P4M890_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"P4M890 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1019,7 +1019,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_K8M890_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"K8M890 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1029,7 +1029,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_P4M900_AGP:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"P4M900 chipset AGP bridge detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1039,7 +1039,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_VX800_HC:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"VX800 chipset host controller detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1049,7 +1049,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_VX855_HC:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"VX855 chipset host controller detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1059,7 +1059,7 @@ viaProbeVRAM(ScrnInfoPtr pScrn)
case PCI_DEVICE_ID_VIA_VX900_HC:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"VX900 chipset host controller detected.\n");
-#ifdef HAVE_PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_cfg_read_u8(dramController, &videoRAM, 0xA1);
#else
videoRAM = pciReadByte(pciTag(0, 0, 3), 0xA1);
@@ -1392,7 +1392,7 @@ viaUMSPreInit(ScrnInfoPtr pScrn)
pVia->videoRambytes = pScrn->videoRam << 10;
/* maybe throw in some more sanity checks here */
-#ifndef HAVE_PCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device,
pVia->PciInfo->func);
#endif
commit ca6600a881459ebea36ea2f383ccf31c423a52b2
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 09:11:39 2020 -0700
Equivalent reversion of commit f721d02
Equivalent reversion of commit f721d02 (Do not support earlier libdrm
versions that lack KMS support.).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 8e70397..fd524e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,25 +93,51 @@ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.11.0],
AC_SUBST([PCIACCESS_CFLAGS])
AC_SUBST([PCIACCESS_LIBS])
-PKG_CHECK_MODULES(DRI, [libdrm >= 2.4.4 xf86driproto],
- DRI="yes"; AC_DEFINE(HAVE_DRI, 1, [DRI is available]),
- DRI="no")
+PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
+AC_CHECK_HEADER([dri.h],
+ [have_dri_h="yes"], [have_dri_h="no"],[-])
+AC_CHECK_HEADER([sarea.h],
+ [have_sarea_h="yes"], [have_sarea_h="no"],[-])
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <xorg-server.h>
+#include <dristruct.h>
+ ]])],
+ [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
+AC_CHECK_HEADER([damage.h],
+ [have_damage_h="yes"], [have_damage_h="no"],[-])
+CPPFLAGS="$save_CPPFLAGS"
+
+AC_MSG_CHECKING([whether to include DRI support])
+if test "$have_dri_h" = yes -a \
+ "$have_sarea_h" = yes -a \
+ "$have_dristruct_h" = yes; then
+ DRI="yes"
+else
+ DRI="no"
+fi
AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
if test "$DRI" = yes; then
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
-
- AC_CHECK_HEADER([damage.h],
- [have_damage_h="yes"], [have_damage_h="no"],[-])
+ AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
if test "$have_damage_h" = yes; then
AC_DEFINE(DAMAGE,1,[Use Damage extension])
fi
- PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
- if test "x$LIBUDEV" = xyes; then
- AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $CFLAGS"
+AC_CHECK_HEADER(xf86drmMode.h,[DRM_MODE=yes],[DRM_MODE=no],[#include <stdint.h>
+#include <stdlib.h>])
+ if test "x$DRM_MODE" = xyes; then
+ PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
+ if test "x$LIBUDEV" = xyes; then
+ AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])
+ fi
fi
+ CFLAGS="$save_CFLAGS"
case "$host_cpu" in
i*86)
diff --git a/src/Makefile.am b/src/Makefile.am
index f55d39a..1b89ede 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,7 +29,7 @@ SUBDIRS = xvmc
BUILT_SOURCES = version.h
EXTRA_DIST = version.h
CONFIG_CLEAN_FILES= version.h
-AM_CFLAGS = @XORG_CFLAGS@ $(CWARNFLAGS) @LIBUDEV_CFLAGS@ @DRI_CFLAGS@
+AM_CFLAGS = @XORG_CFLAGS@ $(CWARNFLAGS) @DRI_CFLAGS@
openchrome_drv_la_LTLIBRARIES = openchrome_drv.la
openchrome_drv_la_LDFLAGS = -module -avoid-version
openchrome_drv_ladir = @moduledir@/drivers
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 4c2f322..0f3022c 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -27,7 +27,7 @@
#ifndef DRMMODE_DISPLAY_H
#define DRMMODE_DISPLAY_H
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "xf86drmMode.h"
#endif
#ifdef HAVE_LIBUDEV
@@ -37,7 +37,7 @@
typedef struct {
int fd;
uint32_t fb_id;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
drmModeResPtr mode_res;
drmModeFBPtr mode_fb;
drmEventContext event_context;
@@ -54,7 +54,7 @@ typedef struct {
typedef struct {
drmmode_ptr drmmode;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
drmModeCrtcPtr mode_crtc;
#endif
struct buffer_object *cursor_bo;
@@ -62,7 +62,7 @@ typedef struct {
int index;
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
typedef struct {
drmModePropertyPtr mode_prop;
uint64_t value;
diff --git a/src/via_driver.c b/src/via_driver.c
index 05e04c2..576b8ad 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -49,7 +49,7 @@
#endif
#include "xf86Crtc.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "dri.h"
#else
#include "drm_fourcc.h"
@@ -277,7 +277,7 @@ VIAEnterVT_internal(ScrnInfoPtr pScrn, int flags)
viaRestoreVideo(pScrn);
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
kickVblank(pScrn);
VIADRIRingBufferInit(pScrn);
@@ -310,7 +310,7 @@ VIALeaveVT_internal(ScrnInfoPtr pScrn, int flags)
"Entered %s.\n", __func__));
if (!flags) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *) DRIGetSAREAPrivate(pScrn->pScreen);
@@ -733,7 +733,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
scrn->virtualY = height;
scrn->displayWidth = width;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->KMS) {
ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
scrn->bitsPerPixel, width * cpp,
@@ -792,7 +792,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
}
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->KMS && old_fb_id) {
drmModeRmFB(drmmode->fd, old_fb_id);
}
@@ -834,7 +834,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
EntityInfoPtr pEnt;
VIAPtr pVia;
MessageType from = X_DEFAULT;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
char *busId = NULL;
drmVersionPtr drmVer;
#endif
@@ -1012,7 +1012,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
pVia->directRenderingType = DRI_NONE;
pVia->KMS = FALSE;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
busId = DRICreatePCIBusID(pVia->PciInfo);
/* Look for OpenChrome DRM first. */
@@ -1299,7 +1299,7 @@ VIACreateScreenResources(ScreenPtr pScreen)
rootPixmap = pScreen->GetScreenPixmap(pScreen);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
drmmode_uevent_init(pScrn, &pVia->drmmode);
#endif
surface = drm_bo_map(pScrn, pVia->drmmode.front_bo);
@@ -1359,13 +1359,13 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
if (pScrn->vtSema)
VIALeaveVT(VT_FUNC_ARGS(0));
-#ifdef HAVE_DRI
+#ifdef XF86DRI
drmmode_uevent_fini(pScrn, &pVia->drmmode);
#endif
xf86_cursors_fini(pScreen);
if (pVia->drmmode.front_bo) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->KMS && pVia->drmmode.fb_id)
drmModeRmFB(pVia->drmmode.fd, pVia->drmmode.fb_id);
#endif
@@ -1381,7 +1381,7 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
*/
drm_bo_free(pScrn, iga->cursor_bo);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1)
VIADRICloseScreen(pScreen);
@@ -1478,7 +1478,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
}
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->KMS) {
if (drmSetMaster(pVia->drmmode.fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1500,9 +1500,9 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
}
#endif
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType != DRI_2)
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
{
if (!viaUMSScreenInit(pScrn)) {
return FALSE;
@@ -1511,9 +1511,9 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
if ((!pVia->NoAccel) &&
((pVia->directRenderingType == DRI_NONE)
-#ifdef HAVE_DRI
+#ifdef XF86DRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
)) {
if (!viaUMSAccelInit(pScrn)) {
return FALSE;
@@ -1613,7 +1613,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
return FALSE;
if (pVia->directRenderingType != DRI_2) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
if (!VIADRIFinishScreenInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
diff --git a/src/via_driver.h b/src/via_driver.h
index 3e34f36..d17a5d9 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -55,7 +55,7 @@
#include "xf86RandR12.h"
#include "xf86cmap.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#define _XF86DRI_SERVER_
#include "xf86dri.h"
#include "sarea.h"
@@ -141,7 +141,7 @@ enum dri_type {
DRI_2
};
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#define VIA_XVMC_MAX_BUFFERS 2
#define VIA_XVMC_MAX_CONTEXTS 4
@@ -269,7 +269,7 @@ typedef struct _VIA {
char * scratchAddr;
Bool noComposite;
struct buffer_object *scratchBuffer;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
struct buffer_object *texAGPBuffer;
char * dBounce;
#endif
@@ -287,7 +287,7 @@ typedef struct _VIA {
drmmode_rec drmmode;
enum dri_type directRenderingType;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
Bool XvMCEnabled;
DRIInfoPtr pDRIInfo;
int numVisualConfigs;
@@ -452,7 +452,7 @@ extern vidCopyFunc viaVidCopyInit(const char *copyType, ScreenPtr pScreen );
/* In via_xwmc.c */
-#ifdef HAVE_DRI
+#ifdef XF86DRI
/* Basic init and exit functions */
void ViaInitXVMC(ScreenPtr pScreen);
void ViaCleanupXVMC(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr *XvAdaptors, int XvAdaptorCount);
@@ -462,7 +462,7 @@ int viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt);
unsigned long viaXvMCPutImageSize(ScrnInfoPtr pScrn);
#endif
-#ifdef HAVE_DRI
+#ifdef XF86DRI
Bool VIADRI1ScreenInit(ScreenPtr pScreen);
void VIADRICloseScreen(ScreenPtr pScreen);
Bool VIADRIFinishScreenInit(ScreenPtr pScreen);
@@ -472,6 +472,6 @@ void viaDRIOffscreenRestore(ScrnInfoPtr pScrn);
void viaDRIOffscreenSave(ScrnInfoPtr pScrn);
Bool VIADRIBufferInit(ScrnInfoPtr pScrn);
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
#endif /* _VIA_DRIVER_H_ */
diff --git a/src/via_exa.c b/src/via_exa.c
index d2c5762..1699a51 100644
--- a/src/via_exa.c
+++ b/src/via_exa.c
@@ -133,7 +133,7 @@ viaFlushPCI(ViaCommandBuffer *cb)
cb->has3dState = FALSE;
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
/*
* Flush the command buffer using DRM. If in PCI mode, we can bypass DRM,
* but not for command buffers that contain 3D engine state, since then
@@ -186,7 +186,7 @@ viaFlushDRIEnabled(ViaCommandBuffer *cb)
static int
viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size)
{
-#ifdef HAVE_DRI
+#ifdef XF86DRI
VIAPtr pVia = VIAPTR(pScrn);
#endif
@@ -202,7 +202,7 @@ viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size)
cb->rindex = 0;
cb->has3dState = FALSE;
cb->flushFunc = viaFlushPCI;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
cb->flushFunc = viaFlushDRIEnabled;
}
@@ -277,7 +277,7 @@ viaCheckUpload(ScrnInfoPtr pScrn, Via3DState * v3d)
forceUpload = (pVia->lastToUpload != v3d);
pVia->lastToUpload = v3d;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
DRIGetSAREAPrivate(pScrn->pScreen);
@@ -525,7 +525,7 @@ viaAccelWaitMarker(ScreenPtr pScreen, int marker)
}
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
static int
viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
unsigned srcPitch, unsigned char *dst,
@@ -786,7 +786,7 @@ viaExaTexUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
return TRUE;
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
int
viaEXAOffscreenAlloc(ScrnInfoPtr pScrn, struct buffer_object *obj,
@@ -817,7 +817,7 @@ exit:
Bool
viaIsAGP(VIAPtr pVia, PixmapPtr pPix, unsigned long *offset)
{
-#ifdef HAVE_DRI
+#ifdef XF86DRI
unsigned long offs;
if (pVia->directRenderingType && !pVia->IsPCI) {
@@ -863,7 +863,7 @@ viaInitExa(ScreenPtr pScreen)
* Also some CLE266 hardware may not allow nPOT textures for
* texture engine 1. We need to figure that out.
*/
-#ifdef HAVE_DRI
+#ifdef XF86DRI
nPOTSupported = ((!pVia->directRenderingType) ||
(pVia->drmVerMajor > 2) ||
((pVia->drmVerMajor == 2) && (pVia->drmVerMinor >= 11)));
@@ -935,7 +935,7 @@ viaInitExa(ScreenPtr pScreen)
break;
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
#ifdef linux
pExa->DownloadFromScreen = viaExaDownloadFromScreen;
@@ -950,7 +950,7 @@ viaInitExa(ScreenPtr pScreen)
break;
}
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
if (!pVia->noComposite) {
switch (pVia->Chipset) {
@@ -998,7 +998,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
VIAPtr pVia = VIAPTR(pScrn);
int size;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType && pVia->useEXA) {
pVia->dBounce = calloc(VIA_DMA_DL_SIZE * 2, 1);
@@ -1031,7 +1031,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
}
}
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
if (!pVia->scratchAddr && pVia->useEXA) {
size = pVia->exaScratchSize * 1024 + 32;
pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_SYSTEM);
@@ -1060,7 +1060,7 @@ viaExitAccel(ScreenPtr pScreen)
viaTearDownCBuffer(&pVia->cb);
if (pVia->useEXA) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (pVia->directRenderingType == DRI_1) {
if (pVia->texAGPBuffer) {
drm_bo_free(pScrn, pVia->texAGPBuffer);
@@ -1074,7 +1074,7 @@ viaExitAccel(ScreenPtr pScreen)
}
if (pVia->dBounce)
free(pVia->dBounce);
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
if (pVia->scratchBuffer) {
drm_bo_free(pScrn, pVia->scratchBuffer);
pVia->scratchBuffer = NULL;
diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 7250197..900068a 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -31,13 +31,13 @@
#include "xf86_OSproc.h"
#include "xf86fbman.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "xf86drm.h"
#endif
#include "drm_fourcc.h"
#include "via_driver.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "via_drm.h"
#include "openchrome_drm.h"
@@ -124,7 +124,7 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
obj->handle));
}
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
} else if (pVia->directRenderingType == DRI_1) {
drm_via_mem_t drm;
@@ -201,22 +201,22 @@ void*
drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
{
VIAPtr pVia = VIAPTR(pScrn);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
struct drm_openchrome_gem_map args;
int ret;
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
if ((pVia->directRenderingType == DRI_NONE)
-#ifdef HAVE_DRI
+#ifdef XF86DRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
) {
switch (obj->domain) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
case TTM_PL_FLAG_TT:
obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
break;
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
case TTM_PL_FLAG_VRAM:
obj->ptr = pVia->FBBase + obj->offset;
break;
@@ -224,7 +224,7 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
obj->ptr = NULL;
break;
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
} else if (pVia->directRenderingType == DRI_2) {
memset(&args, 0, sizeof(args));
args.handle = obj->handle;
@@ -243,12 +243,12 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
DEBUG(ErrorF("mmap failed with error %d\n", -errno));
obj->ptr = NULL;
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
exit:
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
return obj->ptr;
}
@@ -256,17 +256,17 @@ void
drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
{
VIAPtr pVia = VIAPTR(pScrn);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
struct drm_openchrome_gem_unmap args;
int ret;
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
if ((pVia->directRenderingType == DRI_NONE)
-#ifdef HAVE_DRI
+#ifdef XF86DRI
|| (pVia->directRenderingType == DRI_1)
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
} else if (pVia->directRenderingType == DRI_2) {
munmap(obj->ptr, obj->size);
@@ -279,12 +279,12 @@ drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
if (ret) {
goto exit;
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
exit:
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
obj->ptr = NULL;
}
@@ -309,7 +309,7 @@ drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj)
exaOffscreenFree(pScrn->pScreen, pArea);
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
} else if (pVia->directRenderingType == DRI_1) {
drm_via_mem_t drm;
diff --git a/src/via_priv.h b/src/via_priv.h
index dad3d76..921b716 100644
--- a/src/via_priv.h
+++ b/src/via_priv.h
@@ -27,7 +27,7 @@
#ifndef _VIA_PRIV_H_
#define _VIA_PRIV_H_ 1
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "via_drm.h"
#endif
#include "exa.h"
diff --git a/src/via_ums.c b/src/via_ums.c
index f4c1d72..a17746c 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -689,10 +689,10 @@ viaUMSAccelInit(ScrnInfoPtr pScrn)
pVia->curMarker = 0;
pVia->lastMarkerRead = 0;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
pVia->dBounce = NULL;
pVia->scratchAddr = NULL;
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
ret = TRUE;
err:
if (!ret) {
@@ -865,7 +865,7 @@ viaUMSScreenInit(ScrnInfoPtr pScrn)
ret = FALSE;
}
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
} else if (pVia->directRenderingType == DRI_1) {
if (!VIADRIKernelInit(pScrn)) {
ret = FALSE;
diff --git a/src/via_xv.c b/src/via_xv.c
index bccce55..9b8d8a7 100644
--- a/src/via_xv.c
+++ b/src/via_xv.c
@@ -592,7 +592,7 @@ viaExitVideo(ScrnInfoPtr pScrn)
DBG_DD(ErrorF(" via_xv.c : viaExitVideo : \n"));
-#ifdef HAVE_DRI
+#ifdef XF86DRI
ViaCleanupXVMC(pScrn, viaAdaptPtr, XV_ADAPT_NUM);
#endif
@@ -642,7 +642,7 @@ viaInitVideo(ScreenPtr pScreen)
num_new = 0;
pVia->useDmaBlit = FALSE;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
pVia->useDmaBlit = (pVia->directRenderingType == DRI_1) &&
((pVia->Chipset == VIA_CLE266) ||
(pVia->Chipset == VIA_KM400) ||
@@ -700,7 +700,7 @@ viaInitVideo(ScreenPtr pScreen)
if (num_adaptors) {
xf86XVScreenInit(pScreen, allAdaptors, num_adaptors);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
ViaInitXVMC(pScreen);
#endif
viaSetColorSpace(pVia, 0, 0, 0, 0, TRUE);
@@ -795,7 +795,7 @@ viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors)
}
usedPorts += j;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
viaXvMCInitXv(pScrn, viaAdaptPtr[i]);
#endif
@@ -1022,7 +1022,7 @@ nv12cp(unsigned char *dst, const unsigned char *src, int dstPitch,
src + srcVOffset, w >> 1, w >>1, dstPitch, h >> 1);
}
-#ifdef HAVE_DRI
+#ifdef XF86DRI
static int
viaDmaBlitImage(VIAPtr pVia,
@@ -1240,7 +1240,7 @@ viaPutImage(ScrnInfoPtr pScrn,
dstPitch = pVia->swov.SWDevice.dwPitch;
if (pVia->useDmaBlit) {
-#ifdef HAVE_DRI
+#ifdef XF86DRI
if (viaDmaBlitImage(pVia, pPriv, buf,
(CARD32) pVia->swov.SWDevice.dwSWPhysicalAddr[pVia->dwFrameNum & 1],
width, height, dstPitch, id)) {
@@ -1448,7 +1448,7 @@ viaQueryImageAttributes(ScrnInfoPtr pScrn,
break;
case FOURCC_XVMC:
*h = (*h + 1) & ~1;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
size = viaXvMCPutImageSize(pScrn);
#else
size = 0;
diff --git a/src/via_xv_overlay.c b/src/via_xv_overlay.c
index 776a79e..95feee1 100644
--- a/src/via_xv_overlay.c
+++ b/src/via_xv_overlay.c
@@ -30,7 +30,7 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "xf86drm.h"
#include "via_drmclient.h"
#include "via_drm.h"
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index 56b2602..c5a5ca5 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -36,7 +36,7 @@
#include "xf86Pci.h"
#include "regionstr.h"
-#ifdef HAVE_DRI
+#ifdef XF86DRI
#include "via_drmclient.h"
#include "via_drm.h"
@@ -994,4 +994,4 @@ viaXvMCPutImageSize(ScrnInfoPtr pScrn)
return 0;
}
-#endif /* HAVE_DRI */
+#endif /* XF86DRI */
commit 5c2053b6ef28bbd9ffb61db2effb0ca74239066c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 09:11:28 2020 -0700
Partial reversion of commit b466f47 for configure.ac and src/Makefile.am
The original commit in question is commit b466f47 (Support older X
servers for RHEL5).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 7f05bb8..8e70397 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm glproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
diff --git a/src/Makefile.am b/src/Makefile.am
index d8cbe11..f55d39a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,7 @@ EXTRA_DIST = version.h
CONFIG_CLEAN_FILES= version.h
AM_CFLAGS = @XORG_CFLAGS@ $(CWARNFLAGS) @LIBUDEV_CFLAGS@ @DRI_CFLAGS@
openchrome_drv_la_LTLIBRARIES = openchrome_drv.la
-openchrome_drv_la_LDFLAGS = -module -avoid-version @LIBUDEV_LIBS@
+openchrome_drv_la_LDFLAGS = -module -avoid-version
openchrome_drv_ladir = @moduledir@/drivers
openchrome_drv_la_SOURCES = \
commit 46f4c68b3c1ee95a19fbdbd9c732bd22c81ae58a
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 09:11:10 2020 -0700
Revert "Add an explicit message for KMS support configure check"
This reverts commit c27f9fedd1ffb3462154dc309afdf10b5b6ff50d.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index aa2fc8c..7f05bb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,7 +96,6 @@ AC_SUBST([PCIACCESS_LIBS])
PKG_CHECK_MODULES(DRI, [libdrm >= 2.4.4 xf86driproto],
DRI="yes"; AC_DEFINE(HAVE_DRI, 1, [DRI is available]),
DRI="no")
-AC_MSG_CHECKING([whether to build KMS support])
AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
commit 2be3e9316e928b6af4f1ac54985dcab302eed1fb
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 31 09:10:59 2020 -0700
Revert "Do not require libdrm as base pkg-config module"
This reverts commit cbead3b200b3948bd4ddf9e2133a7f5d431f58ff.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 472a027..aa2fc8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto glproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm glproto $REQUIRED_MODULES])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
HAVE_XEXTPROTO_71="no")
More information about the openchrome-devel
mailing list