summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2015-08-23 17:43:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2015-08-23 17:43:12 +0000
commit2635a8ab63a9cca6997365347b274ff3487e8192 (patch)
tree9b4801d283236d61ebfd5102c4e9da3715830278 /driver
parentee67b35b3de37f1851735d1bce03d226936e69cf (diff)
Merge from upstreams in preparation for xserver 1.17
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-rendition/src/rendition.c20
-rw-r--r--driver/xf86-video-rendition/src/rendition.h7
-rw-r--r--driver/xf86-video-sis/src/sis.h2
-rw-r--r--driver/xf86-video-sis/src/sis_driver.c11
-rw-r--r--driver/xf86-video-sis/src/vstruct.h2
5 files changed, 31 insertions, 11 deletions
diff --git a/driver/xf86-video-rendition/src/rendition.c b/driver/xf86-video-rendition/src/rendition.c
index 888bb4ac1..967785089 100644
--- a/driver/xf86-video-rendition/src/rendition.c
+++ b/driver/xf86-video-rendition/src/rendition.c
@@ -1371,6 +1371,18 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
/* Override on users request */
WriteCombine
= xf86ReturnOptValBool(pRendition->Options, OPTION_FBWC, WriteCombine);
+#ifdef XSERVER_LIBPCIACCESS
+ mapOption = PCI_DEV_MAP_FLAG_WRITABLE;
+ if (WriteCombine)
+ mapOption |= PCI_DEV_MAP_FLAG_WRITE_COMBINE;
+
+ err = pci_device_map_range(pRendition->PciInfo,
+ pRendition->PciInfo->regions[0].base_addr,
+ pRendition->PciInfo->regions[0].size,
+ mapOption, (void *)&pRendition->board.vmem_base);
+
+ return (err == 0);
+#else
if (WriteCombine) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
("Requesting Write-Combined memory access\n"));
@@ -1381,12 +1393,6 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
mapOption = VIDMEM_MMIO;
}
-#ifdef XSERVER_LIBPCIACCESS
- err = pci_device_map_region(pRendition->PciInfo, 0, TRUE);
- pRendition->board.vmem_base = pRendition->PciInfo->regions[0].memory;
-
- return (err == 0);
-#else
pRendition->board.vmem_base=
xf86MapPciMem(pScreenInfo->scrnIndex, mapOption,
pRendition->pcitag,
@@ -1415,7 +1421,7 @@ renditionUnmapMem(ScrnInfoPtr pScreenInfo)
#else
pci_device_unmap_range(pRendition->PciInfo,
pRendition->board.vmem_base,
- pScreenInfo->videoRam * 1024);
+ pRendition->PciInfo->regions[0].size);
#endif
return TRUE;
#ifdef DEBUG0
diff --git a/driver/xf86-video-rendition/src/rendition.h b/driver/xf86-video-rendition/src/rendition.h
index 297117eeb..4ef03a7bc 100644
--- a/driver/xf86-video-rendition/src/rendition.h
+++ b/driver/xf86-video-rendition/src/rendition.h
@@ -14,9 +14,6 @@
/* Everything using inb/outb, etc needs "compiler.h" */
#include "compiler.h"
-/* Drivers for PCI hardware need this */
-#include "xf86PciInfo.h"
-
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
@@ -66,4 +63,8 @@
#include "compat-api.h"
/* end of __RENDITION_H__ */
+
+#define PCI_CHIP_V1000 0x0001
+#define PCI_CHIP_V2x00 0x2000
+
#endif
diff --git a/driver/xf86-video-sis/src/sis.h b/driver/xf86-video-sis/src/sis.h
index 46fca2a93..05f10e9d4 100644
--- a/driver/xf86-video-sis/src/sis.h
+++ b/driver/xf86-video-sis/src/sis.h
@@ -1005,7 +1005,9 @@ typedef struct {
ScrnInfoPtr pScrn;
pciVideoPtr PciInfo;
int PciBus, PciDevice, PciFunc;
+#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
+#endif
EntityInfoPtr pEnt;
int Chipset;
unsigned char ChipType;
diff --git a/driver/xf86-video-sis/src/sis_driver.c b/driver/xf86-video-sis/src/sis_driver.c
index 73779af75..9f40cae8b 100644
--- a/driver/xf86-video-sis/src/sis_driver.c
+++ b/driver/xf86-video-sis/src/sis_driver.c
@@ -3275,10 +3275,11 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
pSiS->PciDevice = PCI_CFG_DEV(pSiS->PciInfo); /*SIS_PCI_DEVICE(pSiS->PciInfo);*/
pSiS->PciFunc = PCI_CFG_FUNC(pSiS->PciInfo); /*SIS_PCI_FUNC(pSiS->PciInfo);*/
+#ifndef XSERVER_LIBPCIACCESS
pSiS->PciTag = pciTag(PCI_DEV_BUS(pSiS->PciInfo),
PCI_DEV_DEV(pSiS->PciInfo),
PCI_DEV_FUNC(pSiS->PciInfo));
-
+#endif
#ifdef SIS_NEED_MAP_IOP
/********************************************/
/* THIS IS BROKEN AND WON'T WORK */
@@ -3901,7 +3902,9 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
if(pSiSEnt) pSiSEnt->SiS_Pr = pSiS->SiS_Pr;
#endif
memset(pSiS->SiS_Pr, 0, sizeof(struct SiS_Private));
+#ifndef XSERVER_LIBPCIACCESS
pSiS->SiS_Pr->PciTag = pSiS->PciTag;
+#endif
pSiS->SiS_Pr->ChipType = pSiS->ChipType;
pSiS->SiS_Pr->ChipRevision = pSiS->ChipRev;
pSiS->SiS_Pr->SiS_Backup70xx = 0xff;
@@ -7130,7 +7133,9 @@ static Bool
SISMapMem(ScrnInfoPtr pScrn)
{
SISPtr pSiS = SISPTR(pScrn);
+#ifndef XSERVER_LIBPCIACCESS
int mmioFlags = VIDMEM_MMIO;
+#endif
#ifdef SISDUALHEAD
SISEntPtr pSiSEnt = pSiS->entityPrivate;
#endif
@@ -7141,8 +7146,10 @@ SISMapMem(ScrnInfoPtr pScrn)
* byte/short access.)
*/
#if defined(__alpha__)
+#ifndef XSERVER_LIBPCIACCESS
mmioFlags |= VIDMEM_SPARSE;
#endif
+#endif
#ifdef SISDUALHEAD
if(pSiS->DualHeadMode) {
@@ -13993,6 +14000,7 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value)
break;
}
+#ifndef XSERVER_LIBPCIACCESS
#ifdef SIS_USE_BIOS_SCRATCH
if(SISPTR(pScrn)->Primary) {
base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, 0, 0x2000);
@@ -14011,6 +14019,7 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value)
xf86UnMapVidMem(pScrn->scrnIndex, base, 0x2000);
}
#endif
+#endif
return ret;
}
diff --git a/driver/xf86-video-sis/src/vstruct.h b/driver/xf86-video-sis/src/vstruct.h
index 88f7eb659..5d7a98d49 100644
--- a/driver/xf86-video-sis/src/vstruct.h
+++ b/driver/xf86-video-sis/src/vstruct.h
@@ -237,8 +237,10 @@ struct SiS_Private
unsigned char ChipType;
unsigned char ChipRevision;
#ifdef SIS_XORG_XF86
+#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
#endif
+#endif
#ifdef SIS_LINUX_KERNEL
void *ivideo;
#endif