NetBSD/xsrc ZyGI6A6/cvs/netbsd/xsrc/external/mit/xf86-video-wsfb/dist/src wsfb_driver.c

   Correctly support the case of fbi->fbi_fboffset != 0, which means base
   address of framebuffer is not page-aligned:

   - When mmap framebuffer, fbi->fbi_fboffset is added to the length of
     framebuffer. Otherwise, the last page of framebuffer is not mapped
     properly if (size of framebuffer) <= (page boundary) < (size of
     framebuffer + fbi->fbi_fboffset), since length of mapped area is
     counted from page-truncated address. This results in memory
     corruption in the upper adjacent page, or SEGV.

   - Use fPtr->fbstart (real base address of framebuffer) instead of
     fPtr->fbmem (return value of mmap, i.e., page-aligned base address)
     where appropriate.

   Tested on genfb(4) on Cubietruck, where fbi->fbi_fboffset = 4096.

   No functional changes for majority of framebuffer drivers, whose base
   address is page-aligned.
VersionDeltaFile
1.35+18-18/cvs/netbsd/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
+18-181 files

UnifiedSplitRaw