Skip to content

@k0001 /abs-nvidia-bl-0.16.10.patch
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
diff -ruN nvidia-bl/nvidia_bl.c nvidia-bl-new/nvidia_bl.c
--- nvidia-bl/nvidia_bl.c 1970-01-01 06:13:08.000000000 -0300
+++ nvidia-bl-new/nvidia_bl.c 2010-06-22 23:12:13.163776338 -0300
@@ -30,8 +30,10 @@
* but there's no guarantee that the chip's smartdimmer signals
* are actually connected to the display logic. Right now, these
* are the supported (read connected) vendors according to NvClock.
+ *
+ * TODO: Remove this stuff. Shouldn't be necessary.
*/
-#define CONFIG_NVIDIA_BL_CHECK_SUBSYSTEM_VENDOR
+/* #define CONFIG_NVIDIA_BL_CHECK_SUBSYSTEM_VENDOR */
/* Check for the new backlight suspend/resume feature */
#if defined(BL_CORE_SUSPENDRESUME)
@@ -39,7 +41,7 @@
/* Otherwise use a platform driver if PM is enabled */
#elif defined(CONFIG_PM)
/*
- * FIXME: Remove this stuff. Shouldn't be necessary anymore
+ * TODO: Remove this stuff. Shouldn't be necessary anymore
* unless to be able to compile against very old kernels.
*/
#warning USE_PLATFORM_DRIVER
@@ -50,12 +52,12 @@
#define __devinitconst /* nothing */
#endif
-/* check whether backlight props.state is present */
+/* Check whether backlight props.state is present */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
#define HAVE_BACKLIGHT_PROPS_STATE
#endif
-/* check whether we have to initialize backlight props */
+/* Check whether we have to initialize backlight props */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
#define INIT_BACKLIGHT_PROPS
#endif
@@ -212,11 +214,18 @@
/*
* Device matching.
+ *
* The list of supported devices was primarily taken from Nvidia's driver
- * documentation appendix A (version 195.30), available at:
+ * documentation appendix A, available at:
* http://download.nvidia.com/XFree86/Linux-x86_64/195.30/README/supportedchips.html
+ * http://download.nvidia.com/XFree86/Linux-x86_64/195.36.24/README/supportedchips.html
* and completed with NvClock's device table and posts by users of Nvidia's forum at:
* http://www.nvnews.net/vbulletin/showthread.php?t=143025.
+ *
+ * Please send reports to Mario Schwalbe <schwalbe@inf.tu-dresden.de>
+ * and also include the output of:
+ * $ cat /sys/class/dmi/id/sys_vendor
+ * $ cat /sys/class/dmi/id/product_name
*/
static DEFINE_PCI_DEVICE_TABLE(nvidia_bl_device_table) = {
/* Geforce Go 7800 */
@@ -297,7 +306,7 @@
{ PCI_VDEVICE(NVIDIA, 0x0406), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 8600M GT */
{ PCI_VDEVICE(NVIDIA, 0x0407), (kernel_ulong_t)&nv5x_driver_data },
- /* Geforce 8600M GTS (NvClock) / Geforce 9650M GS */
+ /* Geforce 9650M GS */
{ PCI_VDEVICE(NVIDIA, 0x0408), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 8700M GT */
{ PCI_VDEVICE(NVIDIA, 0x0409), (kernel_ulong_t)&nv5x_driver_data },
@@ -327,6 +336,10 @@
{ PCI_VDEVICE(NVIDIA, 0x042d), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9300M G */
{ PCI_VDEVICE(NVIDIA, 0x042e), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 7150M / nForce 630M */
+ { PCI_VDEVICE(NVIDIA, 0x0531), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 7000M / nForce 610M */
+ { PCI_VDEVICE(NVIDIA, 0x0533), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9800M GTX */
{ PCI_VDEVICE(NVIDIA, 0x0608), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 8800M GTS */
@@ -337,6 +350,8 @@
{ PCI_VDEVICE(NVIDIA, 0x060b), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 8800M GTX */
{ PCI_VDEVICE(NVIDIA, 0x060c), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GTX 285M */
+ { PCI_VDEVICE(NVIDIA, 0x060f), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9800M GTX */
{ PCI_VDEVICE(NVIDIA, 0x0617), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GTX 260M */
@@ -357,6 +372,10 @@
{ PCI_VDEVICE(NVIDIA, 0x062b), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9800M GTS */
{ PCI_VDEVICE(NVIDIA, 0x062c), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GTS 160M */
+ { PCI_VDEVICE(NVIDIA, 0x0631), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GTS 150M */
+ { PCI_VDEVICE(NVIDIA, 0x0632), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro FX 2700M */
{ PCI_VDEVICE(NVIDIA, 0x063a), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9600M GT */
@@ -371,8 +390,14 @@
{ PCI_VDEVICE(NVIDIA, 0x064b), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9650M GT */
{ PCI_VDEVICE(NVIDIA, 0x064c), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce G 110M */
+ { PCI_VDEVICE(NVIDIA, 0x0651), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GT 130M */
{ PCI_VDEVICE(NVIDIA, 0x0652), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GT 120M */
+ { PCI_VDEVICE(NVIDIA, 0x0653), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GT 220M */
+ { PCI_VDEVICE(NVIDIA, 0x0654), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro FX 1700M */
{ PCI_VDEVICE(NVIDIA, 0x065a), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro FX 770M */
@@ -391,11 +416,13 @@
{ PCI_VDEVICE(NVIDIA, 0x06ec), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce G 103M */
{ PCI_VDEVICE(NVIDIA, 0x06ef), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce G 105M */
+ { PCI_VDEVICE(NVIDIA, 0x06f1), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro NVS 420 */
{ PCI_VDEVICE(NVIDIA, 0x06f8), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro FX 370 LP */
{ PCI_VDEVICE(NVIDIA, 0x06f9), (kernel_ulong_t)&nv5x_driver_data },
- /* QuadroFX 370M (NvClock) */
+ /* Quadro FX 370M */
{ PCI_VDEVICE(NVIDIA, 0x06fb), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9100M G */
{ PCI_VDEVICE(NVIDIA, 0x0844), (kernel_ulong_t)&nv5x_driver_data },
@@ -405,7 +432,15 @@
{ PCI_VDEVICE(NVIDIA, 0x0862), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9400M */
{ PCI_VDEVICE(NVIDIA, 0x0863), (kernel_ulong_t)&nv5x_driver_data },
- /* Geforce 9400M (NvClock) */
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x0865), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 9400M G */
+ { PCI_VDEVICE(NVIDIA, 0x0866), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 9100M G */
+ { PCI_VDEVICE(NVIDIA, 0x086e), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 8200M G */
+ { PCI_VDEVICE(NVIDIA, 0x086f), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 9400M */
{ PCI_VDEVICE(NVIDIA, 0x0870), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce 9200 (NvClock) */
{ PCI_VDEVICE(NVIDIA, 0x0871), (kernel_ulong_t)&nv5x_driver_data },
@@ -413,51 +448,78 @@
{ PCI_VDEVICE(NVIDIA, 0x0872), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce G 102M */
{ PCI_VDEVICE(NVIDIA, 0x0873), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x0874), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x0876), (kernel_ulong_t)&nv5x_driver_data },
/* Quadro FX 470 */
{ PCI_VDEVICE(NVIDIA, 0x087a), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x087d), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION LE */
+ { PCI_VDEVICE(NVIDIA, 0x087e), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION LE */
+ { PCI_VDEVICE(NVIDIA, 0x087f), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 320M */
+ { PCI_VDEVICE(NVIDIA, 0x08a0), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GT 230M */
+ { PCI_VDEVICE(NVIDIA, 0x0a28), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GT 330M */
+ { PCI_VDEVICE(NVIDIA, 0x0a29), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GT 230M */
{ PCI_VDEVICE(NVIDIA, 0x0a2a), (kernel_ulong_t)&nv5x_driver_data },
- /* Geforce GT 330M (user report) */
+ /* Geforce GT 330M */
{ PCI_VDEVICE(NVIDIA, 0x0a2b), (kernel_ulong_t)&nv5x_driver_data },
-
- /*
- * Unconfirmed devices. I don't know whether they still use the
- * same protocol. As of Nvidia driver verion 195.30 these chips exist,
- * but someone should first check if it works:
- *
- * Geforce GT 240M
- * Quadro 880M
- * Geforce G 210M
- * Geforce G 310M
- * Geforce GTS 260M
- * Geforce GTS 250M
- *
- * Please send reports to Mario Schwalbe <schwalbe@inf.tu-dresden.de>
- * and also include the output of:
- * $ cat /sys/class/dmi/id/sys_vendor
- * $ cat /sys/class/dmi/id/product_name
- */
-
+ /* NVS 5100M */
+ { PCI_VDEVICE(NVIDIA, 0x0a2c), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GT 320M */
+ { PCI_VDEVICE(NVIDIA, 0x0a2d), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GT 240M */
{ PCI_VDEVICE(NVIDIA, 0x0a34), (kernel_ulong_t)&nv5x_driver_data },
- /* Quadro 880M (Nvidia forum) */
+ /* Geforce GT 325M */
+ { PCI_VDEVICE(NVIDIA, 0x0a35), (kernel_ulong_t)&nv5x_driver_data },
+ /* Quadro FX 880M */
{ PCI_VDEVICE(NVIDIA, 0x0a3c), (kernel_ulong_t)&nv5x_driver_data },
- /* GeForce G 105M (Nvidia forum) */
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x0a64), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce G 105M */
+ { PCI_VDEVICE(NVIDIA, 0x0a68), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce G 105M */
{ PCI_VDEVICE(NVIDIA, 0x0a69), (kernel_ulong_t)&nv5x_driver_data },
+ /* NVS 2100M */
+ { PCI_VDEVICE(NVIDIA, 0x0a6a), (kernel_ulong_t)&nv5x_driver_data },
+ /* NVS 3100M */
+ { PCI_VDEVICE(NVIDIA, 0x0a6c), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 305M */
+ { PCI_VDEVICE(NVIDIA, 0x0a6e), (kernel_ulong_t)&nv5x_driver_data },
+ /* ION */
+ { PCI_VDEVICE(NVIDIA, 0x0a6f), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 310M */
+ { PCI_VDEVICE(NVIDIA, 0x0a70), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 305M */
+ { PCI_VDEVICE(NVIDIA, 0x0a71), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 310M */
+ { PCI_VDEVICE(NVIDIA, 0x0a72), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce 305M */
+ { PCI_VDEVICE(NVIDIA, 0x0a73), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce G 210M */
{ PCI_VDEVICE(NVIDIA, 0x0a74), (kernel_ulong_t)&nv5x_driver_data },
- /* Geforce G 310M (Nvidia forum) */
+ /* Geforce 310M */
{ PCI_VDEVICE(NVIDIA, 0x0a75), (kernel_ulong_t)&nv5x_driver_data },
+ /* Quadro FX 380M */
+ { PCI_VDEVICE(NVIDIA, 0x0a7c), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GTS 260M */
{ PCI_VDEVICE(NVIDIA, 0x0ca8), (kernel_ulong_t)&nv5x_driver_data },
/* Geforce GTS 250M */
{ PCI_VDEVICE(NVIDIA, 0x0ca9), (kernel_ulong_t)&nv5x_driver_data },
-
- /*
- * Missing chips (not yet documented by Nvidia, but known to exist):
- *
- * Geforce GTX 280M
- */
+ /* Geforce GT 335M */
+ { PCI_VDEVICE(NVIDIA, 0x0caf), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GTS 350M */
+ { PCI_VDEVICE(NVIDIA, 0x0cb0), (kernel_ulong_t)&nv5x_driver_data },
+ /* Geforce GTS 360M */
+ { PCI_VDEVICE(NVIDIA, 0x0cb1), (kernel_ulong_t)&nv5x_driver_data },
+ /* Quadro FX 1800M */
+ { PCI_VDEVICE(NVIDIA, 0x0cbc), (kernel_ulong_t)&nv5x_driver_data },
/* end of list */
{ }
@@ -474,6 +536,8 @@
PCI_VENDOR_ID_HP,
PCI_VENDOR_ID_SAMSUNG,
PCI_VENDOR_ID_SONY,
+ PCI_VENDOR_ID_TOSHIBA,
+ PCI_VENDOR_ID_DELL,
0x1a46, /* PCI_VENDOR_ID_ZEPTO not defined */
};
@@ -487,9 +551,19 @@
.max_level = 1023
};
+static const struct machine_quirks apple_quirks_320m __initdata = {
+ .dev_id = PCI_ANY_ID,
+ .max_level = 44000
+};
+
static const struct machine_quirks sony_vpccw27fx_quirks __initdata = {
.dev_id = PCI_ANY_ID,
- .max_level = 127
+ .max_level = 127000 /* might be wrong. maybe also 0x1ffff */
+};
+
+static const struct machine_quirks max_level_0x1ffff __initdata = {
+ .dev_id = PCI_ANY_ID,
+ .max_level = 0x1ffff
};
/*
@@ -600,7 +674,7 @@
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4"),
},
- .driver_data = (void *)&apple_quirks,
+ .driver_data = (void *)&apple_quirks,
},
{
.callback = &nvidia_bl_dmi_match,
@@ -620,6 +694,24 @@
},
.driver_data = (void *)&apple_quirks,
},
+ {
+ .callback = &nvidia_bl_dmi_match,
+ .ident = "MacBook 7,1",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBook7,1"),
+ },
+ .driver_data = (void *)&apple_quirks_320m,
+ },
+ {
+ .callback = &nvidia_bl_dmi_match,
+ .ident = "MacBookPro 7,1",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro7,1"),
+ },
+ .driver_data = (void *)&apple_quirks_320m,
+ },
/*
* Sony machines: Nvidia graphics
@@ -662,7 +754,7 @@
},
/*
- * Sony machines: Nvidia graphics
+ * Dell machines: Nvidia graphics
*/
{
.callback = &nvidia_bl_dmi_match,
@@ -673,6 +765,28 @@
},
.driver_data = NULL, /* defaults */
},
+ {
+ .callback = &nvidia_bl_dmi_match,
+ .ident = "Dell Vostro 3500",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3500"),
+ },
+ .driver_data = (void *)&max_level_0x1ffff,
+ },
+
+ /*
+ * Toshiba machines: Nvidia graphics
+ */
+ {
+ .callback = &nvidia_bl_dmi_match,
+ .ident = "Toshiba Satellite Pro U500",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U500"),
+ },
+ .driver_data = (void *)&max_level_0x1ffff,
+ },
/* end of list */
{ }
@@ -689,10 +803,10 @@
const unsigned bit = 1 << i;
if (max_level & bit)
return (bit << 1) - 1;
- }
+ }
return (unsigned)-1;
-}
+}
/* missing annotation __devinitconst */
static const struct pci_device_id *nvidia_bl_match_id(struct pci_dev *dev)
@@ -901,7 +1015,7 @@
/* Register at backlight framework */
nvidia_bl_device = backlight_device_register("nvidia_backlight", NULL,
&driver_data,
- &nvidia_bl_backlight_ops
+ &nvidia_bl_backlight_ops,
&props);
#else
/* Register at backlight framework */
@@ -920,22 +1034,20 @@
else
max_level = driver_data.max_level;
- /* Re-compute the register mask */
+ /* Compute the register mask */
driver_data.reg_mask =
nvidia_bl_max_level_to_mask(driver_data.max_level);
- if (unlikely(debug))
- printk(KERN_DEBUG "nvidia_bl: register mask: 0x%08x\n",
- driver_data.reg_mask);
-
/* Set up backlight device */
nvidia_bl_device->props.brightness =
- nvidia_bl_device->props.max_brightness =
- driver_data.max_level >> shift;
+ nvidia_bl_device->props.max_brightness = driver_data.max_level >> shift;
/* dump initial state if in debugging mode */
- if (debug)
+ if (unlikely(debug)) {
+ printk(KERN_DEBUG "nvidia_bl: register mask: 0x%08x\n",
+ driver_data.reg_mask);
nvidia_bl_device->ops->get_brightness(nvidia_bl_device);
+ }
/*
* MacBook Pro 5: Hardware might report the wrong value (maximum),
diff -ruN nvidia-bl/PKGBUILD nvidia-bl-new/PKGBUILD
--- nvidia-bl/PKGBUILD 1970-01-01 06:13:08.000000000 -0300
+++ nvidia-bl-new/PKGBUILD 2010-06-22 23:25:23.650363364 -0300
@@ -2,7 +2,7 @@
# Contributor: Hervé Cauwelier <herve@oursours.net>
pkgname=nvidia-bl
-pkgver=0.15.4
+pkgver=0.16.10
pkgrel=1
pkgdesc="Driver to adjust display backlight on modern mobile NVidia graphics adapters."
arch=('i686' 'x86_64')
@@ -13,7 +13,7 @@
url="https://launchpad.net/~mactel-support/+archive/ppa"
source=('nvidia_bl.c'
'Makefile')
-md5sums=('46503027fd1b86c97d0d1b1d4a790e34'
+md5sums=('ed553dda005a89fc770fba26cf9dc735'
'78e51eb742a4372ca450def2a19580a2')
build() {
@@ -21,6 +21,6 @@
make || return 1
- mkdir -p ${pkgdir}/lib/modules/`uname -r`/kernel/drivers/
- install -m 644 nvidia_bl.ko ${pkgdir}/lib/modules/`uname -r`/kernel/drivers/nvidia_bl.ko
+ mkdir -p ${pkgdir}/lib/modules/`uname -r`/kernel/drivers/video/backlight
+ install -m 644 nvidia_bl.ko ${pkgdir}/lib/modules/`uname -r`/kernel/drivers/video/backlight/nvidia_bl.ko
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.