|
|
454f128 |
diff -up xf86-video-ati-6.7.196/src/r128_driver.c.jx xf86-video-ati-6.7.196/src/r128_driver.c
|
|
|
454f128 |
--- xf86-video-ati-6.7.196/src/r128_driver.c.jx 2007-08-22 23:00:48.000000000 -0400
|
|
|
454f128 |
+++ xf86-video-ati-6.7.196/src/r128_driver.c 2008-01-02 13:27:02.000000000 -0500
|
|
|
454f128 |
@@ -425,14 +425,21 @@ static Bool R128MapMMIO(ScrnInfoPtr pScr
|
|
|
454f128 |
if (info->FBDev) {
|
|
|
454f128 |
info->MMIO = fbdevHWMapMMIO(pScrn);
|
|
|
454f128 |
} else {
|
|
|
454f128 |
+#if defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
+ int err = pci_device_map_region(info->PciInfo, 2, TRUE);
|
|
|
454f128 |
+ if (err)
|
|
|
454f128 |
+ return FALSE;
|
|
|
454f128 |
+ info->MMIO = info->PciInfo->regions[2].memory;
|
|
|
454f128 |
+#else
|
|
|
454f128 |
info->MMIO = xf86MapPciMem(pScrn->scrnIndex,
|
|
|
454f128 |
VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
|
|
|
454f128 |
info->PciTag,
|
|
|
454f128 |
info->MMIOAddr,
|
|
|
454f128 |
R128_MMIOSIZE);
|
|
|
454f128 |
+ if (!info->MMIO) return FALSE;
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
}
|
|
|
454f128 |
|
|
|
454f128 |
- if (!info->MMIO) return FALSE;
|
|
|
454f128 |
return TRUE;
|
|
|
454f128 |
}
|
|
|
454f128 |
|
|
|
454f128 |
@@ -444,9 +451,13 @@ static Bool R128UnmapMMIO(ScrnInfoPtr pS
|
|
|
454f128 |
|
|
|
454f128 |
if (info->FBDev)
|
|
|
454f128 |
fbdevHWUnmapMMIO(pScrn);
|
|
|
454f128 |
- else {
|
|
|
454f128 |
+ else
|
|
|
454f128 |
+#if defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
+ pci_device_unmap_region(info->PciInfo, 2);
|
|
|
454f128 |
+#else
|
|
|
454f128 |
xf86UnMapVidMem(pScrn->scrnIndex, info->MMIO, R128_MMIOSIZE);
|
|
|
454f128 |
- }
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
+
|
|
|
454f128 |
info->MMIO = NULL;
|
|
|
454f128 |
return TRUE;
|
|
|
454f128 |
}
|
|
|
454f128 |
@@ -459,14 +470,21 @@ static Bool R128MapFB(ScrnInfoPtr pScrn)
|
|
|
454f128 |
if (info->FBDev) {
|
|
|
454f128 |
info->FB = fbdevHWMapVidmem(pScrn);
|
|
|
454f128 |
} else {
|
|
|
454f128 |
+#if defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
+ int err = pci_device_map_region(info->PciInfo, 0, TRUE);
|
|
|
454f128 |
+ if (err)
|
|
|
454f128 |
+ return FALSE;
|
|
|
454f128 |
+ info->FB = info->PciInfo->regions[0].memory;
|
|
|
454f128 |
+#else
|
|
|
454f128 |
info->FB = xf86MapPciMem(pScrn->scrnIndex,
|
|
|
454f128 |
VIDMEM_FRAMEBUFFER,
|
|
|
454f128 |
info->PciTag,
|
|
|
454f128 |
info->LinearAddr,
|
|
|
454f128 |
info->FbMapSize);
|
|
|
454f128 |
+ if (!info->FB) return FALSE;
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
}
|
|
|
454f128 |
|
|
|
454f128 |
- if (!info->FB) return FALSE;
|
|
|
454f128 |
return TRUE;
|
|
|
454f128 |
}
|
|
|
454f128 |
|
|
|
454f128 |
@@ -478,7 +496,11 @@ static Bool R128UnmapFB(ScrnInfoPtr pScr
|
|
|
454f128 |
if (info->FBDev)
|
|
|
454f128 |
fbdevHWUnmapVidmem(pScrn);
|
|
|
454f128 |
else
|
|
|
454f128 |
+#if defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
+ pci_device_unmap_region(info->PciInfo, 0);
|
|
|
454f128 |
+#else
|
|
|
454f128 |
xf86UnMapVidMem(pScrn->scrnIndex, info->FB, info->FbMapSize);
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
info->FB = NULL;
|
|
|
454f128 |
return TRUE;
|
|
|
454f128 |
}
|
|
|
454f128 |
@@ -650,6 +672,9 @@ static Bool R128GetBIOSParameters(ScrnIn
|
|
|
454f128 |
(void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr),
|
|
|
454f128 |
R128_VBIOS_SIZE);
|
|
|
454f128 |
} else {
|
|
|
454f128 |
+#if defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
+ pci_device_read_rom(info->PciInfo, info->VBIOS);
|
|
|
454f128 |
+#else
|
|
|
454f128 |
xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, R128_VBIOS_SIZE);
|
|
|
454f128 |
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
|
|
454f128 |
@@ -659,6 +684,7 @@ static Bool R128GetBIOSParameters(ScrnIn
|
|
|
454f128 |
info->BIOSAddr = 0x000c0000;
|
|
|
454f128 |
xf86ReadDomainMemory(info->PciTag, info->BIOSAddr, R128_VBIOS_SIZE, info->VBIOS);
|
|
|
454f128 |
}
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
}
|
|
|
454f128 |
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
|
|
|
454f128 |
info->BIOSAddr = 0x00000000;
|
|
|
454f128 |
@@ -997,7 +1023,7 @@ static Bool R128PreInitConfig(ScrnInfoPt
|
|
|
454f128 |
info->Chipset = dev->chipID;
|
|
|
454f128 |
from = X_CONFIG;
|
|
|
454f128 |
} else {
|
|
|
454f128 |
- info->Chipset = info->PciInfo->chipType;
|
|
|
454f128 |
+ info->Chipset = PCI_DEV_DEVICE_ID(info->PciInfo);
|
|
|
454f128 |
}
|
|
|
454f128 |
pScrn->chipset = (char *)xf86TokenToString(R128Chipsets, info->Chipset);
|
|
|
454f128 |
|
|
|
454f128 |
@@ -1021,7 +1047,7 @@ static Bool R128PreInitConfig(ScrnInfoPt
|
|
|
454f128 |
/* Framebuffer */
|
|
|
454f128 |
|
|
|
454f128 |
from = X_PROBED;
|
|
|
454f128 |
- info->LinearAddr = info->PciInfo->memBase[0] & 0xfc000000;
|
|
|
454f128 |
+ info->LinearAddr = PCI_REGION_BASE(0) & 0xfc000000;
|
|
|
454f128 |
pScrn->memPhysBase = info->LinearAddr;
|
|
|
454f128 |
if (dev->MemBase) {
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
|
|
454f128 |
@@ -1040,7 +1066,7 @@ static Bool R128PreInitConfig(ScrnInfoPt
|
|
|
454f128 |
|
|
|
454f128 |
/* MMIO registers */
|
|
|
454f128 |
from = X_PROBED;
|
|
|
454f128 |
- info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00;
|
|
|
454f128 |
+ info->MMIOAddr = PCI_REGION_BASE(2) & 0xffffff00;
|
|
|
454f128 |
if (dev->IOBase) {
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
|
|
454f128 |
"MMIO address override, using 0x%08lx instead of 0x%08lx\n",
|
|
|
454f128 |
@@ -1055,6 +1081,7 @@ static Bool R128PreInitConfig(ScrnInfoPt
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, from,
|
|
|
454f128 |
"MMIO registers at 0x%08lx\n", info->MMIOAddr);
|
|
|
454f128 |
|
|
|
454f128 |
+#if !defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
/* BIOS */
|
|
|
454f128 |
from = X_PROBED;
|
|
|
454f128 |
info->BIOSAddr = info->PciInfo->biosBase & 0xfffe0000;
|
|
|
454f128 |
@@ -1070,6 +1097,7 @@ static Bool R128PreInitConfig(ScrnInfoPt
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, from,
|
|
|
454f128 |
"BIOS at 0x%08lx\n", info->BIOSAddr);
|
|
|
454f128 |
}
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
|
|
|
454f128 |
/* Flat panel (part 1) */
|
|
|
454f128 |
if (xf86GetOptValBool(info->Options, OPTION_PROG_FP_REGS,
|
|
|
454f128 |
@@ -2101,6 +2129,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int
|
|
|
454f128 |
}
|
|
|
454f128 |
|
|
|
454f128 |
info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index);
|
|
|
454f128 |
+#if !defined(XSERVER_LIBPCIACCESS)
|
|
|
454f128 |
info->PciTag = pciTag(info->PciInfo->bus,
|
|
|
454f128 |
info->PciInfo->device,
|
|
|
454f128 |
info->PciInfo->func);
|
|
|
454f128 |
@@ -2110,6 +2139,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int
|
|
|
454f128 |
info->PciInfo->bus,
|
|
|
454f128 |
info->PciInfo->device,
|
|
|
454f128 |
info->PciInfo->func);
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
|
|
|
454f128 |
if (xf86RegisterResources(info->pEnt->index, 0, ResNone)) goto fail;
|
|
|
454f128 |
if (xf86SetOperatingState(resVga, info->pEnt->index, ResUnusedOpr)) goto fail;
|
|
|
454f128 |
diff -up xf86-video-ati-6.7.196/src/r128.h.jx xf86-video-ati-6.7.196/src/r128.h
|
|
|
454f128 |
--- xf86-video-ati-6.7.196/src/r128.h.jx 2007-08-21 20:09:50.000000000 -0400
|
|
|
454f128 |
+++ xf86-video-ati-6.7.196/src/r128.h 2008-01-02 13:20:22.000000000 -0500
|
|
|
454f128 |
@@ -37,6 +37,11 @@
|
|
|
454f128 |
#ifndef _R128_H_
|
|
|
454f128 |
#define _R128_H_
|
|
|
454f128 |
|
|
|
454f128 |
+#include "xorg-server.h"
|
|
|
454f128 |
+#ifdef XSERVER_LIBPCIACCESS
|
|
|
454f128 |
+#include <pciaccess.h>
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
+
|
|
|
454f128 |
#include <unistd.h>
|
|
|
454f128 |
#include "xf86str.h"
|
|
|
454f128 |
|
|
|
454f128 |
@@ -223,8 +228,14 @@ typedef enum
|
|
|
454f128 |
|
|
|
454f128 |
typedef struct {
|
|
|
454f128 |
EntityInfoPtr pEnt;
|
|
|
454f128 |
+#ifdef XSERVER_LIBPCIACCESS
|
|
|
454f128 |
+ struct pci_device *PciInfo;
|
|
|
454f128 |
+ int mmio_bar;
|
|
|
454f128 |
+ int fb_bar;
|
|
|
454f128 |
+#else
|
|
|
454f128 |
pciVideoPtr PciInfo;
|
|
|
454f128 |
PCITAG PciTag;
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
int Chipset;
|
|
|
454f128 |
Bool Primary;
|
|
|
454f128 |
|
|
|
454f128 |
diff -up xf86-video-ati-6.7.196/src/Makefile.am.jx xf86-video-ati-6.7.196/src/Makefile.am
|
|
|
454f128 |
--- xf86-video-ati-6.7.196/src/Makefile.am.jx 2008-01-02 13:15:51.000000000 -0500
|
|
|
454f128 |
+++ xf86-video-ati-6.7.196/src/Makefile.am 2008-01-02 13:15:51.000000000 -0500
|
|
|
454f128 |
@@ -99,16 +99,12 @@ atimisc_drv_la_SOURCES = \
|
|
|
454f128 |
atiload.c atimisc.c atimach64probe.c $(ATIMISC_CPIO_SOURCES) \
|
|
|
454f128 |
$(ATIMISC_DGA_SOURCES) $(ATIMISC_DRI_SRCS) $(ATIMISC_EXA_SOURCES)
|
|
|
454f128 |
|
|
|
454f128 |
-if XSERVER_LIBPCIACCESS
|
|
|
454f128 |
-# r128 has not been ported yet
|
|
|
454f128 |
-else
|
|
|
454f128 |
r128_drv_la_LTLIBRARIES = r128_drv.la
|
|
|
454f128 |
r128_drv_la_LDFLAGS = -module -avoid-version
|
|
|
454f128 |
r128_drv_ladir = @moduledir@/drivers
|
|
|
454f128 |
r128_drv_la_SOURCES = \
|
|
|
454f128 |
r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \
|
|
|
454f128 |
r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS)
|
|
|
454f128 |
-endif
|
|
|
454f128 |
|
|
|
454f128 |
radeon_drv_la_LTLIBRARIES = radeon_drv.la
|
|
|
454f128 |
radeon_drv_la_LDFLAGS = -module -avoid-version
|
|
|
454f128 |
diff -up xf86-video-ati-6.7.196/src/r128_dri.c.jx xf86-video-ati-6.7.196/src/r128_dri.c
|
|
|
454f128 |
--- xf86-video-ati-6.7.196/src/r128_dri.c.jx 2008-01-02 13:15:51.000000000 -0500
|
|
|
454f128 |
+++ xf86-video-ati-6.7.196/src/r128_dri.c 2008-01-02 13:28:27.000000000 -0500
|
|
|
454f128 |
@@ -470,8 +470,8 @@ static Bool R128DRIAgpInit(R128InfoPtr i
|
|
|
454f128 |
xf86DrvMsg(pScreen->myNum, X_INFO,
|
|
|
454f128 |
"[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",
|
|
|
454f128 |
mode, vendor, device,
|
|
|
454f128 |
- info->PciInfo->vendor,
|
|
|
454f128 |
- info->PciInfo->chipType);
|
|
|
454f128 |
+ PCI_DEV_VENDOR_ID(info->PciInfo),
|
|
|
454f128 |
+ PCI_DEV_DEVICE_ID(info->PciInfo));
|
|
|
454f128 |
|
|
|
454f128 |
if (drmAgpEnable(info->drmFD, mode) < 0) {
|
|
|
454f128 |
xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n");
|
|
|
454f128 |
@@ -910,9 +910,16 @@ static void R128DRIIrqInit(R128InfoPtr i
|
|
|
454f128 |
if (!info->irq) {
|
|
|
454f128 |
info->irq = drmGetInterruptFromBusID(
|
|
|
454f128 |
info->drmFD,
|
|
|
454f128 |
+#if XSERVER_LIBPCIACCESS
|
|
|
454f128 |
+ (info->PciInfo->domain << 8) | info->PciInfo->bus,
|
|
|
454f128 |
+ info->PciInfo->dev,
|
|
|
454f128 |
+ info->PciInfo->func
|
|
|
454f128 |
+#else
|
|
|
454f128 |
((pciConfigPtr)info->PciInfo->thisCard)->busnum,
|
|
|
454f128 |
((pciConfigPtr)info->PciInfo->thisCard)->devnum,
|
|
|
454f128 |
- ((pciConfigPtr)info->PciInfo->thisCard)->funcnum);
|
|
|
454f128 |
+ ((pciConfigPtr)info->PciInfo->thisCard)->funcnum
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
+ );
|
|
|
454f128 |
|
|
|
454f128 |
if((drmCtlInstHandler(info->drmFD, info->irq)) != 0) {
|
|
|
454f128 |
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
|
|
454f128 |
@@ -1026,12 +1033,14 @@ Bool R128DRIScreenInit(ScreenPtr pScreen
|
|
|
454f128 |
if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
|
|
|
454f128 |
pDRIInfo->busIdString = DRICreatePCIBusID(info->PciInfo);
|
|
|
454f128 |
} else {
|
|
|
454f128 |
+#if !defined XSERVER_LIBPCIACCESS
|
|
|
454f128 |
pDRIInfo->busIdString = xalloc(64);
|
|
|
454f128 |
sprintf(pDRIInfo->busIdString,
|
|
|
454f128 |
"PCI:%d:%d:%d",
|
|
|
454f128 |
info->PciInfo->bus,
|
|
|
454f128 |
info->PciInfo->device,
|
|
|
454f128 |
info->PciInfo->func);
|
|
|
454f128 |
+#endif
|
|
|
454f128 |
}
|
|
|
454f128 |
pDRIInfo->ddxDriverMajorVersion = R128_VERSION_MAJOR;
|
|
|
454f128 |
pDRIInfo->ddxDriverMinorVersion = R128_VERSION_MINOR;
|