Control intel backlight on FreeBSD (and OpenBSD)
openbsd

README: add openbsd notes with kernel patch

+39 -1
+39 -1
README
··· 6 6 7 7 Originally ported to FreeBSD by "emmex" of the FreeBSD forums. 8 8 9 - Build: 9 + FreeBSD Build: 10 10 pkg install libpciaccess libdrm 11 + make 12 + make install 13 + 14 + OpenBSD Build: 11 15 make 12 16 make install 13 17 ··· 40 44 41 45 Usage: 42 46 ./isl_backlight.sh & 47 + 48 + 49 + OpenBSD Notes: 50 + Requires a kernel capable of concurrent opening of /dev/xf86, if this is to be 51 + run while X is running. The following patch implements machdep.allowaperture=3 52 + to support this. 53 + 54 + Index: arch/amd64/amd64/mem.c 55 + =================================================================== 56 + RCS file: /cvs/src/sys/arch/amd64/amd64/mem.c,v 57 + retrieving revision 1.23 58 + diff -u -p -u -p -r1.23 mem.c 59 + --- arch/amd64/amd64/mem.c 14 Mar 2015 03:38:46 -0000 1.23 60 + +++ arch/amd64/amd64/mem.c 26 May 2015 02:52:31 -0000 61 + @@ -93,8 +93,9 @@ mmopen(dev_t dev, int flag, int mode, st 62 + if (suser(p, 0) != 0 || !allowaperture) 63 + return (EPERM); 64 + 65 + - /* authorize only one simultaneous open() */ 66 + - if (ap_open_count > 0) 67 + + /* authorize only one simultaneous open() unless 68 + + * allowaperture=3 */ 69 + + if (ap_open_count > 0 && allowaperture < 3) 70 + return(EPERM); 71 + ap_open_count++; 72 + break; 73 + @@ -213,6 +214,7 @@ mmmmap(dev_t dev, off_t off, int prot) 74 + else 75 + return -1; 76 + case 2: 77 + + case 3: 78 + /* Allow mapping of the whole 1st megabyte 79 + for x86emu */ 80 + if (off <= BIOS_END || !amd64_pa_used(off))