nvidia-bl: WIP

This commit is contained in:
Anton Bolshakov 2023-04-12 22:54:59 +08:00
parent c473685e37
commit fd7b81fa92
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
3 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1 @@
DIST nvidia-bl-dkms.tar.gz 8560 BLAKE2B 4ad85581effa37886f66fcd9bcadf4d628de221521a1f4af73b0f5adc084a0a2b38567e21a6df5be5277e7529d3575912b2fd286ccf0f6ba59909aedc6255c52 SHA512 60db247c8cb4daec5206e55ece33cb62099a9709b533ad945c219482354978ae3eed9b858d3c2405c27bd0fca35aad5640cd74cd62a8a5453ecd914b57dcb05f

View file

@ -0,0 +1,56 @@
diff --git a/Makefile b/Makefile
index 4c16ce1..1121cf6 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ KDIR := /usr/lib/modules/$(KVER)/build
PWD := $(shell pwd)
default:
- $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+ $(MAKE) -C $(KDIR) M=$(PWD) SUBDIRS=$(PWD) modules
clean:
- $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
+ $(MAKE) -C $(KDIR) M=$(PWD) SUBDIRS=$(PWD) clean
diff --git a/nvidia_bl.c b/nvidia_bl.c
index c1d3593..e7dfccb 100644
--- a/nvidia_bl.c
+++ b/nvidia_bl.c
@@ -538,17 +538,17 @@ static const unsigned nvidia_bl_subvendors[] __initdata = {
/*
* Machine specific quirks used below.
*/
-static const struct machine_quirks apple_quirks __initdata = {
+static const struct machine_quirks apple_quirks = {
.dev_id = PCI_ANY_ID,
.max_level = 1023
};
-static const struct machine_quirks apple_quirks_320m __initdata = {
+static const struct machine_quirks apple_quirks_320m = {
.dev_id = PCI_ANY_ID,
.max_level = 44000
};
-static const struct machine_quirks max_level_0x1ffff __initdata = {
+static const struct machine_quirks max_level_0x1ffff = {
.dev_id = PCI_ANY_ID,
.max_level = 0x1ffff
};
@@ -565,7 +565,7 @@ static int nvidia_bl_dmi_match(const struct dmi_system_id *id)
return 1;
}
-static const struct dmi_system_id nvidia_bl_machine_table[] __initdata = {
+static const struct dmi_system_id nvidia_bl_machine_table[] = {
/*
* Apple machines: Intel chipset, Nvidia graphics
*/
@@ -925,7 +925,7 @@ static int nvidia_bl_map_smartdimmer(struct driver_data *dd)
"smartdimmer at 0x%lx\n", dd->bar, bar_start, reg_addr);
/* Now really map (The address need not be page-aligned.) */
- dd->smartdimmer = ioremap_nocache(reg_addr, dd->reg_size);
+ dd->smartdimmer = ioremap_cache(reg_addr, dd->reg_size);
if (!dd->smartdimmer)
return -ENXIO;

View file

@ -0,0 +1,39 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-mod
DESCRIPTION="Driver to adjust display backlight on legacy mobile NVidia graphics adapters"
HOMEPAGE="https://aur.archlinux.org/packages/nvidia-bl-dkms"
SRC_URI="nvidia-bl-dkms.tar.gz"
LICENSE="GPL-2"
SLOT="0"
#WIP
#KEYWORDS="~amd64 ~arm64 ~x86"
IUSE=""
S="${WORKDIR}/nvidia-bl-dkms"
MODULE_NAMES="nvidia_bl(misc:)"
# / extra
BUILD_TARGETS="default"
pkg_setup() {
linux-mod_pkg_setup
# kernel_is -ge 3 10 && die "kernel 3.10.0 or higher is not supported by this version"
BUILD_PARAMS="-C ${KV_DIR} SUBDIRS=${S} KDIR=${KV_DIR} KVER=${KV_FULL} V=1"
}
src_prepare() {
eapply "${FILESDIR}"/update.patch
sed -i 's/__devinitconst//g' nvidia_bl.c
eapply_user
}
#src_install() {
# linux-mod_src_install
#}