1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-28 15:55:21 +02:00
openwrt-packages/svgalib/patches/100-fbdev-setpage.patch
David Kühling ac7a991ae2 Port of SVGAlib; patched to only use the linux frame buffer
Try the svgalib-demo programs: vgatest, speedtest etc. seem to work.
2011-01-06 14:42:56 +01:00

25 lines
867 B
Diff

Index: svgalib-1.4.3/src/fbdev.c
===================================================================
--- svgalib-1.4.3.orig/src/fbdev.c 2011-01-06 14:24:59.000000000 +0100
+++ svgalib-1.4.3/src/fbdev.c 2011-01-06 14:27:39.000000000 +0100
@@ -141,9 +141,17 @@
if (page != oldpage)
{
// munmap(BANKED_MEM_POINTER, __svgalib_banked_mem_size);
- mmap(BANKED_MEM_POINTER, __svgalib_banked_mem_size,
+ long size = __svgalib_banked_mem_size;
+ long offs = page * __svgalib_banked_mem_size;
+ if (size + offs > __svgalib_linear_mem_size)
+ size = __svgalib_linear_mem_size - offs;
+ if (size <= 0) {
+ fprintf (stderr, "invalid page %i requested", page);
+ }
+
+ mmap(BANKED_MEM_POINTER, size,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
- fbdev_fd, page * __svgalib_banked_mem_size);
+ fbdev_fd, offs);
oldpage = page;
}
}