Commit 73c469a9 authored by Natanael Copa's avatar Natanael Copa

testing/xf86-video-xgi: new aport

X.org XGI video driver
http://xorg.freedesktop.org/

ref #956
parent 1f5ce2f3
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-xgi
pkgver=1.6.0
pkgrel=0
pkgdesc="X.org XGI video driver"
url="http://xorg.freedesktop.org/"
arch="all"
license="custom"
subpackages="$pkgname-doc"
depends=
makedepends="xorg-server-dev libdrm-dev xf86driproto glproto mesa-dev
xf86dgaproto"
source="http://xorg.freedesktop.org/releases/individual/driver/$pkgname-$pkgver.tar.bz2
git-fixes.patch"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
./configure --prefix=/usr || return 1
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
rm "$pkgdir"/usr/lib/xorg/modules/drivers/*.la || return 1
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
md5sums="b4ac771ae81b52fca9b6fa68006a258a xf86-video-xgi-1.6.0.tar.bz2
bc49f5c3e77eb6355d330a34e1640bca git-fixes.patch"
diff --git a/man/xgi.man b/man/xgi.man
index 19880f2..5699ae4 100644
--- a/man/xgi.man
+++ b/man/xgi.man
@@ -1,4 +1,3 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/xgi.man,v 1.14 2003/11/12 16:50:36 twini Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH XGI __drivermansuffix__ __vendorversion__
diff --git a/src/vb_init.c b/src/vb_init.c
index 8338410..50980c4 100755
--- a/src/vb_init.c
+++ b/src/vb_init.c
@@ -131,6 +131,8 @@ static void XGINew_SetDRAMDefaultRegister340(PXGI_HW_DEVICE_INFO, USHORT,
static void XGINew_SetDRAMDefaultRegisterXG45(PXGI_HW_DEVICE_INFO, USHORT,
PVB_DEVICE_INFO);
static UCHAR XGINew_Get340DRAMType(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO);
+/* horrible */
+#define XGINew_GetXG20DRAMType XGINew_Get340DRAMType
static int XGINew_SetDDRChannel(int index, UCHAR ChannelNo,
UCHAR XGINew_ChannelAB, const USHORT DRAMTYPE_TABLE[][5],
@@ -1451,7 +1453,7 @@ void XGINew_SetDRAMDefaultRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ,
}
temp3 = 0 ;
- for( k = 0 ; k < 4 ; k++ )
+ for( k = 1 ; k < 4 ; k++ )
{
XGI_SetRegANDOR((XGIIOADDRESS) P3d4 , 0x6E , 0xFC , temp3 ) ; /* CR6E_D[1:0] select channel */
temp2 = 0 ;
diff --git a/src/vgatypes.h b/src/vgatypes.h
index 8a60927..7484661 100755
--- a/src/vgatypes.h
+++ b/src/vgatypes.h
@@ -1,5 +1,3 @@
-/* $XFree86$ */
-/* $XdotOrg$ */
/*
* General type definitions for universal mode switching modules
*
diff --git a/src/xgi.h b/src/xgi.h
index 715502f..e818631 100755
--- a/src/xgi.h
+++ b/src/xgi.h
@@ -981,6 +981,7 @@ int compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
void XGI_WaitBeginRetrace(XGIIOADDRESS RelIO);
void XGI_WaitEndRetrace(XGIIOADDRESS RelIO);
+#include <unistd.h>
/* 2005/11/21 added by jjtseng */
#define DelayS(sec) usleep((sec)*1000000)
#define DelayMS(millisec) usleep((millisec)*1000)
diff --git a/src/xgi_accel.c b/src/xgi_accel.c
index c072691..4c298ed 100755
--- a/src/xgi_accel.c
+++ b/src/xgi_accel.c
@@ -200,20 +200,7 @@ extern int FbDevExist;
#endif
#if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32 BE_SWAP32 (CARD32 val)
-{
- PDEBUG(ErrorF("X_BIG_ENDIAN...\n"));
- if (CurrentColorDepth == 8)
- return ((((val) & 0x000000ff) << 24) | \
- (((val) & 0x0000ff00) << 8) | \
- (((val) & 0x00ff0000) >> 8) | \
- (((val) & 0xff000000) >> 24));
- if (CurrentColorDepth == 24)
- return val;
- if (CurrentColorDepth == 16)
- return ((((val) & 0x0000ffff) << 16) | \
- (((val) & 0xffff0000) >> 16));
-}
+#define BE_SWAP32(x) lswapl(x)
#else
static CARD32 BE_SWAP32 (CARD32 val)
{
diff --git a/src/xgi_dga.c b/src/xgi_dga.c
index 04f90aa..8bd84bc 100755
--- a/src/xgi_dga.c
+++ b/src/xgi_dga.c
@@ -103,18 +103,18 @@ XGISetupDGAMode(
if(pMode->HDisplay != otherPitch) {
- newmodes = xrealloc(modes, (*num + 2) * sizeof(DGAModeRec));
+ newmodes = realloc(modes, (*num + 2) * sizeof(DGAModeRec));
oneMore = TRUE;
} else {
- newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec));
+ newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec));
oneMore = FALSE;
}
if(!newmodes) {
- xfree(modes);
+ free(modes);
return NULL;
}
modes = newmodes;
diff --git a/src/xgi_dri.c b/src/xgi_dri.c
index 93687e1..e575c19 100755
--- a/src/xgi_dri.c
+++ b/src/xgi_dri.c
@@ -46,7 +46,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Priv.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
@@ -145,13 +144,13 @@ XGIInitVisualConfigs(ScreenPtr pScreen)
}
if (!(pXGIConfigs = (XGIConfigPrivPtr)xnfcalloc(sizeof(XGIConfigPrivRec),
numConfigs))) {
- xfree(pConfigs);
+ free(pConfigs);
return FALSE;
}
if (!(pXGIConfigPtrs = (XGIConfigPrivPtr*)xnfcalloc(sizeof(XGIConfigPrivPtr),
numConfigs))) {
- xfree(pConfigs);
- xfree(pXGIConfigs);
+ free(pConfigs);
+ free(pXGIConfigs);
return FALSE;
}
for (i=0; i<numConfigs; i++)
@@ -333,7 +332,7 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
if (!DRIScreenInit(pScreen, pDRIInfo, &pXGI->drmSubFD)) {
- xfree(pDRIInfo->devPrivate);
+ free(pDRIInfo->devPrivate);
pDRIInfo->devPrivate=0;
DRIDestroyInfoRec(pXGI->pDRIInfo);
pXGI->pDRIInfo=0;
@@ -537,14 +536,14 @@ XGIDRICloseScreen(ScreenPtr pScreen)
if (pXGI->pDRIInfo) {
if (pXGI->pDRIInfo->devPrivate) {
- xfree(pXGI->pDRIInfo->devPrivate);
+ free(pXGI->pDRIInfo->devPrivate);
pXGI->pDRIInfo->devPrivate=0;
}
DRIDestroyInfoRec(pXGI->pDRIInfo);
pXGI->pDRIInfo=0;
}
- if (pXGI->pVisualConfigs) xfree(pXGI->pVisualConfigs);
- if (pXGI->pVisualConfigsPriv) xfree(pXGI->pVisualConfigsPriv);
+ if (pXGI->pVisualConfigs) free(pXGI->pVisualConfigs);
+ if (pXGI->pVisualConfigsPriv) free(pXGI->pVisualConfigsPriv);
if(pXGI->agpSize){
/* ErrorF("Freeing agp memory\n"); */
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index b4f83b8..b8b8679 100755
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -54,7 +54,7 @@
#include "fb.h"
#include "micmap.h"
#include "xf86.h"
-#include "xf86Priv.h"
+#include "xf86Module.h"
#include "xf86_OSproc.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h"
@@ -106,6 +106,10 @@
#include <unistd.h>
#endif
+#ifndef DEFAULT_DPI
+#define DEFAULT_DPI 96
+#endif
+
/* Jong 01/22/2009; compiler error; type conflict */
/*
#include <fcntl.h>
@@ -556,13 +560,13 @@ XGIFreeRec(ScrnInfoPtr pScrn)
* head.
*/
if (pXGIEnt->BIOS)
- xfree(pXGIEnt->BIOS);
+ free(pXGIEnt->BIOS);
pXGIEnt->BIOS = pXGI->BIOS = NULL;
if (pXGIEnt->XGI_Pr)
- xfree(pXGIEnt->XGI_Pr);
+ free(pXGIEnt->XGI_Pr);
pXGIEnt->XGI_Pr = pXGI->XGI_Pr = NULL;
if (pXGIEnt->RenderAccelArray)
- xfree(pXGIEnt->RenderAccelArray);
+ free(pXGIEnt->RenderAccelArray);
pXGIEnt->RenderAccelArray = pXGI->RenderAccelArray = NULL;
}
else {
@@ -573,19 +577,19 @@ XGIFreeRec(ScrnInfoPtr pScrn)
}
else {
if (pXGI->BIOS)
- xfree(pXGI->BIOS);
+ free(pXGI->BIOS);
pXGI->BIOS = NULL;
if (pXGI->XGI_Pr)
- xfree(pXGI->XGI_Pr);
+ free(pXGI->XGI_Pr);
pXGI->XGI_Pr = NULL;
if (pXGI->RenderAccelArray)
- xfree(pXGI->RenderAccelArray);
+ free(pXGI->RenderAccelArray);
pXGI->RenderAccelArray = NULL;
}
#ifdef XGIMERGED
if (pXGI->MetaModes)
- xfree(pXGI->MetaModes);
+ free(pXGI->MetaModes);
pXGI->MetaModes = NULL;
if (pXGI->CRT1Modes) {
@@ -595,8 +599,8 @@ XGIFreeRec(ScrnInfoPtr pScrn)
do {
DisplayModePtr p = pScrn->currentMode->next;
if (pScrn->currentMode->Private)
- xfree(pScrn->currentMode->Private);
- xfree(pScrn->currentMode);
+ free(pScrn->currentMode->Private);
+ free(pScrn->currentMode);
pScrn->currentMode = p;
} while (pScrn->currentMode != pScrn->modes);
}
@@ -612,7 +616,7 @@ XGIFreeRec(ScrnInfoPtr pScrn)
pXGI->pVbe = NULL;
if (pScrn->driverPrivate == NULL)
return;
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -975,7 +979,7 @@ XGIProbe(DriverPtr drv, int flags)
numDevSections, drv, &usedChips);
/* Free it since we don't need that list after this */
- xfree(devSections);
+ free(devSections);
if (numUsed <= 0)
return FALSE;
@@ -1015,7 +1019,7 @@ XGIProbe(DriverPtr drv, int flags)
#endif
}
- xfree(usedChips);
+ free(usedChips);
return foundScreen;
}
@@ -1044,11 +1048,11 @@ XGICopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest,
ErrorF("XGICopyModeNLink()...Use Virtual Size-1\n");
- if (!((mode = xalloc(sizeof(DisplayModeRec)))))
+ if (!((mode = malloc(sizeof(DisplayModeRec)))))
return dest;
memcpy(mode, i, sizeof(DisplayModeRec));
- if (!((mode->Private = xalloc(sizeof(XGIMergedDisplayModeRec))))) {
- xfree(mode);
+ if (!((mode->Private = malloc(sizeof(XGIMergedDisplayModeRec))))) {
+ free(mode);
return dest;
}
((XGIMergedDisplayModePtr) mode->Private)->CRT1 = i;
@@ -1125,8 +1129,8 @@ XGICopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest,
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Skipped %dx%d, not enough video RAM or beyond hardware specs\n",
mode->HDisplay, mode->VDisplay);
- xfree(mode->Private);
- xfree(mode);
+ free(mode->Private);
+ free(mode);
return dest;
}
@@ -1559,10 +1563,10 @@ XGIFreeCRT2Structs(XGIPtr pXGI)
pXGI->CRT2pScrn->monitor->Modes);
}
if (pXGI->CRT2pScrn->monitor->DDC)
- xfree(pXGI->CRT2pScrn->monitor->DDC);
- xfree(pXGI->CRT2pScrn->monitor);
+ free(pXGI->CRT2pScrn->monitor->DDC);
+ free(pXGI->CRT2pScrn->monitor);
}
- xfree(pXGI->CRT2pScrn);
+ free(pXGI->CRT2pScrn);
pXGI->CRT2pScrn = NULL;
}
}
@@ -2438,7 +2442,7 @@ XGIDDCPreInit(ScrnInfoPtr pScrn)
#ifdef XGIMERGED
if (pXGI->MergedFB) {
- pXGI->CRT2pScrn->monitor = xalloc(sizeof(MonRec));
+ pXGI->CRT2pScrn->monitor = malloc(sizeof(MonRec));
if (pXGI->CRT2pScrn->monitor) {
DisplayModePtr tempm = NULL, currentm = NULL, newm = NULL;
memcpy(pXGI->CRT2pScrn->monitor, pScrn->monitor, sizeof(MonRec));
@@ -2446,11 +2450,11 @@ XGIDDCPreInit(ScrnInfoPtr pScrn)
pXGI->CRT2pScrn->monitor->Modes = NULL;
tempm = pScrn->monitor->Modes;
while (tempm) {
- if (!(newm = xalloc(sizeof(DisplayModeRec))))
+ if (!(newm = malloc(sizeof(DisplayModeRec))))
break;
memcpy(newm, tempm, sizeof(DisplayModeRec));
- if (!(newm->name = xalloc(strlen(tempm->name) + 1))) {
- xfree(newm);
+ if (!(newm->name = malloc(strlen(tempm->name) + 1))) {
+ free(newm);
break;
}
strcpy(newm->name, tempm->name);
@@ -2490,7 +2494,7 @@ XGIDDCPreInit(ScrnInfoPtr pScrn)
"Failed to allocate memory for CRT2 monitor, %s.\n",
mergeddisstr);
if (pXGI->CRT2pScrn)
- xfree(pXGI->CRT2pScrn);
+ free(pXGI->CRT2pScrn);
pXGI->CRT2pScrn = NULL;
pXGI->MergedFB = FALSE;
}
@@ -3540,7 +3544,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
/* Do some MergedFB mode initialisation */
#ifdef XGIMERGED
if (pXGI->MergedFB) {
- pXGI->CRT2pScrn = xalloc(sizeof(ScrnInfoRec));
+ pXGI->CRT2pScrn = malloc(sizeof(ScrnInfoRec));
if (!pXGI->CRT2pScrn) {
XGIErrorLog(pScrn,
"Failed to allocate memory for 2nd pScrn, %s\n",
@@ -3586,7 +3590,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
XGIErrorLog(pScrn, mergednocrt1, mergeddisstr);
}
if (pXGI->CRT2pScrn)
- xfree(pXGI->CRT2pScrn);
+ free(pXGI->CRT2pScrn);
pXGI->CRT2pScrn = NULL;
pXGI->MergedFB = FALSE;
}
@@ -3627,7 +3631,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
XGIErrorLog(pScrn, mergednocrt2, mergeddisstr);
}
if (pXGI->CRT2pScrn)
- xfree(pXGI->CRT2pScrn);
+ free(pXGI->CRT2pScrn);
pXGI->CRT2pScrn = NULL;
pXGI->MergedFB = FALSE;
}
@@ -4901,7 +4905,7 @@ XGIScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pXGI->ShadowFB) {
pXGI->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
- pXGI->ShadowPtr = xalloc(pXGI->ShadowPitch * height);
+ pXGI->ShadowPtr = malloc(pXGI->ShadowPitch * height);
displayWidth = pXGI->ShadowPitch / (pScrn->bitsPerPixel >> 3);
FBStart = pXGI->ShadowPtr;
}
@@ -5777,17 +5781,17 @@ XGICloseScreen(int scrnIndex, ScreenPtr pScreen)
}
if (pXGI->ShadowPtr) {
- xfree(pXGI->ShadowPtr);
+ free(pXGI->ShadowPtr);
pXGI->ShadowPtr = NULL;
}
if (pXGI->DGAModes) {
- xfree(pXGI->DGAModes);
+ free(pXGI->DGAModes);
pXGI->DGAModes = NULL;
}
if (pXGI->adaptor) {
- xfree(pXGI->adaptor);
+ free(pXGI->adaptor);
pXGI->adaptor = NULL;
pXGI->ResetXv = pXGI->ResetXvGamma = NULL;
}
diff --git a/src/xgi_opt.c b/src/xgi_opt.c
index 09346e4..c0608d5 100755
--- a/src/xgi_opt.c
+++ b/src/xgi_opt.c
@@ -195,7 +195,7 @@ xgiOptions(ScrnInfoPtr pScrn)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if(!(pXGI->Options = xalloc(sizeof(XGIOptions)))) return;
+ if(!(pXGI->Options = malloc(sizeof(XGIOptions)))) return;
memcpy(pXGI->Options, XGIOptions, sizeof(XGIOptions));
diff --git a/src/xgi_setup.c b/src/xgi_setup.c
index c1d2cdc..6641b09 100755
--- a/src/xgi_setup.c
+++ b/src/xgi_setup.c
@@ -678,7 +678,7 @@ bAccessVGAPCIInfo(PXGI_HW_DEVICE_INFO pHwDevInfo, ULONG ulOffset, ULONG ulSet, U
err = pci_device_cfg_write_u32(pXGI->PciInfo, *pulValue,
ulOffset & ~3);
} else {
- err = pci_device_cfg_write_u32(pXGI->PciInfo, pulValue,
+ err = pci_device_cfg_read_u32(pXGI->PciInfo, pulValue,
ulOffset & ~3);
}
diff --git a/src/xgi_video.c b/src/xgi_video.c
index 31cffd5..df76d14 100755
--- a/src/xgi_video.c
+++ b/src/xgi_video.c
@@ -142,7 +142,7 @@ void XGIInitVideo(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));
@@ -157,7 +157,7 @@ void XGIInitVideo(ScreenPtr pScreen)
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
if(newAdaptors)
- xfree(newAdaptors);
+ free(newAdaptors);
}
@@ -395,7 +395,7 @@ XGISetupImageVideo(ScreenPtr pScreen)
struct v4l2_standard standard;
# endif//VC
- if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+ if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
sizeof(XGIPortPrivRec) +
sizeof(DevUnion))))
return NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment