Control intel backlight on FreeBSD (and OpenBSD)
openbsd

provide a clue to machdep.allowaperture=3 if opening /dev/xf86 fails

remove patch from README, this was committed a while ago

+4 -33
+2 -31
README
··· 47 47 48 48 49 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)) 50 + Requires a kernel capable of concurrent opening of /dev/xf86, via 51 + machdep.allowaperture=3.
+2 -2
intel_mmio.c
··· 103 103 #ifdef __OpenBSD__ 104 104 int ap = open("/dev/xf86", O_RDWR); 105 105 if (ap < 0) { 106 - fprintf(stderr, "Couldn't open /dev/xf86: %s\n", 107 - strerror(errno)); 106 + fprintf(stderr, "Couldn't open /dev/xf86: %s " 107 + "(is machdep.allowaperture=3?)\n", strerror(errno)); 108 108 exit(1); 109 109 } 110 110