community/xf86-video-nv: upgrade to 2.1.23

This commit is contained in:
mio 2024-09-10 14:32:26 +00:00 committed by Natanael Copa
parent c87c90aaf4
commit ddaa55f760
2 changed files with 4 additions and 358 deletions

View File

@ -1,16 +1,14 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-nv
pkgver=2.1.22
pkgrel=3
pkgver=2.1.23
pkgrel=0
pkgdesc="Nvidia video driver"
url="https://xorg.freedesktop.org"
arch="all"
license="MIT"
subpackages="$pkgname-doc"
makedepends="xorg-server-dev libxi-dev util-macros xorgproto"
source="https://www.x.org/releases/individual/driver/xf86-video-nv-$pkgver.tar.xz
fix-old-cpp-macros.patch
"
source="https://www.x.org/releases/individual/driver/xf86-video-nv-$pkgver.tar.xz"
build() {
export CFLAGS="${CFLAGS/-fno-plt}"
@ -33,6 +31,5 @@ package() {
}
sha512sums="
a54767e9060404cafbb028ea36e582e8cfb7431a746cfc1d698c435fa73e41c4dfc12f84e50d002a582ac61e2d4c377f4defdf407250ee9e8656e5ff989b3cda xf86-video-nv-2.1.22.tar.xz
9d706c5535ddc22976d4e33f2e0ead79bf18356f71b6118f5beea0a48a6cd211a94e75b69bf1f8d91b33023fb877e4111ef8ae47e6a0a0a6f3bae8d9ba87d001 fix-old-cpp-macros.patch
ce09f37bd29bbe588a8788d643240c9b0324654ea37b8e7f0f127494999f24b3048ca0c7ea91b33ef94efd12b570bfb73c8a5e20bf63749b01cbdc5669136b9e xf86-video-nv-2.1.23.tar.xz
"

View File

@ -1,351 +0,0 @@
Upstream: no (Too lazy)
Reason: Fixes building the package by getting rid of old cpp macros
that are no longer accepted
diff --git a/src/g80_driver.c b/src/g80_driver.c
index 719b96c..3b8e55b 100644
--- a/src/g80_driver.c
+++ b/src/g80_driver.c
@@ -151,7 +151,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
{
G80Ptr pNv;
EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
struct pci_device *pPci;
int err;
void *p;
@@ -184,14 +184,14 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if(pEnt->location.type != BUS_PCI) goto fail;
pPci = xf86GetPciInfoForEntity(pEnt->index);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
/* Need this to unmap */
pNv->pPci = pPci;
#endif
primary = xf86IsPrimaryPci(pPci);
/* The ROM size sometimes isn't read correctly, so fix it up here. */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
if(pPci->rom_size == 0)
/* The BIOS is 64k */
pPci->rom_size = 64 * 1024;
@@ -304,7 +304,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
pScrn->memPhysBase = MEMBASE(pPci, 1);
pScrn->fbOffset = 0;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
err = pci_device_map_range(pPci, pPci->regions[0].base_addr, G80_REG_SIZE,
PCI_DEV_MAP_FLAG_WRITABLE, &p);
if(err) {
@@ -336,7 +336,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
/* Determine the size of BAR1 */
/* Some configs have BAR1 < total RAM < 256 MB */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
BAR1sizeKB = pPci->regions[1].size / 1024;
#else
BAR1sizeKB = 1UL << (pPci->size[1] - 10);
@@ -366,7 +366,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, " Mapped memory: %.1f MB\n",
pScrn->videoRam / 1024.0);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
err = pci_device_map_range(pPci, pPci->regions[1].base_addr,
pScrn->videoRam * 1024,
PCI_DEV_MAP_FLAG_WRITABLE |
@@ -521,7 +521,7 @@ G80CloseScreen(CLOSE_SCREEN_ARGS_DECL)
if(xf86ServerIsExiting()) {
if(pNv->int10) xf86FreeInt10(pNv->int10);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
pci_device_unmap_range(pNv->pPci, pNv->mem, pNv->videoRam * 1024);
pci_device_unmap_range(pNv->pPci, (void*)pNv->reg, G80_REG_SIZE);
#else
diff --git a/src/g80_type.h b/src/g80_type.h
index f4b73a3..5b1f975 100644
--- a/src/g80_type.h
+++ b/src/g80_type.h
@@ -41,7 +41,7 @@ typedef enum AccelMethod {
} AccelMethod;
typedef struct G80Rec {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
struct pci_device *pPci;
#endif
volatile CARD32 * reg;
diff --git a/src/nv_const.h b/src/nv_const.h
index 8f9799c..b0cc14f 100644
--- a/src/nv_const.h
+++ b/src/nv_const.h
@@ -6,7 +6,7 @@
#define NV_DRIVER_NAME "nv"
/* libpciaccess gratuitous API changes */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
#define MEMBASE(p,n) (p)->regions[n].base_addr
#define VENDOR_ID(p) (p)->vendor_id
#define DEVICE_ID(p) (p)->device_id
diff --git a/src/nv_dac.c b/src/nv_dac.c
index 2269ae3..8d79ed8 100644
--- a/src/nv_dac.c
+++ b/src/nv_dac.c
@@ -42,7 +42,7 @@ NVDACPanelTweaks(NVPtr pNv, NVRegPtr state)
we can do is experiment and apply hacks. */
if(((pNv->Chipset & 0xffff) == 0x0328) && (state->bpp == 32)) {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
if (((pNv->PciInfo->subvendor_id & 0xffff) == 0x1179) &&
((pNv->PciInfo->subdevice_id & 0xffff) == 0x0020))
#else
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 3a74038..cf185f8 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -43,7 +43,7 @@ Bool G80GetScrnInfoRec(PciChipsets *chips, int chip);
/* Mandatory functions */
static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
static void NVIdentify(int flags);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
static Bool NVPciProbe(DriverPtr, int entity, struct pci_device*, intptr_t data);
#else
static Bool NVProbe(DriverPtr drv, int flags);
@@ -76,7 +76,7 @@ static void NVRestore(ScrnInfoPtr pScrn);
static Bool NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
static Bool NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
/* For now, just match any NVIDIA display device and sort through them in the
* probe routine */
@@ -109,7 +109,7 @@ _X_EXPORT DriverRec NV = {
NV_VERSION,
NV_DRIVER_NAME,
NVIdentify,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
NULL,
#else
NVProbe,
@@ -118,7 +118,7 @@ _X_EXPORT DriverRec NV = {
NULL,
0,
NULL,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
NVPciIdMatchList,
NVPciProbe,
#endif
@@ -712,7 +712,7 @@ nvSetup(pointer module, pointer opts, int *errmaj, int *errmin)
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&NV, module,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
HaveDriverFuncs
#else
0
@@ -785,14 +785,14 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
static CARD32
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
NVGetPCIXpressChip (struct pci_device *dev)
#else
NVGetPCIXpressChip (pciVideoPtr pVideo)
#endif
{
volatile CARD32 *regs;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
uint32_t pciid, pcicmd;
void *tmp;
@@ -902,7 +902,7 @@ NVIsSupported(CARD32 id)
}
/* Mandatory */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
static Bool
NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data)
{
@@ -2097,7 +2097,7 @@ NVMapMem(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
void *tmp;
pci_device_map_range(pNv->PciInfo, pNv->FbAddress, pNv->FbMapSize,
@@ -2144,7 +2144,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
pNv = NVPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
pci_device_unmap_range(pNv->PciInfo, pNv->FbBase, pNv->FbMapSize);
#else
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pNv->FbBase, pNv->FbMapSize);
diff --git a/src/nv_hw.c b/src/nv_hw.c
index 9291912..90c7ac7 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -653,7 +653,7 @@ static void nv30UpdateArbitrationSettings (
*lwm = graphics_lwm >> 3;
}
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
static inline uint32_t
pciaccessReadLong(struct pci_device *const dev, pciaddr_t offset) {
uint32_t tmp;
@@ -670,7 +670,7 @@ static void nForceUpdateArbitrationSettings (
NVPtr pNv
)
{
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
struct pci_device *const dev1 = pci_device_find_by_slot(0, 0, 0, 1);
struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2);
struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3);
diff --git a/src/nv_setup.c b/src/nv_setup.c
index 92ca3ec..8c57675 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -287,7 +287,7 @@ static void nv10GetConfig (NVPtr pNv)
}
#endif
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
{
/* [AGP]: I don't know if this is correct */
struct pci_device *dev = pci_device_find_by_slot(0, 0, 0, 1);
@@ -346,7 +346,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
int FlatPanel = -1; /* really means the CRTC is slaved */
Bool Television = FALSE;
void *tmp;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
int err;
#endif
@@ -378,7 +378,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
pVga->MMIOBase = (CARD8 *)pNv;
pVga->MMIOOffset = 0;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
err = pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000,
PCI_DEV_MAP_FLAG_WRITABLE, &tmp);
if (err != 0) {
diff --git a/src/nv_type.h b/src/nv_type.h
index e705d4c..68ca210 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -78,7 +78,7 @@ typedef struct {
CARD32 Architecture;
CARD32 CursorStart;
EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
struct pci_device *PciInfo;
#else
pciVideoPtr PciInfo;
diff --git a/src/riva_driver.c b/src/riva_driver.c
index 759501e..910e63d 100644
--- a/src/riva_driver.c
+++ b/src/riva_driver.c
@@ -825,7 +825,7 @@ RivaMapMem(ScrnInfoPtr pScrn)
/*
* Map IO registers to virtual address space
*/
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
void *tmp;
pci_device_map_range(pRiva->PciInfo, pRiva->IOAddress, 0x1000000,
@@ -890,7 +890,7 @@ RivaUnmapMem(ScrnInfoPtr pScrn)
/*
* Unmap IO registers to virtual address space
*/
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
pci_device_unmap_range(pRiva->PciInfo, pRiva->IOBase, 0x1000000);
pci_device_unmap_range(pRiva->PciInfo, pRiva->FbBase, pRiva->FbMapSize);
#else
diff --git a/src/riva_setup.c b/src/riva_setup.c
index 533f6e8..602e6dc 100644
--- a/src/riva_setup.c
+++ b/src/riva_setup.c
@@ -233,7 +233,7 @@ Riva3Setup(ScrnInfoPtr pScrn)
pRiva->riva.EnableIRQ = 0;
pRiva->riva.IO = VGA_IOBASE_COLOR;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
#define MAP(ptr, offset, size) { \
void *tmp; \
pci_device_map_range(pRiva->PciInfo, (offset), (size), \
diff --git a/src/riva_type.h b/src/riva_type.h
index 4adeb2b..ee999c8 100644
--- a/src/riva_type.h
+++ b/src/riva_type.h
@@ -53,7 +53,7 @@ typedef struct {
RIVA_HW_STATE SavedReg;
RIVA_HW_STATE ModeReg;
EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
struct pci_device *PciInfo;
#else
pciVideoPtr PciInfo;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index cf185f8..d35af55 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -766,7 +766,7 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
pScrn->driverName = NV_DRIVER_NAME;
pScrn->name = NV_NAME;
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
pScrn->Probe = NVProbe;
#endif
pScrn->PreInit = NVPreInit;
@@ -1390,7 +1390,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* Find the PCI info for this screen */
pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device,
pNv->PciInfo->func);
#endif
diff --git a/src/riva_driver.c b/src/riva_driver.c
index 910e63d..a365380 100644
--- a/src/riva_driver.c
+++ b/src/riva_driver.c
@@ -385,7 +385,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
/* Find the PCI info for this screen */
pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
pRiva->PciTag = pciTag(pRiva->PciInfo->bus, pRiva->PciInfo->device,
pRiva->PciInfo->func);
#endif