From 74748676cb564b713341db133ba6c18265e11176 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Wed, 27 Oct 2004 16:39:58 +0000 Subject: [PATCH] - fixes for changes in pci subsystem and power mgt. [2.6.9/2.6.10]. Changed files: X11-driver-nvidia-enable-pci.patch -> 1.1 X11-driver-nvidia-pci_x_class.patch -> 1.1 X11-driver-nvidia-power-suspend.patch -> 1.1 xorg-driver-video-nvidia.spec -> 1.27 --- X11-driver-nvidia-enable-pci.patch | 120 ++++++++++++++++++++++++++ X11-driver-nvidia-pci_x_class.patch | 35 ++++++++ X11-driver-nvidia-power-suspend.patch | 20 +++++ xorg-driver-video-nvidia.spec | 6 ++ 4 files changed, 181 insertions(+) create mode 100644 X11-driver-nvidia-enable-pci.patch create mode 100644 X11-driver-nvidia-pci_x_class.patch create mode 100644 X11-driver-nvidia-power-suspend.patch diff --git a/X11-driver-nvidia-enable-pci.patch b/X11-driver-nvidia-enable-pci.patch new file mode 100644 index 0000000..8d5810a --- /dev/null +++ b/X11-driver-nvidia-enable-pci.patch @@ -0,0 +1,120 @@ +--- NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c.orig 2004-10-27 18:24:52.617102752 +0200 ++++ NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c 2004-10-27 18:26:34.998538408 +0200 +@@ -1225,6 +1225,7 @@ + { + nv_state_t *nv = NV_STATE_PTR(&nv_linux_devices[i]); + release_mem_region(nv->bar.regs.address, nv->bar.regs.size); ++ pci_disable_device(nv_linux_devices[i].dev); + } + } + +@@ -3517,6 +3518,28 @@ + return -1; + } + ++ // enable io, mem, and bus-mastering in pci config space ++ if (pci_enable_device(dev) != 0) ++ { ++ nv_printf(NV_DBG_ERRORS, ++ "NVRM: pci_enable_device failed, aborting\n"); ++ return -1; ++ } ++ ++ // request ownership of our bars ++ // keeps other drivers from banging our registers. ++ // only do this for registers, as vesafb requests our framebuffer and will ++ // keep us from working properly ++ if (!request_mem_region(dev->resource[0].start, ++ dev->resource[0].end - dev->resource[0].start + 1, ++ "nvidia")) ++ { ++ nv_printf(NV_DBG_ERRORS, ++ "NVRM: pci_request_regions failed, aborting\n"); ++ goto err_disable_dev; ++ } ++ pci_set_master(dev); ++ + /* initialize bus-dependent config state */ + nvl = &nv_linux_devices[num_nv_devices]; + nv = NV_STATE_PTR(nvl); +@@ -3546,7 +3569,7 @@ + nv_printf(NV_DBG_ERRORS, "NVRM: Please check your BIOS settings. \n"); + nv_printf(NV_DBG_ERRORS, "NVRM: [Plug & Play OS ] should be set to NO \n"); + nv_printf(NV_DBG_ERRORS, "NVRM: [Assign IRQ to VGA] should be set to YES \n"); +- return -1; ++ goto err_zero_dev; + } + + /* sanity check the IO apertures */ +@@ -3570,39 +3593,9 @@ + nv->bar.fb.address, nv->bar.fb.size); + } + +- /* Clear out the data */ +- os_mem_set(nvl, 0, sizeof(nv_linux_state_t)); +- +- return -1; +- } +- +- // request ownership of our bars +- // keeps other drivers from banging our registers. +- // only do this for registers, as vesafb requests our framebuffer and will +- // keep us from working properly +- if (!request_mem_region(nv->bar.regs.address, nv->bar.regs.size, "nvidia")) +- { +- nv_printf(NV_DBG_ERRORS, +- "NVRM: pci_request_regions failed, aborting\n"); +- +- /* Clear out the data */ +- os_mem_set(nvl, 0, sizeof(nv_linux_state_t)); +- +- return -1; ++ goto err_zero_dev; + } + +- // enable io, mem, and bus-mastering in pci config space +- if (pci_enable_device(dev) != 0) +- { +- nv_printf(NV_DBG_ERRORS, +- "NVRM: pci_enable_device failed, aborting\n"); +- +- pci_release_regions(dev); +- os_mem_set(nvl, 0, sizeof(nv_linux_state_t)); +- +- return -1; +- } +- pci_set_master(nvl->dev); + + #if defined(NV_BUILD_NV_PAT_SUPPORT) + if (nvos_find_pci_express_capability(nvl->dev)) +@@ -3619,13 +3612,7 @@ + if (nv->bar.regs.map == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: failed to map registers!!\n"); +- +- pci_release_regions(dev); +- +- /* Clear out the data */ +- os_mem_set(nvl, 0, sizeof(nv_linux_state_t)); +- +- return -1; ++ goto err_zero_dev; + } + nv->flags |= NV_FLAG_MAP_REGS_EARLY; + #endif +@@ -3642,6 +3629,15 @@ + num_nv_devices++; + + return 0; ++ ++err_zero_dev: ++ os_mem_set(nvl, 0, sizeof(nv_linux_state_t)); ++ release_mem_region(dev->resource[0].start, ++ dev->resource[0].end - dev->resource[0].start + 1); ++ ++err_disable_dev: ++ pci_disable_device(dev); ++ return -1; + } + + int NV_API_CALL nv_no_incoherent_mappings diff --git a/X11-driver-nvidia-pci_x_class.patch b/X11-driver-nvidia-pci_x_class.patch new file mode 100644 index 0000000..c233b31 --- /dev/null +++ b/X11-driver-nvidia-pci_x_class.patch @@ -0,0 +1,35 @@ +--- NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c.orig 2004-10-27 18:23:13.000000000 +0200 ++++ NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c 2004-10-27 18:24:52.617102752 +0200 +@@ -639,7 +639,7 @@ + u8 cap_ptr; + int func, slot; + +- dev = pci_find_class(class << 8, NULL); ++ dev = pci_get_class(class << 8, NULL); + do { + for (func = 0; func < 8; func++) { + slot = PCI_SLOT(dev->devfn); +@@ -650,7 +650,7 @@ + if (cap_ptr) + return fn; + } +- dev = pci_find_class(class << 8, dev); ++ dev = pci_get_class(class << 8, dev); + } while (dev); + + return NULL; +@@ -3484,12 +3484,12 @@ + struct pci_dev *dev = NULL; + int count = 0; + +- dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, dev); ++ dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev); + while (dev) + { + if ((dev->vendor == 0x10de) && (dev->device >= 0x20)) + count++; +- dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, dev); ++ dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev); + } + return count; + } diff --git a/X11-driver-nvidia-power-suspend.patch b/X11-driver-nvidia-power-suspend.patch new file mode 100644 index 0000000..4afe373 --- /dev/null +++ b/X11-driver-nvidia-power-suspend.patch @@ -0,0 +1,20 @@ +--- NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c.orig 2004-10-27 18:26:34.998538408 +0200 ++++ NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c 2004-10-27 18:27:13.447693248 +0200 +@@ -3689,9 +3689,16 @@ + return -1; + } + ++ // Fix up problems with PM_SAVE_STATE being removed from 2.6.9 ++ #ifdef PM_SAVE_STATE ++ #define PM_TMP PM_SAVE_STATE ++ #else ++ #define PM_TMP PM_SUSPEND ++ #endif ++ + switch (state) + { +- case PM_SAVE_STATE: ++ case PM_TMP: + nv_printf(NV_DBG_INFO, "NVRM: ACPI: received standby event\n"); + status = rm_power_management(nv, 0, NV_PM_ACPI_STANDBY); + break; diff --git a/xorg-driver-video-nvidia.spec b/xorg-driver-video-nvidia.spec index d182a96..21b8370 100644 --- a/xorg-driver-video-nvidia.spec +++ b/xorg-driver-video-nvidia.spec @@ -27,6 +27,9 @@ Source1: http://download.nvidia.com/XFree86/Linux-x86_64/%{_nv_ver}-%{_nv_rel}/N # Source1-size: 7333486 Patch0: %{name}-gcc34.patch Patch1: %{name}-GL.patch +Patch2: %{name}-pci_x_class.patch +Patch3: %{name}-enable-pci.patch +Patch4: %{name}-power-suspend.patch URL: http://www.nvidia.com/object/linux.html BuildConflicts: XFree86-nvidia BuildRequires: grep @@ -170,6 +173,9 @@ rm -rf NVIDIA-Linux-x86*-%{_nv_ver}-%{_nv_rel}-pkg* %endif %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 sed -i 's:-Wpointer-arith::' usr/src/nv/Makefile.kbuild %build -- 2.43.0