summaryrefslogtreecommitdiff
path: root/driver/xf86-video-r128/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-04-08 17:49:09 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-04-08 17:49:09 +0000
commit26ce9f8a1b463f08a75aa655783071e25b931e78 (patch)
tree663e64e8eeb5cd3f80d8c058c4e403108e88f1ee /driver/xf86-video-r128/src
parent4cea424722f693056b29bbb75bbea24484405a76 (diff)
Update to xf86-video-r128 6.8.2
Diffstat (limited to 'driver/xf86-video-r128/src')
-rw-r--r--driver/xf86-video-r128/src/Makefile.in51
-rw-r--r--driver/xf86-video-r128/src/atipcirename.h27
-rw-r--r--driver/xf86-video-r128/src/r128.h14
-rw-r--r--driver/xf86-video-r128/src/r128_accel.c23
-rw-r--r--driver/xf86-video-r128/src/r128_dga.c12
-rw-r--r--driver/xf86-video-r128/src/r128_dri.c36
-rw-r--r--driver/xf86-video-r128/src/r128_driver.c86
-rw-r--r--driver/xf86-video-r128/src/r128_probe.c6
-rw-r--r--driver/xf86-video-r128/src/r128_video.c16
9 files changed, 143 insertions, 128 deletions
diff --git a/driver/xf86-video-r128/src/Makefile.in b/driver/xf86-video-r128/src/Makefile.in
index 6be9fdf94..6443f7800 100644
--- a/driver/xf86-video-r128/src/Makefile.in
+++ b/driver/xf86-video-r128/src/Makefile.in
@@ -50,9 +50,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
+install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
+install_sh_PROGRAM = ${SHELL} $(install_sh) -c
+install_sh_SCRIPT = ${SHELL} $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@@ -111,6 +111,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -118,23 +119,18 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
-BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
-BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
-BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
@@ -143,44 +139,47 @@ DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
-LINUXDOC = @LINUXDOC@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MAKE_HTML = @MAKE_HTML@
-MAKE_PDF = @MAKE_PDF@
-MAKE_PS = @MAKE_PS@
-MAKE_TEXT = @MAKE_TEXT@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -191,11 +190,11 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
-PS2PDF = @PS2PDF@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
USE_EXA_FALSE = @USE_EXA_FALSE@
USE_EXA_TRUE = @USE_EXA_TRUE@
@@ -204,15 +203,14 @@ XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -226,7 +224,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -288,9 +285,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
+ $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-r128/src/atipcirename.h b/driver/xf86-video-r128/src/atipcirename.h
index de8f0a391..e65ae3c1a 100644
--- a/driver/xf86-video-r128/src/atipcirename.h
+++ b/driver/xf86-video-r128/src/atipcirename.h
@@ -34,6 +34,33 @@ enum region_type {
REGION_IO
};
+#include "xf86Module.h"
+
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12
+
+#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
+#define PCI_DOM_MASK 0x01fful
+#else
+#define PCI_DOM_MASK 0x0ffu
+#endif
+
+#ifndef PCI_DOM_MASK
+# define PCI_DOM_MASK 0x0ffu
+#endif
+#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
+
+static inline uint32_t
+pciTag(int busnum, int devnum, int funcnum)
+{
+ uint32_t tag;
+ tag = (busnum & (PCI_DOMBUS_MASK)) << 16;
+ tag |= (devnum & 0x00001fu) << 11;
+ tag |= (funcnum & 0x000007u) << 8;
+
+ return tag;
+}
+#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 */
+
#ifndef XSERVER_LIBPCIACCESS
/* pciVideoPtr */
diff --git a/driver/xf86-video-r128/src/r128.h b/driver/xf86-video-r128/src/r128.h
index 1205245d5..fcef00c3d 100644
--- a/driver/xf86-video-r128/src/r128.h
+++ b/driver/xf86-video-r128/src/r128.h
@@ -56,7 +56,11 @@
#include "r128_probe.h"
/* DRI support */
-#ifdef XF86DRI
+#ifndef XF86DRI
+#undef R128DRI
+#endif
+
+#if R128DRI
#define _XF86DRI_SERVER_
#include "r128_dripriv.h"
#include "dri.h"
@@ -303,14 +307,14 @@ typedef struct {
int scanline_y;
int scanline_w;
int scanline_h;
-#ifdef XF86DRI
+#ifdef R128DRI
int scanline_hpass;
int scanline_x1clip;
int scanline_x2clip;
int scanline_rop;
int scanline_fg;
int scanline_bg;
-#endif /* XF86DRI */
+#endif /* R128DRI */
int scanline_words;
int scanline_direct;
int scanline_bpp; /* Only used for ImageWrite */
@@ -322,7 +326,7 @@ typedef struct {
DGAFunctionRec DGAFuncs;
R128FBLayout CurrentLayout;
-#ifdef XF86DRI
+#ifdef R128DRI
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
int drmFD;
@@ -474,7 +478,7 @@ extern int R128MinBits(int val);
extern void R128InitVideo(ScreenPtr pScreen);
-#ifdef XF86DRI
+#ifdef R128DRI
extern Bool R128DRIScreenInit(ScreenPtr pScreen);
extern void R128DRICloseScreen(ScreenPtr pScreen);
extern Bool R128DRIFinishScreenInit(ScreenPtr pScreen);
diff --git a/driver/xf86-video-r128/src/r128_accel.c b/driver/xf86-video-r128/src/r128_accel.c
index 88706824e..056b0b309 100644
--- a/driver/xf86-video-r128/src/r128_accel.c
+++ b/driver/xf86-video-r128/src/r128_accel.c
@@ -88,7 +88,7 @@
#include "r128.h"
#include "r128_reg.h"
#include "r128_probe.h"
-#ifdef XF86DRI
+#ifdef R128DRI
#include "r128_sarea.h"
#define _XF86DRI_SERVER_
#include "r128_dri.h"
@@ -187,7 +187,7 @@ void R128WaitForFifoFunction(ScrnInfoPtr pScrn, int entries)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"FIFO timed out, resetting engine...\n");
R128EngineReset(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
R128CCE_RESET(pScrn, info);
if (info->directRenderingEnabled) {
R128CCE_START(pScrn, info);
@@ -220,11 +220,11 @@ void R128WaitForIdle(ScrnInfoPtr pScrn)
INREG(R128_GUI_PROBE)));
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Idle timed out, resetting engine...\n");
-#ifdef XF86DRI
+#ifdef R128DRI
R128CCE_STOP(pScrn, info);
#endif
R128EngineReset(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
R128CCE_RESET(pScrn, info);
if (info->directRenderingEnabled) {
R128CCE_START(pScrn, info);
@@ -233,7 +233,7 @@ void R128WaitForIdle(ScrnInfoPtr pScrn)
}
}
-#ifdef XF86DRI
+#ifdef R128DRI
/* Wait until the CCE is completely idle: the FIFO has drained and the
* CCE is idle.
*/
@@ -1069,7 +1069,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
/* FIXME: this is a kludge for texture uploads in the 3D driver. Look at
* how the radeon driver handles HOST_DATA_SWAP if you want to implement
* CCE ImageWrite acceleration or anything needing this bit */
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled)
OUTREGP(R128_DP_DATATYPE, 0, ~R128_HOST_BIG_ENDIAN_EN);
else
@@ -1080,7 +1080,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
OUTREGP(R128_DP_DATATYPE, 0, ~R128_HOST_BIG_ENDIAN_EN);
#endif
-#ifdef XF86DRI
+#ifdef R128DRI
info->sc_left = 0x00000000;
info->sc_right = R128_DEFAULT_SC_RIGHT_MAX;
info->sc_top = 0x00000000;
@@ -1096,7 +1096,7 @@ void R128EngineInit(ScrnInfoPtr pScrn)
R128WaitForIdle(pScrn);
}
-#ifdef XF86DRI
+#ifdef R128DRI
/* Setup for XAA SolidFill. */
static void R128CCESetupForSolidFill(ScrnInfoPtr pScrn,
@@ -1804,7 +1804,7 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
| LEFT_EDGE_CLIPPING_NEGATIVE_X;
a->NumScanlineColorExpandBuffers = 1;
a->ScanlineColorExpandBuffers = info->scratch_buffer;
- info->scratch_save = xalloc(((pScrn->virtualX+31)/32*4)
+ info->scratch_save = malloc(((pScrn->virtualX+31)/32*4)
+ (pScrn->virtualX
* info->CurrentLayout.pixel_bytes));
info->scratch_buffer[0] = info->scratch_save;
@@ -1866,9 +1866,12 @@ Bool R128AccelInit(ScreenPtr pScreen)
R128InfoPtr info = R128PTR(pScrn);
XAAInfoRecPtr a;
+ if (!xf86LoadSubModule(pScrn, "xaa"))
+ return FALSE;
+
if (!(a = info->accel = XAACreateInfoRec())) return FALSE;
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled)
R128CCEAccelInit(pScrn, a);
else
diff --git a/driver/xf86-video-r128/src/r128_dga.c b/driver/xf86-video-r128/src/r128_dga.c
index 7dd03aafa..1c8a8ddf8 100644
--- a/driver/xf86-video-r128/src/r128_dga.c
+++ b/driver/xf86-video-r128/src/r128_dga.c
@@ -20,7 +20,7 @@
/* DGA support */
#include "dgaproc.h"
-#ifdef XF86DRI
+#ifdef R128DRI
#include "r128_common.h"
#endif
@@ -69,7 +69,7 @@ SECOND_PASS:
if (secondPitch)
pitch = secondPitch;
- if (!(newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec))))
+ if (!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
break;
modes = newmodes;
@@ -244,14 +244,14 @@ R128_SetMode(
pScrn->currentMode = info->CurrentLayout.mode;
pScrn->SwitchMode(indx, pScrn->currentMode, 0);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
R128CCE_STOP(pScrn, info);
}
#endif
if (info->accelOn)
R128EngineInit(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
R128CCE_START(pScrn, info);
}
@@ -276,14 +276,14 @@ R128_SetMode(
pScrn->SwitchMode(indx, pMode->mode, 0);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
R128CCE_STOP(pScrn, info);
}
#endif
if (info->accelOn)
R128EngineInit(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
R128CCE_START(pScrn, info);
}
diff --git a/driver/xf86-video-r128/src/r128_dri.c b/driver/xf86-video-r128/src/r128_dri.c
index 29277185e..624e3a544 100644
--- a/driver/xf86-video-r128/src/r128_dri.c
+++ b/driver/xf86-video-r128/src/r128_dri.c
@@ -105,21 +105,21 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
if (R128_USE_DB) numConfigs *= 2;
if (!(pConfigs
- = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+ = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
numConfigs))) {
return FALSE;
}
if (!(pR128Configs
- = (R128ConfigPrivPtr)xcalloc(sizeof(R128ConfigPrivRec),
+ = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
numConfigs))) {
- xfree(pConfigs);
+ free(pConfigs);
return FALSE;
}
if (!(pR128ConfigPtrs
- = (R128ConfigPrivPtr*)xcalloc(sizeof(R128ConfigPrivPtr),
+ = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
numConfigs))) {
- xfree(pConfigs);
- xfree(pR128Configs);
+ free(pConfigs);
+ free(pR128Configs);
return FALSE;
}
@@ -188,21 +188,21 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
if (R128_USE_DB) numConfigs *= 2;
if (!(pConfigs
- = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+ = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
numConfigs))) {
return FALSE;
}
if (!(pR128Configs
- = (R128ConfigPrivPtr)xcalloc(sizeof(R128ConfigPrivRec),
+ = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
numConfigs))) {
- xfree(pConfigs);
+ free(pConfigs);
return FALSE;
}
if (!(pR128ConfigPtrs
- = (R128ConfigPrivPtr*)xcalloc(sizeof(R128ConfigPrivPtr),
+ = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
numConfigs))) {
- xfree(pConfigs);
- xfree(pR128Configs);
+ free(pConfigs);
+ free(pR128Configs);
return FALSE;
}
@@ -1026,7 +1026,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
pDRIInfo->busIdString = DRICreatePCIBusID(info->PciInfo);
} else {
- pDRIInfo->busIdString = xalloc(64);
+ pDRIInfo->busIdString = malloc(64);
sprintf(pDRIInfo->busIdString,
"PCI:%d:%d:%d",
PCI_DEV_BUS(info->PciInfo),
@@ -1065,7 +1065,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->SAREASize = SAREA_MAX;
#endif
- if (!(pR128DRI = (R128DRIPtr)xcalloc(sizeof(R128DRIRec),1))) {
+ if (!(pR128DRI = (R128DRIPtr)calloc(sizeof(R128DRIRec),1))) {
DRIDestroyInfoRec(info->pDRIInfo);
info->pDRIInfo = NULL;
return FALSE;
@@ -1091,7 +1091,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] DRIScreenInit failed. Disabling DRI.\n");
- xfree(pDRIInfo->devPrivate);
+ free(pDRIInfo->devPrivate);
pDRIInfo->devPrivate = NULL;
DRIDestroyInfoRec(pDRIInfo);
pDRIInfo = NULL;
@@ -1352,18 +1352,18 @@ void R128DRICloseScreen(ScreenPtr pScreen)
/* De-allocate all DRI data structures */
if (info->pDRIInfo) {
if (info->pDRIInfo->devPrivate) {
- xfree(info->pDRIInfo->devPrivate);
+ free(info->pDRIInfo->devPrivate);
info->pDRIInfo->devPrivate = NULL;
}
DRIDestroyInfoRec(info->pDRIInfo);
info->pDRIInfo = NULL;
}
if (info->pVisualConfigs) {
- xfree(info->pVisualConfigs);
+ free(info->pVisualConfigs);
info->pVisualConfigs = NULL;
}
if (info->pVisualConfigsPriv) {
- xfree(info->pVisualConfigsPriv);
+ free(info->pVisualConfigsPriv);
info->pVisualConfigsPriv = NULL;
}
}
diff --git a/driver/xf86-video-r128/src/r128_driver.c b/driver/xf86-video-r128/src/r128_driver.c
index 01052ae9e..0ea87c682 100644
--- a/driver/xf86-video-r128/src/r128_driver.c
+++ b/driver/xf86-video-r128/src/r128_driver.c
@@ -71,7 +71,7 @@
#include "r128_reg.h"
#include "r128_version.h"
-#ifdef XF86DRI
+#ifdef R128DRI
#define _XF86DRI_SERVER_
#include "r128_dri.h"
#include "r128_common.h"
@@ -133,7 +133,7 @@ typedef enum {
OPTION_SW_CURSOR,
OPTION_DAC_6BIT,
OPTION_DAC_8BIT,
-#ifdef XF86DRI
+#ifdef R128DRI
OPTION_XV_DMA,
OPTION_IS_PCI,
OPTION_CCE_PIO,
@@ -164,7 +164,7 @@ static const OptionInfoRec R128Options[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DAC_8BIT, "Dac8Bit", OPTV_BOOLEAN, {0}, TRUE },
-#ifdef XF86DRI
+#ifdef R128DRI
{ OPTION_XV_DMA, "DMAForXv", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_IS_PCI, "ForcePCIMode", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_CCE_PIO, "CCEPIOMode", OPTV_BOOLEAN, {0}, FALSE },
@@ -228,7 +228,7 @@ static Bool R128GetRec(ScrnInfoPtr pScrn)
static void R128FreeRec(ScrnInfoPtr pScrn)
{
if (!pScrn || !pScrn->driverPrivate) return;
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -506,9 +506,9 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
#ifdef XSERVER_LIBPCIACCESS
int size = info->PciInfo->rom_size > R128_VBIOS_SIZE ? info->PciInfo->rom_size : R128_VBIOS_SIZE;
- info->VBIOS = xalloc(size);
+ info->VBIOS = malloc(size);
#else
- info->VBIOS = xalloc(R128_VBIOS_SIZE);
+ info->VBIOS = malloc(R128_VBIOS_SIZE);
#endif
if (!info->VBIOS) {
@@ -541,7 +541,7 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
}
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
info->BIOSAddr = 0x00000000;
- xfree(info->VBIOS);
+ free(info->VBIOS);
info->VBIOS = NULL;
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Video BIOS not found!\n");
@@ -938,14 +938,6 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
/* BIOS */
from = X_PROBED;
info->BIOSAddr = info->PciInfo->biosBase & 0xfffe0000;
- if (dev->BiosBase) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "BIOS address override, using 0x%08lx instead of 0x%08lx\n",
- dev->BiosBase,
- info->BIOSAddr);
- info->BIOSAddr = dev->BiosBase;
- from = X_CONFIG;
- }
if (info->BIOSAddr) {
xf86DrvMsg(pScrn->scrnIndex, from,
"BIOS at 0x%08lx\n", info->BIOSAddr);
@@ -1183,7 +1175,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
}
}
-#ifdef XF86DRI
+#ifdef R128DRI
/* DMA for Xv */
info->DMAForXv = xf86ReturnOptValBool(info->Options, OPTION_XV_DMA, FALSE);
if (info->DMAForXv) {
@@ -1527,7 +1519,7 @@ static void R128SetSyncRangeFromEdid(ScrnInfoPtr pScrn, int flag)
}
/***********
- xfree's xf86ValidateModes routine deosn't work well with DFPs
+ free's xf86ValidateModes routine deosn't work well with DFPs
here is our own validation routine. All modes between
640<=XRes<=MaxRes and 480<=YRes<=MaxYRes will be permitted.
NOTE: RageProII doesn't support rmx, can only work with the
@@ -1761,17 +1753,6 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn)
return TRUE;
}
-/* This is called by R128PreInit to initialize hardware acceleration. */
-static Bool R128PreInitAccel(ScrnInfoPtr pScrn)
-{
- R128InfoPtr info = R128PTR(pScrn);
-
- if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
- if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE;
- }
- return TRUE;
-}
-
static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
{
R128InfoPtr info = R128PTR(pScrn);
@@ -1785,7 +1766,7 @@ static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
return TRUE;
}
-#ifdef XF86DRI
+#ifdef R128DRI
static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
{
R128InfoPtr info = R128PTR(pScrn);
@@ -1995,7 +1976,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
/* We can't do this until we have a
pScrn->display. */
xf86CollectOptions(pScrn, NULL);
- if (!(info->Options = xalloc(sizeof(R128Options)))) goto fail;
+ if (!(info->Options = malloc(sizeof(R128Options)))) goto fail;
memcpy(info->Options, R128Options, sizeof(R128Options));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
@@ -2021,8 +2002,10 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
} else
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VGAAccess option set to FALSE,"
" VGA module load skipped\n");
- if (info->VGAAccess)
+ if (info->VGAAccess) {
+ vgaHWSetStdFuncs(VGAHWPTR(pScrn));
vgaHWGetIOBase(VGAHWPTR(pScrn));
+ }
#else
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VGAHW support not compiled, VGA "
"module load skipped\n");
@@ -2082,15 +2065,13 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
if (!R128PreInitCursor(pScrn)) goto fail;
- if (!R128PreInitAccel(pScrn)) goto fail;
-
-#ifdef XF86DRI
+#ifdef R128DRI
if (!R128PreInitDRI(pScrn)) goto fail;
#endif
/* Free the video bios (if applicable) */
if (info->VBIOS) {
- xfree(info->VBIOS);
+ free(info->VBIOS);
info->VBIOS = NULL;
}
@@ -2109,7 +2090,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
/* Free the video bios (if applicable) */
if (info->VBIOS) {
- xfree(info->VBIOS);
+ free(info->VBIOS);
info->VBIOS = NULL;
}
@@ -2190,7 +2171,7 @@ R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
ScrnInfoPtr pScrn = xf86Screens[i];
R128InfoPtr info = R128PTR(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled)
FLUSH_RING();
#endif
@@ -2212,10 +2193,11 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
R128InfoPtr info = R128PTR(pScrn);
BoxRec MemBox;
int y2;
+ Bool noAccel;
R128TRACE(("R128ScreenInit %x %d\n", pScrn->memPhysBase, pScrn->fbOffset));
-#ifdef XF86DRI
+#ifdef R128DRI
/* Turn off the CCE for now. */
info->CCEInUse = FALSE;
info->indirectBuffer = NULL;
@@ -2224,7 +2206,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
if (!R128MapMem(pScrn)) return FALSE;
pScrn->fbOffset = 0;
if(info->IsSecondary) pScrn->fbOffset = pScrn->videoRam * 1024;
-#ifdef XF86DRI
+#ifdef R128DRI
info->fbX = 0;
info->fbY = 0;
info->frontOffset = 0;
@@ -2251,7 +2233,9 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
pScrn->defaultVisual)) return FALSE;
miSetPixmapDepths ();
-#ifdef XF86DRI
+ noAccel = xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE);
+
+#ifdef R128DRI
/* Setup DRI after visuals have been
established, but before fbScreenInit is
called. fbScreenInit will eventually
@@ -2265,7 +2249,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
info->CurrentLayout.pixel_bytes);
int maxy = info->FbMapSize / width_bytes;
- if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
+ if (noAccel) {
xf86DrvMsg(scrnIndex, X_WARNING,
"Acceleration disabled, not initializing the DRI\n");
info->directRenderingEnabled = FALSE;
@@ -2336,7 +2320,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
fbPictureInit (pScreen, 0, 0);
/* Memory manager setup */
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
FBAreaPtr fbarea;
int width_bytes = (pScrn->displayWidth *
@@ -2549,7 +2533,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
}
/* Acceleration setup */
- if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
+ if (!noAccel) {
if (R128AccelInit(pScreen)) {
xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
@@ -2638,7 +2622,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen,
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
-#ifdef XF86DRI
+#ifdef R128DRI
/* DRI finalization */
if (info->directRenderingEnabled) {
/* Now that mi, fb, drm and others have
@@ -3368,7 +3352,7 @@ static void R128InitCommonRegisters(R128SavePtr save, R128InfoPtr info)
save->subpic_cntl = 0;
save->viph_control = 0;
save->i2c_cntl_1 = 0;
-#ifdef XF86DRI
+#ifdef R128DRI
save->gen_int_cntl = info->gen_int_cntl;
#else
save->gen_int_cntl = 0;
@@ -4251,7 +4235,7 @@ Bool R128EnterVT(int scrnIndex, int flags)
if (info->accelOn)
R128EngineInit(pScrn);
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
if (info->irq) {
/* Need to make sure interrupts are enabled */
@@ -4278,7 +4262,7 @@ void R128LeaveVT(int scrnIndex, int flags)
R128SavePtr save = &info->ModeReg;
R128TRACE(("R128LeaveVT\n"));
-#ifdef XF86DRI
+#ifdef R128DRI
if (info->directRenderingEnabled) {
DRILock(pScrn->pScreen, 0);
R128CCE_STOP(pScrn, info);
@@ -4303,7 +4287,7 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen)
R128TRACE(("R128CloseScreen\n"));
-#ifdef XF86DRI
+#ifdef R128DRI
/* Disable direct rendering */
if (info->directRenderingEnabled) {
R128DRICloseScreen(pScreen);
@@ -4319,17 +4303,17 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen)
if (info->accel) XAADestroyInfoRec(info->accel);
info->accel = NULL;
- if (info->scratch_save) xfree(info->scratch_save);
+ if (info->scratch_save) free(info->scratch_save);
info->scratch_save = NULL;
if (info->cursor) xf86DestroyCursorInfoRec(info->cursor);
info->cursor = NULL;
- if (info->DGAModes) xfree(info->DGAModes);
+ if (info->DGAModes) free(info->DGAModes);
info->DGAModes = NULL;
if (info->adaptor) {
- xfree(info->adaptor->pPortPrivates[0].ptr);
+ free(info->adaptor->pPortPrivates[0].ptr);
xf86XVFreeVideoAdaptorRec(info->adaptor);
info->adaptor = NULL;
}
diff --git a/driver/xf86-video-r128/src/r128_probe.c b/driver/xf86-video-r128/src/r128_probe.c
index 412da9244..0477617e6 100644
--- a/driver/xf86-video-r128/src/r128_probe.c
+++ b/driver/xf86-video-r128/src/r128_probe.c
@@ -298,7 +298,7 @@ r128_get_scrninfo(int entity_num)
instance++;
}
- xfree(pEnt);
+ free(pEnt);
return TRUE;
}
@@ -340,8 +340,8 @@ R128Probe(DriverPtr drv, int flags)
foundScreen = TRUE;
}
- xfree(usedChips);
- xfree(devSections);
+ free(usedChips);
+ free(devSections);
return foundScreen;
}
diff --git a/driver/xf86-video-r128/src/r128_video.c b/driver/xf86-video-r128/src/r128_video.c
index 8e833235f..11bb9bdc4 100644
--- a/driver/xf86-video-r128/src/r128_video.c
+++ b/driver/xf86-video-r128/src/r128_video.c
@@ -8,7 +8,7 @@
#include "r128.h"
#include "r128_reg.h"
-#ifdef XF86DRI
+#ifdef R128DRI
#include "r128_common.h"
#include "r128_sarea.h"
#endif
@@ -95,7 +95,7 @@ void R128InitVideo(ScreenPtr pScreen)
adaptors = &newAdaptor;
} else {
newAdaptors = /* need to free this someplace */
- xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+ malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
if(newAdaptors) {
memcpy(newAdaptors, adaptors, num_adaptors *
sizeof(XF86VideoAdaptorPtr));
@@ -110,7 +110,7 @@ void R128InitVideo(ScreenPtr pScreen)
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
if(newAdaptors)
- xfree(newAdaptors);
+ free(newAdaptors);
}
#define MAXWIDTH 2048
@@ -188,9 +188,9 @@ R128AllocAdaptor(ScrnInfoPtr pScrn)
if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
return NULL;
- if(!(pPriv = xcalloc(1, sizeof(R128PortPrivRec) + sizeof(DevUnion))))
+ if(!(pPriv = calloc(1, sizeof(R128PortPrivRec) + sizeof(DevUnion))))
{
- xfree(adapt);
+ free(adapt);
return NULL;
}
@@ -392,7 +392,7 @@ R128DMA(
int w
){
-#ifdef XF86DRI
+#ifdef R128DRI
#define BUFSIZE (R128_BUFFER_SIZE - R128_HOSTDATA_BLIT_OFFSET)
#define MAXPASSES (MAXHEIGHT/(BUFSIZE/(MAXWIDTH*2))+1)
@@ -481,10 +481,10 @@ R128DMA(
#else
- /* This is to avoid cluttering the rest of the code with '#ifdef XF86DRI' */
+ /* This is to avoid cluttering the rest of the code with '#ifdef R128DRI' */
return FALSE;
-#endif /* XF86DRI */
+#endif /* R128DRI */
}