From eee8fd4c489a693344da0bba14cfa54c54610b89 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 9 Mar 2017 13:31:34 +0200 Subject: [PATCH] Fix build against xorg server 1.17 on certain architectures Fixes at least arm64, likely also hppa, m68k, sh4. Signed-off-by: Maarten Lankhorst --- src/regsmi.h | 18 ++++++++++++++++++ src/smi.h | 2 ++ src/smi_driver.c | 19 +++++++++---------- src/smilynx_crtc.c | 6 +++--- src/smilynx_hw.c | 5 ++--- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/regsmi.h b/src/regsmi.h index 5dd0320..69205ba 100644 --- a/src/regsmi.h +++ b/src/regsmi.h @@ -64,8 +64,13 @@ VGAIN8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index) MMIO_OUT8(pSmi->IOBase, indexPort, index); return(MMIO_IN8(pSmi->IOBase, dataPort)); } else { +#ifdef XSERVER_LIBPCIACCESS + pci_io_write8(pSmi->io, indexPort, index); + return pci_io_read8(pSmi->io, dataPort); +#else outb(pSmi->PIOBase + indexPort, index); return(inb(pSmi->PIOBase + dataPort)); +#endif } } @@ -76,8 +81,13 @@ VGAOUT8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index, CARD8 data) MMIO_OUT8(pSmi->IOBase, indexPort, index); MMIO_OUT8(pSmi->IOBase, dataPort, data); } else { +#ifdef XSERVER_LIBPCIACCESS + pci_io_write8(pSmi->io, indexPort, index); + pci_io_write8(pSmi->io, dataPort, data); +#else outb(pSmi->PIOBase + indexPort, index); outb(pSmi->PIOBase + dataPort, data); +#endif } } @@ -87,7 +97,11 @@ VGAIN8(SMIPtr pSmi, int port) if (pSmi->IOBase) { return(MMIO_IN8(pSmi->IOBase, port)); } else { +#ifdef XSERVER_LIBPCIACCESS + return pci_io_read8(pSmi->io, port); +#else return(inb(pSmi->PIOBase + port)); +#endif } } @@ -97,7 +111,11 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data) if (pSmi->IOBase) { MMIO_OUT8(pSmi->IOBase, port, data); } else { +#ifdef XSERVER_LIBPCIACCESS + pci_io_write8(pSmi->io, port, data); +#else outb(pSmi->PIOBase + port, data); +#endif } } diff --git a/src/smi.h b/src/smi.h index 2742c8d..1f20a2d 100644 --- a/src/smi.h +++ b/src/smi.h @@ -171,6 +171,8 @@ typedef struct pciVideoPtr PciInfo; /* PCI info vars */ #ifndef XSERVER_LIBPCIACCESS PCITAG PciTag; +#else + struct pci_io_handle *io; #endif int Chipset; /* Chip info, set using PCI above */ diff --git a/src/smi_driver.c b/src/smi_driver.c index 8949cae..6bdf64d 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -446,6 +446,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->PIOBase = hwp->PIOOffset; #else pSmi->PIOBase = 0; +#ifdef XSERVER_LIBPCIACCESS + pSmi->io = hwp->io; +#endif #endif xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, " @@ -2022,16 +2025,14 @@ SMI_EnableMmio(ScrnInfoPtr pScrn) vgaHWSetStdFuncs(hwp); 2019-01-31