rpms/svgalib/devel svgalib-1.4.3-fhs.patch, NONE, 1.1 svgalib-1.9.21-cfg.patch, NONE, 1.1 svgalib-1.9.21-demos.patch, NONE, 1.1 svgalib-1.9.21-makefiles.patch, NONE, 1.1 svgalib-1.9.21-wip.patch, NONE, 1.1 svgalib-1.9.21-wip2.patch, NONE, 1.1 svgalib-1.9.21-x86_64.patch, NONE, 1.1 svgalib-1.9.22.diff, NONE, 1.1 svgalib-todo, NONE, 1.1 svgalib.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Fri Aug 5 09:37:42 UTC 2005


Author: jwrdegoede

Update of /cvs/extras/rpms/svgalib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16807/devel

Modified Files:
	.cvsignore sources 
Added Files:
	svgalib-1.4.3-fhs.patch svgalib-1.9.21-cfg.patch 
	svgalib-1.9.21-demos.patch svgalib-1.9.21-makefiles.patch 
	svgalib-1.9.21-wip.patch svgalib-1.9.21-wip2.patch 
	svgalib-1.9.21-x86_64.patch svgalib-1.9.22.diff svgalib-todo 
	svgalib.spec 
Log Message:
auto-import svgalib-1.9.21-2 on branch devel from svgalib-1.9.21-2.src.rpm

svgalib-1.4.3-fhs.patch:

--- NEW FILE svgalib-1.4.3-fhs.patch ---
--- svgalib-1.4.3/doc/man1/savetextmode.1.debian	2004-07-16 17:36:23.000000000 +0200
+++ svgalib-1.4.3/doc/man1/savetextmode.1	2004-07-16 17:33:02.000000000 +0200
@@ -10,7 +10,11 @@
 .SH DESCRIPTION
 These are simple scripts to save the SVGA register state when in textmode to the
 files
-.IR /tmp/fontdata " and " /tmp/textregs
+.IR /etc/vga/fontdata " and " /etc/vga/textregs
+.RI ( $HOME/.vga/fontdata " and " $HOME/.vga/textregs
+if directory
+.I /etc/vga
+is not writeable)
 or to restore it from these files.
 
 The actual utilities used are
@@ -40,9 +44,13 @@
 will understand.
 
 .SH FILES
-.I /tmp/fontdata
+.I /etc/vga/fontdata
+or
+.I $HOME/.vga/fontdata
 .br
-.I /tmp/textregs
+.I /etc/vga/textregs
+or
+.I $HOME/.vga/textregs
 
 .SH SEE ALSO
 
--- svgalib-1.4.3/doc/man1/svgakeymap.1.debian	2004-07-16 17:36:23.000000000 +0200
+++ svgalib-1.4.3/doc/man1/svgakeymap.1	2004-07-16 17:33:02.000000000 +0200
@@ -9,7 +9,7 @@
 Generates a keymap conversion file for
 .BR svgalib (7)
 from two keytable definitions. Keytables are searched for in
-.I /usr/lib/kbd/keytables
+.I /lib/kbd/keymaps
 and are automatically filtered through
 .BR gzip (1)
 if necessary.
@@ -22,7 +22,7 @@
 or piped in any creative manner you wish.
 
 .SH FILES
-.I /usr/lib/kbd/keytables/*.map[.gz]
+.I /lib/kbd/keymaps/*/*/*.map[.gz]
 .RS
 The system keytable files used by
 .BR loadkeys "(1)."
--- svgalib-1.4.3/doc/README.keymap.debian	2004-07-16 17:36:23.000000000 +0200
+++ svgalib-1.4.3/doc/README.keymap	2004-07-16 17:33:02.000000000 +0200
@@ -83,7 +83,7 @@
 equivalents in the layout expected by the program.
 
 A program called svgakeymap is provided to generate these maps from the
-keytable files in /usr/lib/kbd/keytables; you must have perl for it to work.
+keytable files in /lib/kbd/keymaps; you must have perl for it to work.
 Creating a keymap file with svgakeymap is easy; to make a map to convert
 scancodes from a US Dvorak keyboard to a US QWERTY keyboard as for our example
 above:
--- svgalib-1.4.3/utils/runx.debian	2004-07-16 17:36:24.000000000 +0200
+++ svgalib-1.4.3/utils/runx	2004-07-16 17:33:02.000000000 +0200
@@ -5,8 +5,8 @@
 # running X, and 'textmode' after. This will restore the textmode registers
 # and the VGA palette in addition to the VGA font.
 
-echo Saving font in /tmp/fontdata
-restorefont -w /tmp/fontdata
+echo Saving font in $HOME/.fontdata
+restorefont -w $HOME/.fontdata
 startx
-echo Restoring font from /tmp/fontdata
-restorefont -r /tmp/fontdata
+echo Restoring font from $HOME/.fontdata
+restorefont -r $HOME/.fontdata
--- svgalib-1.4.3/utils/savetextmode.debian	2004-07-16 17:36:24.000000000 +0200
+++ svgalib-1.4.3/utils/savetextmode	2004-07-16 17:33:02.000000000 +0200
@@ -1,4 +1,14 @@
 #!/bin/sh
-rm -f /etc/vga/textregs /etc/vga/fontdata
-restoretextmode -w /etc/vga/textregs
-restorefont -w /etc/vga/fontdata
+dir=/etc/vga
+if [ ! -w "$dir" ]; then
+  dir="$HOME/.vga"
+  mkdir -p -m 700 "$dir"
+fi
+if [ -f /etc/textregs -o -f /etc/fontdata ]; then
+  echo >&2 "WARNING: the textregs and fontdata files have moved in this"
+  echo >&2 "         release from /etc to /etc/vga; please remove or rename"
+  echo >&2 "         your old versions."
+fi
+rm -f "$dir/textregs" "$dir/fontdata"
+restoretextmode -w "$dir/textregs"
+restorefont -w "$dir/fontdata"
--- svgalib-1.4.3/utils/svgakeymap.debian	2004-07-16 17:36:24.000000000 +0200
+++ svgalib-1.4.3/utils/svgakeymap	2004-07-16 17:33:02.000000000 +0200
@@ -7,16 +7,16 @@
 #   svgakeymap [physical_map [program_map]] > output.keymap
 #
 # The conversion map is output to stdout; you may wish to redirect it.
-# Keymaps are searched for in /usr/lib/kbd/keytables and are automatically
+# Keymaps are searched for in /lib/kbd/keymaps and are automatically
 # filtered through gzip if necessary.
 #
 # Read the file README.keymap from the svgalib distribution for more info.
 
-$ktd = "/usr/lib/kbd/keytables/";
+$ktd = "/lib/kbd/keymaps/";
 if(scalar(@ARGV) > 0) {
     $inmap = $ARGV[0];
 } else {
-    $inmap = "us";
+    $inmap = "i386/qwerty/us";
 }
 if(scalar(@ARGV) > 1) {
     $outmap = $ARGV[1];
@@ -34,7 +34,7 @@
 
         unless(-e $bob) {
             # Tack a .gz on it
-            $bob .= ".map";
+            $bob .= ".kmap";
             #print "$bob\n";
             
             unless(-e $bob) {
--- svgalib-1.4.3/utils/textmode.debian	2004-07-16 17:36:24.000000000 +0200
+++ svgalib-1.4.3/utils/textmode	2004-07-16 17:33:02.000000000 +0200
@@ -1,4 +1,18 @@
 #!/bin/sh
-restoretextmode -r /etc/vga/textregs
-restorefont -r /etc/vga/fontdata
+
+dir=/etc/vga
+[ -w "$dir" ] || dir="$HOME/.vga"
+
+if [ -f "$dir/textregs" -o -f "$dir/fontdata" ]; then
+  restoretextmode -r "$dir/textregs"
+  restorefont -r "$dir/fontdata"
+elif [ -f /etc/textregs -o -f /etc/fontdata ]; then
+  echo >&2 "WARNING: the textregs and fontdata files have moved in this"
+  echo >&2 "         release from /etc to /etc/vga; please remove or rename"
+  echo >&2 "         your old versions."
+  echo "Using old location for data files."
+  restoretextmode -r /etc/textregs
+  restorefont -r /etc/fontdata
+fi
+
 restorepalette

svgalib-1.9.21-cfg.patch:

--- NEW FILE svgalib-1.9.21-cfg.patch ---
--- svgalib-1.9.21/src/config/libvga.config.cfg	2005-08-03 14:29:49.000000000 +0200
+++ svgalib-1.9.21/src/config/libvga.config	2005-08-03 14:32:43.000000000 +0200
@@ -11,7 +11,7 @@
 
 Helper /dev/svga
 
-# NoHelper            # Disable use of the helper-kernelmodule (/dev/svga) and
+NoHelper              # Disable use of the helper-kernelmodule (/dev/svga) and
                       # fallback to old ioperm/iopl and /dev/mem use.
 
 # If you have two vga cards with the same pci vendor id, svgalib will try
@@ -43,14 +43,14 @@
 # mouse MouseMan	# Logitech MouseMan
 # mouse Spaceball	# Spacetec Spaceball
 # mouse IntelliMouse	# Microsoft IntelliMouse or Logitech MouseMan+ on serial port
-# mouse IMPS2		# Microsoft IntelliMouse or Logitech MouseMan+ on PS/2 port
+mouse IMPS2		# Microsoft IntelliMouse or Logitech MouseMan+ on PS/2 port
 # mouse pnp		# plug'n'pray
 # mouse WacomGraphire   # Wacom Graphire tablet/mouse
 # mouse DRMOUSE4DS	# Digital Research double-wheeled mouse
 # mouse ExplorerPS2	# Microsoft Intellimouse Explorer PS/2
 # mouse none		# None
 
-mouse unconfigured
+# mouse unconfigured
 
 # (DEBIAN NOTE: the mouse used to default to microsoft, but this was changed
 #  to fix bug #13458. If your mouse used to work fine, you can simply change
@@ -129,6 +129,7 @@
 # want to specify a different device for svgalib to use
 
 # mdev /dev/ttyS0 # mouse is at /dev/ttyS0
+mdev /dev/input/mice
 
 # Some multiprotocol mice will need one of the following:
 
@@ -421,7 +422,7 @@
 # Clockchip ICD2061A  # The only one supported right now
 
 
-# VesaText	      # Helps the VESA driver with text mode restoration
+VesaText	      # Helps the VESA driver with text mode restoration
 		      # problems.
 
 # VesaSave 14	      # changing value might help text mode restoring

svgalib-1.9.21-demos.patch:

--- NEW FILE svgalib-1.9.21-demos.patch ---
--- svgalib-1.9.21/demos/testgl.c.demos	2002-04-03 09:31:14.000000000 +0200
+++ svgalib-1.9.21/demos/testgl.c	2005-07-01 20:51:55.000000000 +0200
@@ -184,7 +184,7 @@
 
     if (!vga_hasmode(VGAMODE)) {
 	printf("Mode not available.\n");
-	exit(-1);
+	return -1;
     }
     VIRTUAL = 0;		/* No virtual screen. */
     if (vga_getmodeinfo(VGAMODE)->colors == 16 ||
@@ -224,5 +224,5 @@
     if (VIRTUAL)
 	gl_freecontext(backscreen);
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/vgatweak.c.demos	2000-08-06 12:20:02.000000000 +0200
+++ svgalib-1.9.21/demos/vgatweak.c	2005-07-01 20:51:55.000000000 +0200
@@ -124,7 +124,7 @@
 	testmode(mode);
     else {
 	printf("Error: Video mode not supported by driver\n");
-	exit(-1);
+	return -1;
     }
     
     return 0;
--- svgalib-1.9.21/demos/linearfork.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/linearfork.c	2005-07-01 20:51:55.000000000 +0200
@@ -82,7 +82,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(1);
+	return 1;
     }
     vga_setmode(vgamode);
     vga_setlinearaddressing();
@@ -95,7 +95,7 @@
     /* purposes. */
     if (keyboard_init()) {
 	printf("Could not initialize keyboard.\n");
-	exit(1);
+	return 1;
     }
     /* Translate to 4 keypad cursor keys, and unify enter key. */
     keyboard_translatekeys(TRANSLATE_CURSORKEYS | TRANSLATE_KEYPADENTER |
@@ -161,5 +161,5 @@
     keyboard_close();		/* Don't forget this! */
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/bg_test.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/bg_test.c	2005-07-01 20:51:55.000000000 +0200
@@ -9,6 +9,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
 #include <strings.h>
 #include <vga.h>
 #include <vgagl.h>
--- svgalib-1.9.21/demos/accel.c.demos	2002-04-03 09:30:23.000000000 +0200
+++ svgalib-1.9.21/demos/accel.c	2005-07-01 20:51:55.000000000 +0200
@@ -97,7 +97,7 @@
 
     if (accelfuncs == 0) {
 	printf("No acceleration supported.\n");
-	exit(0);
+	return 1;
     }
     printf("Accelflags: 0x%08X\n", accelfuncs);
 
@@ -292,7 +292,7 @@
 	    );
     }
     vga_setmode(TEXT);
-    exit(-1);
+    return 0;
 }
 
 
--- svgalib-1.9.21/demos/vgatest.c.demos	2005-01-27 11:34:16.000000000 +0100
+++ svgalib-1.9.21/demos/vgatest.c	2005-07-01 20:51:55.000000000 +0200
@@ -275,7 +275,7 @@
 
 	if (mode < 1 || mode > GLASTMODE) {
 	    printf("Error: Mode number out of range \n");
-	    exit(-1);
+	    return -1;
 	}
     }
     if (vga_hasmode(mode)) {
@@ -285,7 +285,7 @@
 		}
 	} else {
 		printf("Error: Video mode not supported by driver\n");
-		exit(-1);
+		return -1;
     }
     
 	vga_setmode(TEXT);
--- svgalib-1.9.21/demos/printftest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/printftest.c	2005-07-01 20:51:55.000000000 +0200
@@ -44,7 +44,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(1);
+	return 1;
     }
 
     vga_setmode(vgamode);
@@ -68,5 +68,5 @@
 
     vga_setmode(TEXT);
 
-    exit(retval);
+    return retval;
 }
--- svgalib-1.9.21/demos/fun.c.demos	2002-07-20 18:33:54.000000000 +0200
+++ svgalib-1.9.21/demos/fun.c	2005-07-01 20:51:55.000000000 +0200
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <time.h>
+#include <string.h>
 #include <vga.h>
 #include <vgagl.h>
 
--- svgalib-1.9.21/demos/bankspeed.c.demos	2002-04-03 09:31:22.000000000 +0200
+++ svgalib-1.9.21/demos/bankspeed.c	2005-07-01 20:51:55.000000000 +0200
@@ -125,7 +125,7 @@
 
     if (!vga_hasmode(VGAMODE)) {
 	printf("Mode not available.\n");
-	exit(-1);
+	return -1;
     }
     VIRTUAL = 0;		/* No virtual screen. */
     if (vga_getmodeinfo(VGAMODE)->colors == 16 ||
@@ -165,5 +165,5 @@
     t2=clock();
     printf("total:%1.2f sec\n",(1.0*t2-t1)/CLOCKS_PER_SEC); 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/eventtest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/eventtest.c	2005-07-01 20:51:55.000000000 +0200
@@ -3,6 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <vga.h>
@@ -254,5 +255,5 @@
     keyboard_close();		/* Don't forget this! */
 #endif
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/svidtune.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/svidtune.c	2005-07-01 20:51:55.000000000 +0200
@@ -48,7 +48,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(1);
+	return 1;
     }
 
     vga_setmode(vgamode);
@@ -176,5 +176,5 @@
 
     vga_setmode(TEXT);
 
-    exit(retval);
+    return retval;
 }
--- svgalib-1.9.21/demos/keytest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/keytest.c	2005-07-01 20:51:55.000000000 +0200
@@ -38,7 +38,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(1);
+	return 1;
     }
     printf("\nWARNING: This program will set the keyboard to RAW mode.\n"
 	   "The keyboard routines in svgalib have not been tested\n"
@@ -61,7 +61,7 @@
     /* purposes. */
     if (keyboard_init()) {
 	printf("Could not initialize keyboard.\n");
-	exit(1);
+	return 1;
     }
     /* Translate to 4 keypad cursor keys, and unify enter key. */
     keyboard_translatekeys(TRANSLATE_CURSORKEYS | TRANSLATE_KEYPADENTER |
@@ -126,5 +126,5 @@
 
     keyboard_close();		/* Don't forget this! */
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/scrolltest.c.demos	2000-01-12 21:03:39.000000000 +0100
+++ svgalib-1.9.21/demos/scrolltest.c	2005-07-01 20:51:55.000000000 +0200
@@ -304,5 +304,5 @@
     demo3();
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/forktest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/forktest.c	2005-07-01 20:51:55.000000000 +0200
@@ -82,7 +82,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(1);
+	return 1;
     }
     vga_setmode(vgamode);
     gl_setcontextvga(vgamode);
@@ -94,7 +94,7 @@
     /* purposes. */
     if (keyboard_init()) {
 	printf("Could not initialize keyboard.\n");
-	exit(1);
+	return 1;
     }
     /* Translate to 4 keypad cursor keys, and unify enter key. */
     keyboard_translatekeys(TRANSLATE_CURSORKEYS | TRANSLATE_KEYPADENTER |
@@ -160,5 +160,5 @@
     keyboard_close();		/* Don't forget this! */
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/mjoytest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/mjoytest.c	2005-07-01 20:51:55.000000000 +0200
@@ -196,7 +196,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(-1);
+	return -1;
     }
 
     puts("In the demo, press\n"
@@ -286,6 +286,6 @@
     printf("Shutting down.\n");
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
 
--- svgalib-1.9.21/demos/speedtest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/speedtest.c	2005-07-01 20:51:55.000000000 +0200
@@ -1,4 +1,3 @@
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -308,5 +307,5 @@
     speed();
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/linearspeed.c.demos	2003-11-07 10:26:02.000000000 +0100
+++ svgalib-1.9.21/demos/linearspeed.c	2005-07-01 20:51:55.000000000 +0200
@@ -418,5 +418,5 @@
     if(!fast)sysmem_speed();
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
--- svgalib-1.9.21/demos/testlinear.c.demos	2004-09-16 19:56:12.000000000 +0200
+++ svgalib-1.9.21/demos/testlinear.c	2005-07-01 20:51:55.000000000 +0200
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <vga.h>
 #include <time.h>
-#include "../src/libvga.h"
+#include "libvga.h"
 
 
 #define USE_LINEAR_ADDRESSING
@@ -66,7 +66,7 @@
     if (!(argc == 2 && strcmp(argv[1], "--force") == 0))
 	if (!(vga_getmodeinfo(vga_getdefaultmode())->flags & CAPABLE_LINEAR)) {
 	    printf("Linear addressing not supported for this chipset.\n");
-	    exit(1);
+	    return 1;
 	}
     vga_init();
     vga_setmode(vga_getdefaultmode());
@@ -75,7 +75,7 @@
     if (vga_setlinearaddressing() == -1) {
 	vga_setmode(TEXT);
 	printf("Could not set linear addressing.\n");
-	exit(-1);
+	return -1;
     }
 #endif
 
--- svgalib-1.9.21/demos/Makefile.demos	2004-11-16 08:59:52.000000000 +0100
+++ svgalib-1.9.21/demos/Makefile	2005-07-01 20:59:09.000000000 +0200
@@ -4,19 +4,15 @@
 # This file is a part of SVGAlib.
 #----------------------------------------------------------------------
 
-include ../Makefile.cfg
-
-srcdir    = ..
-VPATH     = $(srcdir)/demos
-
 #----------------------------------------------------------------------
-# Compiler Section (overrides Makefile.cfg)
+# Compiler Section
 #----------------------------------------------------------------------
 
-CFLAGS = $(WARN) $(OPTIMIZE) -I$(srcdir)/include -I$(srcdir)/gl $(DEBFLAGS)
-ifeq (a.out, $(TARGET_FORMAT))
-  CFLAGS += -DSVGA_AOUT
-endif
+CC      = gcc
+CFLAGS  = -Wall -Wstrict-prototypes
+CFLAGS += -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -g
+LDFLAGS = -s
+LIBS    = -lvgagl -lvga -lm
 
 #----------------------------------------------------------------------
 # Rules Section
@@ -25,51 +21,12 @@
 PROGS    = fun testgl speedtest mousetest vgatest scrolltest testlinear \
 	   keytest testaccel accel forktest eventtest spin bg_test printftest \
 	   joytest mjoytest bankspeed lineart linearspeed addmodetest \
-	   svidtune linearfork cursor vgatweak buildcsr
-
-# Determine what library (static or shared) we will be linking programs with
-ifdef INSTALLSHAREDLIB
-  LIBS = -lvgagl -lvga
-endif
-ifndef LIBS
-  LIBS    = ../staticlib/libvgagl.a ../staticlib/libvga.a -lm
-  LVGADEP = $(LIBS)
-endif
+	   svidtune linearfork cursor vgatweak
 
 all:	$(PROGS)
 
-.PHONY: all clean cleanbin dep
-
-$(PROGS): $(LVGADEP)
-
 .c:
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $* $*.c $(LIBS)
 
-rwpage: rwpage.pp
-	$(PC) -Rintel rwpage.pp
-
-testaccel: testaccel.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -o testaccel testaccel.c $(LIBS) -lm
-
-accel: accel.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -o accel accel.c $(LIBS) -lm
-
-linearspeed: linearspeed.c memset.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o linearspeed linearspeed.c memset.o $(LIBS)
-
-buildcsr: mkcur.o
-	$(CC) -o buildcsr $(LDFLAGS) mkcur.o -lvgagl -lvga
-
-clean:	cleanbin
-	rm -f .depend *.o *~ *.bak core
-
-cleanbin:
-	rm -f $(PROGS) rwpage
-
-#
-# No dependencies required here.
-#
-
-dep:
-.depend:
-
+clean:
+	rm -f $(PROGS)
--- svgalib-1.9.21/demos/mousetest.c.demos	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/mousetest.c	2005-07-01 20:51:55.000000000 +0200
@@ -34,7 +34,7 @@
 
     if (!vga_hasmode(vgamode)) {
 	printf("Mode not available.\n");
-	exit(-1);
+	return -1;
     }
 #ifndef MANUALLY_SETUP_MOUSE
     /* Enable automatic mouse setup at mode set. */
@@ -72,7 +72,7 @@
     /* To be able to test fake mouse events... */
     if (keyboard_init()) {
 	printf("Could not initialize keyboard.\n");
-	exit(1);
+	return 1;
     }
 
     /* Set the range for the wheel */
@@ -136,5 +136,5 @@
 #endif
 
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }

svgalib-1.9.21-makefiles.patch:

--- NEW FILE svgalib-1.9.21-makefiles.patch ---
--- svgalib-1.9.21/utils/Makefile.makefiles	2005-03-18 11:59:49.000000000 +0100
+++ svgalib-1.9.21/utils/Makefile	2005-07-08 21:16:12.000000000 +0200
@@ -35,7 +35,6 @@
 
 .o:
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $* $*.o $(LIBS)
-	chmod 4755 $*
 
 all: $(UTILPROGS)
 .PHONY: all clean cleanbin dep
--- svgalib-1.9.21/Makefile.makefiles	2005-03-18 14:49:10.000000000 +0100
+++ svgalib-1.9.21/Makefile	2005-07-08 21:16:12.000000000 +0200
@@ -78,10 +78,6 @@
 
 installheaders:
 	@echo Installing header files in $(includedir).
-	@if [ -f /usr/include/vga.h ]; then \
-		rm -f /usr/include/vga.h /usr/include/vgagl.h; \
-		echo Old header files in /usr/include removed.; \
-	fi
 	@mkdir -p $(includedir)
 	@cp $(SRCDIR)/src/vga.h $(includedir)/vga.h
 	@chmod a+r $(includedir)/vga.h
@@ -95,33 +91,19 @@
 	@chmod a+r $(includedir)/vgakeyboard.h
 
 installsharedlib: $(SHAREDLIBS) $(SVGALIBSHAREDSTUBS)
-	@if [ -f /usr/lib/libvga.sa ]; then \
-		rm -f /usr/lib/libvga.sa /usr/lib/libvgagl.sa; \
-		echo Old stubs in /usr/lib removed.; \
-	fi
-ifndef KEEPSHAREDLIBS
-	@echo "Removing shared library images (old & current)..."
-	@for i in $(OBSOLETELDIRS); do \
-	    rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
-         done
-endif
 	@echo Installing shared library image as \
 		$(addprefix $(sharedlibdir)/,$(notdir $(SHAREDLIBS))).
 	@for foo in $(notdir $(SHAREDLIBS)); do \
 		$(INSTALL_SHLIB) sharedlib/$$foo $(sharedlibdir)/$$foo; \
-		(cd $(sharedlibdir); \
-		 ln -sf $$foo `echo $$foo | sed 's/\.so\..*/.so/'` ); \
+		cp -d sharedlib/`echo $$foo | sed 's/\.so\..*/.so/'` $(sharedlibdir); \
+		cp -d sharedlib/`echo $$foo | sed 's/\.so\..*/.so/'`.$(MAJOR_VER) $(sharedlibdir); \
 	done
-	@./fixldsoconf
-	@ldconfig
 
 installstaticlib: static
 	@echo Installing static libraries in $(libdir).
 	@mkdir -p $(libdir)
-	@rm -f /usr/lib/libvga.a
 	@$(INSTALL_DATA) staticlib/libvga.a $(libdir)/libvga.a
 	@chmod a+r $(libdir)/libvga.a
-	@rm -f /usr/lib/libvgagl.a
 	@$(INSTALL_DATA) staticlib/libvgagl.a $(libdir)/libvgagl.a
 	@chmod a+r $(libdir)/libvgagl.a
 
@@ -130,14 +112,6 @@
 		echo No $(bindir) directory, creating it.; \
 		mkdir -p $(bindir); \
 	fi
-	@if [ -f /usr/bin/restorefont ]; then \
-		echo Removing old utilities in /usr/bin.; \
-		for x in $(UTILS); do rm -f /usr/bin/$$x; done; \
-	fi
-	@if [ -f /usr/bin/convfont ]; then \
-		echo Removing inappropriate utilities in /usr/bin.; \
-		rm -f /usr/bin/convfont /usr/bin/setmclk; \
-	fi
 	@echo Installing textmode utilities in $(bindir):
 	@echo "restorefont:      Save/restore textmode font."
 	@$(INSTALL_PROGRAM) utils/restorefont $(bindir)
@@ -152,8 +126,10 @@
 	@echo "savetextmode:     Script that saves textmode information used by 'textmode'."
 	@$(INSTALL_SCRIPT) utils/savetextmode $(bindir)
 ifeq ($(LRMI),lrmi)
-	@echo "mode3:       Restore textmode by setting VESA mode 3."
+	@echo "mode3:            Restore textmode by setting VESA mode 3."
 	@$(INSTALL_PROGRAM) lrmi-0.6m/mode3 $(bindir)
+	@echo "vga_reset:        Restore textmode by resetting graphic board."
+	@cp lrmi-0.6m/vga_reset $(bindir)
 endif
 	@echo "Installing keymap utilities in $(bindir):"
 	@echo "svgakeymap:       Perl script that generates scancode conversion maps."
@@ -222,34 +198,6 @@
 	@echo demos/ and threedkit/.
 
 uninstall:
-	@echo "Removing textmode utilities..."
-	@for i in $(OBSOLETEBDIRS); do \
-          for prog in $(UTILS); do \
-            rm -f $$i$$prog ; \
-          done ; \
-         done
-	@echo "Removing shared library stubs (old & current)..."
-	@for i in $(OBSOLETELDIRS); do \
-	    rm -f `echo /lib/libvga.so.$(VERSION) /lib/libvgagl.so.$(VERSION) \
-			$(OBSOLETELIBLINKS) /lib/libvga.sa /lib/libvgagl.sa \
-		     | sed s?/lib/?$$i?g`; \
-         done
-ifndef KEEPSHAREDLIBS
-	@echo "Removing shared library images (old & current)..."
-	@for i in $(OBSOLETELDIRS); do \
-	    rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
-         done
-endif
-	@echo "Removing static libraries..."
-	@for i in $(OBSOLETELDIRS); do \
-	    rm -f `echo /lib/libvga.a /lib/libvgagl.a | sed s?/lib/?$$i?g`; \
-         done
-	@echo "Removing header files..."
-	@for i in $(OBSOLETEHDIRS); do \
-	    rm -f `echo $(OBSOLETEHEADERS) | sed s?/inc/?$$i?g`; \
-         done
-	(cd doc; $(MAKE) -f $(SRCDIR)/doc/Makefile SRCDIR="$(SRCDIR)" uninstall)
-	 
 
 SHAREDDIRS0 = sharedlib/mouse sharedlib/keyboard sharedlib/ramdac \
 		sharedlib/clockchip sharedlib/joystick \
@@ -335,7 +283,6 @@
 
 distclean:
 	(cd $(SRCDIR)/doc; $(MAKE) clean)
-	(cd $(SRCDIR)/doc; $(MAKE) ../0-README)
 	(cd $(SRCDIR)/src; $(MAKE) clean)
 	(cd $(SRCDIR)/gl; $(MAKE) clean)
 	(cd $(SRCDIR)/utils; $(MAKE) clean)
--- svgalib-1.9.21/threeDKit/Makefile.makefiles	2004-09-16 19:54:17.000000000 +0200
+++ svgalib-1.9.21/threeDKit/Makefile	2005-07-08 21:16:12.000000000 +0200
@@ -14,7 +14,7 @@
 # Compiler Section (overrides Makefile.cfg)
 #----------------------------------------------------------------------
 
-INCLUDES += -I$(srcdir)/src
+INCLUDES += -I$(srcdir)/src -I$(srcdir)/gl
 
 #----------------------------------------------------------------------
 # Rules Section
@@ -58,7 +58,7 @@
 $(sharedlibdir)/lib3dkit.so.$(VERSION): lib3dkit.so.$(VERSION)
 	$(INSTALL_SHLIB) $< $(sharedlibdir)/$<
 	(cd $(sharedlibdir); ln -sf lib3dkit.so.$(VERSION) `echo lib3dkit.so.$(VERSION) | sed 's/\.so\..*/.so/'` )
-	ldconfig
+	(cd $(sharedlibdir); ln -sf lib3dkit.so.$(VERSION) `echo lib3dkit.so.$(VERSION) | sed 's/\.so\..*/.so/'`.$(MAJOR_VER) )
 
 install: $(sharedlibdir)/lib3dkit.so.$(VERSION) installheaders
 
--- svgalib-1.9.21/src/Makefile.makefiles	2005-02-03 12:31:43.000000000 +0100
+++ svgalib-1.9.21/src/Makefile	2005-07-08 21:16:12.000000000 +0200
@@ -448,13 +445,16 @@
 libvga.so.$(VERSION): $(ALLOBJS)
 	$(CC) -shared -Wl,-soname,libvga.so.$(MAJOR_VER) \
 	-Xlinker --retain-symbols-file -Xlinker ../src/exports \
-	-Wl,-Bsymbolic -o libvga.so.$(VERSION) $(ALLOBJS) -lm
+	-Wl,-Bsymbolic -o libvga.so.$(VERSION) $(ALLOBJS) $(SHLIBLIBS) -lm
+	ln -sf libvga.so.$(VERSION) libvga.so
+	ln -sf libvga.so.$(VERSION) libvga.so.$(MAJOR_VER)
 
 $(sharedlibdir)/libvga.so.$(VERSION): libvga.so.$(VERSION)
 	$(INSTALL_SHLIB) $< $(sharedlibdir)/$<
-	ldconfig
 
 install: $(sharedlibdir)/libvga.so.$(VERSION)
+	cp -df sharedlib/libvga.so $(sharedlibdir)/
+	cp -df sharedlib/libvga.so.$(MAJOR_VER) $(sharedlibdir)/
 
 endif	  
 
@@ -471,9 +471,11 @@
 vga.o: vga.c
 	$(CC) $(CFLAGS) $(VGA_DEFINES) -c -o $@ $<
 
-#lrmi must NOT be compiled as -fPIC
+# XXX: Upstream used this so it may break, disabled to close an RC
+# lrmi must NOT be compiled as -fPIC
 lrmi.o: lrmi.c
-	$(CC) $(CFLAGS:-fPIC=) -c -o $@ $<
+	$(CC) $(CFLAGS) -c -o $@ $<
+#	$(CC) $(CFLAGS:-fPIC=) -c -o $@ $<
 
 $(RAMDAC): %.o: %.c
 	$(CC) $(CFLAGS) $(RAMDAC_DEFINES) -c -o $@ $<
--- svgalib-1.9.21/gl/Makefile.makefiles	1999-07-18 10:14:45.000000000 +0200
+++ svgalib-1.9.21/gl/Makefile	2005-07-08 21:43:10.000000000 +0200
@@ -28,9 +28,12 @@
 all:	libvgagl.a
 .PHONY: all clean dep
 
+libvgagl.so: libvgagl.so.$(VERSION)
 libvgagl.so.$(VERSION): $(MODULES)
-	$(CC) -s -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \
-	  $(MODULES)
+	$(CC) -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \
+	  $(MODULES) $(SHLIBLIBS) -L$(srcdir)/sharedlib -lvga
+	ln -sf libvgagl.so.$(VERSION) libvgagl.so
+	ln -sf libvgagl.so.$(VERSION) libvgagl.so.$(MAJOR_VER)
 
 libvgagl.a: $(MODULES)
 	rm -f libvgagl.a
@@ -63,7 +66,7 @@
 	$(CC) $(INCLUDES) -MM $(patsubst %.o,$(srcdir)/gl/%.c,$(MODULES)) >>.depend.gl
 
 clean:
-	rm -f .depend.gl *.bak *.o *~ libvgagl.a libvgagl.so.$(VERSION)
+	rm -f .depend.gl *.bak *.o *~ libvgagl.a libvgagl.so*
 
 #
 # include a dependency file if one exists

svgalib-1.9.21-wip.patch:

--- NEW FILE svgalib-1.9.21-wip.patch ---
Only in svgalib-1.9.21: debugfiles.list
Only in svgalib-1.9.21: debugsources.list
Only in svgalib-1.9.21: sharedlib
diff -urBbw svgalib-1.9.21.orig/src/drivers/fbdev.c svgalib-1.9.21/src/drivers/fbdev.c
--- svgalib-1.9.21.orig/src/drivers/fbdev.c	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/src/drivers/fbdev.c	2005-07-30 09:16:04.000000000 +0200
@@ -139,16 +139,18 @@
 
 static void fbdev_setpage(int page)
 {
-	static int oldpage = 0;
-
-	if (page != oldpage)
+	if (fbdev_vgamode)
+	{
+		__svgalib_vga_driverspecs.__svgalib_setpage(page);
+	}
+	else
 	{
 			mmap(BANKED_POINTER,
 			     __svgalib_banked_mem_size,
 			     PROT_READ | PROT_WRITE,
 			     MAP_SHARED | MAP_FIXED,
 			     fbdev_fd, page << 16);
-		oldpage = page;
+		fbdev_banked_pointer_emulated = 1;
 	}
 }
 
@@ -239,8 +241,10 @@
 {
 	struct fb_var_screeninfo info;
 
-	if (!__svgalib_fbdev_novga && IS_IN_STANDARD_VGA_DRIVER(mode))
+	if (IS_IN_STANDARD_VGA_DRIVER(mode))
 	{
+		if (__svgalib_fbdev_novga)
+			return 1;
 		if (__svgalib_vga_driverspecs.setmode(mode, prv_mode))
 			return 1;
 		if (fbdev_banked_pointer_emulated)
@@ -288,8 +292,13 @@
 	struct fb_var_screeninfo info;
 	unsigned g, bpp;
 
-	if (!__svgalib_fbdev_novga && IS_IN_STANDARD_VGA_DRIVER(mode))
+	if (IS_IN_STANDARD_VGA_DRIVER(mode))
+	{
+		if (__svgalib_fbdev_novga)
+			return 0;
+		else
 		return __svgalib_vga_driverspecs.modeavailable(mode);
+	}
 
 	if (fbdev_screeninfo(&info, mode))
 		return 0;
@@ -356,7 +365,7 @@
 	struct fb_var_screeninfo info;
 	int maxpixels = fbdev_memory;
 
-	if (!__svgalib_fbdev_novga && IS_IN_STANDARD_VGA_DRIVER(mode))
+	if (IS_IN_STANDARD_VGA_DRIVER(mode))
 		return __svgalib_vga_driverspecs.getmodeinfo(mode, modeinfo);
 
 	if (modeinfo->bytesperpixel)
Only in svgalib-1.9.21/src/drivers: fbdev.c.wip
Only in svgalib-1.9.21/src: svgalib_helper.h
diff -urBbw svgalib-1.9.21.orig/src/vga.c svgalib-1.9.21/src/vga.c
--- svgalib-1.9.21.orig/src/vga.c	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/src/vga.c	2005-07-30 15:18:46.000000000 +0200
@@ -471,8 +471,13 @@
 static unsigned long graph_buf_size = 0;
 static unsigned char *graph_buf = NULL;		/* saves graphics data during flip */
 
-static unsigned char *font_buf1=NULL;	/* saved font data - plane 2 */
-static unsigned char *font_buf2=NULL;	/* saved font data - plane 3 */
+/* The format of the fontdata seems to differ between banked and LFB access,
+   so we save both in case emulatepage gets set between saving and restoring.
+   This can happen when using runinbackground in nohelper secure mode. */
+static unsigned char *font_buf1_banked=NULL;	/* saved font data - plane 2 */
+static unsigned char *font_buf2_banked=NULL;	/* saved font data - plane 3 */
+static unsigned char *font_buf1_linear=NULL;	/* saved font data - plane 2 */
+static unsigned char *font_buf2_linear=NULL;	/* saved font data - plane 3 */
 static unsigned char *text_buf1=NULL;	/* saved text data - plane 0 */
 static unsigned char *text_buf2=NULL;	/* saved text data - plane 1 */
 
@@ -859,8 +864,49 @@
 
 static void __svgalib_giveup_perm(void)
 {
-    if (CHIPSET != FBDEV)
+    if (CHIPSET != FBDEV) {
         __svgalib_linear_mem_phys_addr = __svgalib_linear_mem_base;
+        /* Try get a pure handle to the LFB which can safely be left open
+           at all times, this will only work with 2.6 kernels.
+           This could be done in helper mode too, but we don't know the
+           real pci ID there, only the helper module id. Also this
+           is not usefull in helpermode since mem_fd must always be left
+           open in helpermode. */
+        if (__svgalib_nohelper) {
+            unsigned int bus, device, fn;
+            char buf[256];
+            FILE *f;
+            int i, fd;
+            
+            bus=(__svgalib_pci_card_found_at&0xff00)>>8;
+            device=(__svgalib_pci_card_found_at&0xf8)>>3;
+            fn=__svgalib_pci_card_found_at&0x07;
+            snprintf(buf, 256, "/sys/bus/pci/devices/0000:%02u:%02x.%u/resource",
+                bus, device, fn);
+                
+            f = fopen(buf, "r");
+            if (f) {
+                for (i=0; fgets(buf, 256, f); i++) {
+                    if (strtoul(buf, NULL, 16) == __svgalib_linear_mem_base) {
+                       snprintf(buf, 256,
+                          "/sys/bus/pci/devices/0000:%02u:%02x.%u/resource%i",
+                          bus, device, fn, i);
+                       fd = open(buf, O_RDWR);
+                       if (fd != -1) {
+                           __svgalib_linear_mem_fd = fd;
+                           __svgalib_linear_mem_base = 0;
+#ifdef DEBUG
+                           fprintf(stderr, "svgalib: debug: Opened: %s as LFB\n",
+                               buf);
+#endif
+                       }
+                       break;
+                    }
+                }
+                fclose(f);
+            }
+        }
+    }
 
     /* mmap graphics memory */
     map_mem();
@@ -902,7 +948,7 @@
 
 static void slowcpy(unsigned char *dest, unsigned char *src, unsigned bytes)
 {
-	if(dest==NULL || src==NULL || (int)dest==-1 || (int)src==-1) return;
+	if(dest==NULL || src==NULL || (long)dest==-1L || (long)src==-1L) return;
     while (bytes > 0) {
 	*(uint32_t *)dest = *(uint32_t *)src;
         dest+=4;
@@ -1649,16 +1695,30 @@
         save_text();
 
         /* Allocate space for textmode font. */
-        font_buf1 = malloc(FONT_SIZE * 2);
-        font_buf2 = font_buf1 + FONT_SIZE;
+        if (!__svgalib_emulatepage)
+        {
+            font_buf1_banked = malloc(FONT_SIZE * 2);
+            font_buf2_banked = font_buf1_banked + FONT_SIZE;
+        }
+        if (LINEAR_POINTER)
+        {
+            font_buf1_linear = malloc(FONT_SIZE * 2);
+            font_buf2_linear = font_buf1_linear + FONT_SIZE;
+        }
 
     /* save font data in plane 2 */
         __svgalib_outgra(0x04,0x02);
-        slowcpy(font_buf1, GM, FONT_SIZE);
+        if (!__svgalib_emulatepage)
+            slowcpy(font_buf1_banked, GM, FONT_SIZE);
+        if (LINEAR_POINTER)
+            slowcpy(font_buf1_linear, LINEAR_POINTER, FONT_SIZE);
 
         /* save font data in plane 3 */
         __svgalib_outgra(0x04,0x03);
-        slowcpy(font_buf2, GM, FONT_SIZE);
+        if (!__svgalib_emulatepage)
+            slowcpy(font_buf2_banked, GM, FONT_SIZE);
+        if (LINEAR_POINTER)
+            slowcpy(font_buf2_linear, LINEAR_POINTER, FONT_SIZE);
 #endif
     }
     initialized = 1;
@@ -1907,11 +1967,17 @@
 	  /* restore font data in plane 2 - necessary for all VGA's */
           __svgalib_outseq(0x02,0x04);
 
-	  slowcpy(GM, font_buf1, FONT_SIZE);
+          if (__svgalib_emulatepage)
+	      slowcpy(LINEAR_POINTER, font_buf1_linear, FONT_SIZE);
+          else
+	      slowcpy(GM, font_buf1_banked, FONT_SIZE);
 
 	  /* restore font data in plane 3 - necessary for Trident VGA's */
           __svgalib_outseq(0x02,0x08);
-	  slowcpy(GM, font_buf2, FONT_SIZE);
+          if (__svgalib_emulatepage)
+	      slowcpy(LINEAR_POINTER, font_buf2_linear, FONT_SIZE);
+          else
+	      slowcpy(GM, font_buf2_banked, FONT_SIZE);
 	  fontloadingcomplete();
 #endif
 	  /* change register adresses if monochrome text mode */
@@ -1935,11 +2001,17 @@
           __svgalib_outgra(4,2);
           __svgalib_outgra(5,0);
           __svgalib_outgra(6,0);
-	  slowcpy(GM, font_buf1, FONT_SIZE);
+          if (__svgalib_emulatepage)
+	      slowcpy(LINEAR_POINTER, font_buf1_linear, FONT_SIZE);
+          else
+	      slowcpy(GM, font_buf1_banked, FONT_SIZE);
           __svgalib_outseq(2,2);
 	  slowcpy(GM, text_buf2, FONT_SIZE);
           __svgalib_outseq(2,1);
-	  slowcpy(GM, font_buf1, FONT_SIZE);
+          if (__svgalib_emulatepage)
+	      slowcpy(LINEAR_POINTER, font_buf1_linear, FONT_SIZE);
+          else
+	      slowcpy(GM, font_buf1_banked, FONT_SIZE);
           __svgalib_outseq(0,1);
           __svgalib_outseq(2,3);
           __svgalib_outseq(4,3);
@@ -1993,11 +2065,17 @@
               __svgalib_outgra(4,2);
               __svgalib_outgra(5,0);
               __svgalib_outgra(6,0);
-	      slowcpy(font_buf1, GM, FONT_SIZE);
+              if (__svgalib_emulatepage)
+		      slowcpy(font_buf1_linear, LINEAR_POINTER, FONT_SIZE);
+              else
+		      slowcpy(font_buf1_banked, GM, FONT_SIZE);
               __svgalib_outgra(4,1);
 	      slowcpy(text_buf2, GM, FONT_SIZE);
               __svgalib_outseq(4,0);
-	      slowcpy(font_buf1, GM, FONT_SIZE);
+              if (__svgalib_emulatepage)
+		      slowcpy(font_buf1_linear, LINEAR_POINTER, FONT_SIZE);
+              else
+		      slowcpy(font_buf1_banked, GM, FONT_SIZE);
               __svgalib_outseq(0,1);
               __svgalib_outseq(2,3);
               __svgalib_outseq(4,3);
@@ -2078,7 +2156,7 @@
 		mouse_mode = mode;
 	} 
 		if (__svgalib_emulatepage && (modeinfo->flags & CAPABLE_LINEAR) &&
-				!(modeinfo->flags & IS_LINEAR)) {
+				!(modeinfo->flags & LINEAR_USE)) {
 			__svgalib_driverspecs->linear(LINEAR_ENABLE, 0);
 			__svgalib_modeinfo_linearset |= IS_LINEAR;
 	}
@@ -2097,6 +2175,12 @@
 void vga_gettextfont(void *font)
 {
     unsigned int getsize;
+    unsigned char *font_buf1;
+    
+    if (__svgalib_emulatepage)
+        font_buf1 = font_buf1_linear;
+    else
+        font_buf1 = font_buf1_banked;
 
     /* robert at debian.org, May, 26th 2002: check for valid font_buf buffer */
     if (!font_buf1) {
@@ -2115,6 +2199,15 @@
 void vga_puttextfont(void *font)
 {
     unsigned int putsize;
+    unsigned char *font_buf1, *font_buf2;
+    
+    if (__svgalib_emulatepage) {
+        font_buf1 = font_buf1_linear;
+        font_buf2 = font_buf2_linear;
+    } else {
+        font_buf1 = font_buf1_banked;
+        font_buf2 = font_buf2_banked;
+    }
 
     /* robert at debian.org, May, 26th 2002: check for valid font_buf buffer */
     if (!font_buf1 || !font_buf2) {
@@ -2236,7 +2328,7 @@
 
     modeinfo = vga_getmodeinfo(mode);
     if (__svgalib_emulatepage && (mode!=G320x200x256) &&
-        !(modeinfo->flags & (CAPABLE_LINEAR|IS_LINEAR)))
+        !(modeinfo->flags & (CAPABLE_LINEAR|LINEAR_USE)))
         return 0;
 
     return 1;
@@ -3603,6 +3695,7 @@
         break;
 #else
        fprintf(stderr,"svgalib: Warning: VESA support not enabled!\n");
+       break;
 #endif
     case 57: /* Vesa save bitmap */  
 #ifdef INCLUDE_VESA_DRIVER
@@ -3915,21 +4008,51 @@
 	__svgalib_come_from_background = va_arg(params, void *);
 	break;
     default:
-    	    if (__svgalib_nohelper && __svgalib_nohelper_secure && stat) {
+        if ( ( stat &&  __svgalib_runinbackground) || 
+             (!stat && !__svgalib_runinbackground) )
+             break; /* nothing todo */
+        if (stat) {
+          if (__svgalib_readpage != __svgalib_writepage) {
+    	    fprintf(stderr,
+    	      "svgalib: Warning runinbackground does not support seperate\n"
+    	      "read- and writepages, ignoring runinbackground request.\n");
+    	    break;
+          }
+          if (__svgalib_mem_fd == -1) {
+            vga_modeinfo *modeinfo = vga_getmodeinfo(CM);
+            /* we don't have /dev/mem available so we can't do runinbackground
+               with the real banked mem, see if we do have an fd for the LFB
+               and if it is ok to switch to emulating pages. */
+    	    if ((__svgalib_linear_mem_fd != -1) && ( (CM == TEXT) || (
+    	        ( (modeinfo->flags & CAPABLE_LINEAR) ||
+    	          (modeinfo->flags & LINEAR_USE) ) &&
+    	        (!STDVGAMODE(CM) || (CM == G320x200x256)) ))) {
+    	        /* only do this if we are not already emulating pages */
+    	        if (!__svgalib_emulatepage)
+    	        {
+                    __svgalib_emulatepage=1;
+                    __svgalib_setrdpage=NULL;
+                    __svgalib_setwrpage=NULL;
+                    if (CM != TEXT) {
+                        (*__svgalib_setpage)(vga_page_offset);
+                        if ((modeinfo->flags & CAPABLE_LINEAR) &&
+                            !(modeinfo->flags & LINEAR_USE)) {
+                            __svgalib_driverspecs->linear(LINEAR_ENABLE, 0);
+                            __svgalib_modeinfo_linearset |= IS_LINEAR;
+                        }
+                    }
+                    map_banked(MAP_FIXED);
+                }
+    	    } else {
             	fprintf(stderr,
                 	"svgalib: Warning runinbackground not supported in nohelper mode, ignoring\n"
 	                "  runinbackground request. Program should check vga_runinbackground_version\n"
     	            "  before calling vga_runinbackground\n");
         	    break;
 	        }
-    	    if (stat && (__svgalib_readpage != __svgalib_writepage)) {
-    	        fprintf(stderr,
-	                "svgalib: Warning runinbackground does not support seperate "
-					"read- and writepages, ignoring\n"
-        	        "  runinbackground request.\n");
-        break;
 }
-        	if (!stat)
+        }
+        else /* if (stat) */
             	__svgalib_waitvtactive();
 
 	        __svgalib_runinbackground = stat;
@@ -3939,11 +4062,11 @@
 /*  Program can check, if it is safe to in background. */
 int vga_runinbackground_version(void)
 {
-    /* we need to read the configfile here to get the correct value
-       for __svgalib_nohelper and __svgalib_nohelper_secure */
-    readconfigfile();
+    /* getchipset opens, maps and perhaps closes the LFB,
+       we need an open LFB to be able to runinbackground */
+    __svgalib_getchipset();
     
-    if (__svgalib_nohelper && __svgalib_nohelper_secure)
+    if (__svgalib_linear_mem_fd == -1)
         return 0;
  
     return 3;
Only in svgalib-1.9.21/src: vga.c.wip
Only in svgalib-1.9.21/src: vga.c~
diff -urBbw svgalib-1.9.21.orig/src/vgapci.c svgalib-1.9.21/src/vgapci.c
--- svgalib-1.9.21.orig/src/vgapci.c	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/src/vgapci.c	2005-07-30 09:16:04.000000000 +0200
@@ -10,6 +10,7 @@
 
 int __svgalib_pci_helper_idev=0;
 int __svgalib_pci_nohelper_idev=0;
+int __svgalib_pci_card_found_at=0;
 
 static void proc_pci_read_config(int device, unsigned int *buf, int size)
 {
@@ -57,6 +58,7 @@
 		if(((conf[0]&0xffff)==vendor)&&
 				(((conf[2]>>16)&0xffff)==0x0300)) { /* VGA Class */
 			proc_pci_read_config(device,conf,16);
+                __svgalib_pci_card_found_at = device;
                 return device;
 		}
 	}
Only in svgalib-1.9.21/src: vgapci.c.wip
diff -urBbw svgalib-1.9.21.orig/src/vgapci.h svgalib-1.9.21/src/vgapci.h
--- svgalib-1.9.21.orig/src/vgapci.h	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/src/vgapci.h	2005-07-30 09:16:04.000000000 +0200
@@ -1,6 +1,7 @@
 extern int __svgalib_pci_find_vendor_vga_pos(unsigned int vendor, unsigned int *conf);
 extern int __svgalib_pci_helper_idev;
 extern int __svgalib_pci_nohelper_idev;
+extern int __svgalib_pci_card_found_at;
 extern void __svgalib_pci_write_config_dword(int pos, int address, unsigned int data);
 extern unsigned int __svgalib_pci_read_config_dword(int pos, int address);
 extern unsigned long __svgalib_pci_read_aperture_len(int pos, int address);
Only in svgalib-1.9.21/src: vgapci.h.wip
Only in svgalib-1.9.21/threeDKit: 3dinit.o
Only in svgalib-1.9.21/threeDKit: 3dkit.o
Only in svgalib-1.9.21/threeDKit: lib3dkit.so.1.9.22
Only in svgalib-1.9.21/threeDKit: quickmath.o
Only in svgalib-1.9.21/threeDKit: swtriangle.o
Only in svgalib-1.9.21/threeDKit: triangl.o
Only in svgalib-1.9.21/threeDKit: triangle.o
Only in svgalib-1.9.21/threeDKit: wrapsurf.o
Only in svgalib-1.9.21/threeDKit: wtriangle.o
Only in svgalib-1.9.21/utils: .depend
Only in svgalib-1.9.21/utils: convfont
Only in svgalib-1.9.21/utils: convfont.o
Only in svgalib-1.9.21/utils: dumpreg
Only in svgalib-1.9.21/utils: dumpreg.o
Only in svgalib-1.9.21/utils: gtfcalc
Only in svgalib-1.9.21/utils: restorefont
Only in svgalib-1.9.21/utils: restorefont.o
Only in svgalib-1.9.21/utils: restorepalette
Only in svgalib-1.9.21/utils: restorepalette.o
Only in svgalib-1.9.21/utils: restoretextmode
Only in svgalib-1.9.21/utils: restoretextmode.o

svgalib-1.9.21-wip2.patch:

--- NEW FILE svgalib-1.9.21-wip2.patch ---
Only in svgalib-1.9.21: debugfiles.list
Only in svgalib-1.9.21: debugsources.list
diff -urbBw svgalib-1.9.21.orig/demos/accel.c svgalib-1.9.21/demos/accel.c
--- svgalib-1.9.21.orig/demos/accel.c	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/demos/accel.c	2005-08-03 13:22:23.000000000 +0200
@@ -924,7 +924,8 @@
 void QixDemo(int rop, char *txt) {
     int current = 0, dx1, dy1, dx2, dy2, i, cols = 1, cx1, cx2, cy1, cy2;
     int startclock, diffclock;
-    unsigned long pixels = 0, numlines = 0;
+    unsigned long pixels = 0;
+    unsigned int  numlines = 0;
     struct {
 	unsigned short x1;	
 	unsigned short y1;	
diff -urbBw svgalib-1.9.21.orig/demos/memset.c svgalib-1.9.21/demos/memset.c
--- svgalib-1.9.21.orig/demos/memset.c	2002-07-20 18:58:13.000000000 +0200
+++ svgalib-1.9.21/demos/memset.c	2005-08-03 13:22:23.000000000 +0200
@@ -26,7 +26,7 @@
 
 #undef memset
 
-#define op_t unsigned long int
+#define op_t unsigned int
 #define OPSIZ 4
 
 
Only in svgalib-1.9.21/demos: memset.c.wip2
diff -urbBw svgalib-1.9.21.orig/demos/spin.c svgalib-1.9.21/demos/spin.c
--- svgalib-1.9.21.orig/demos/spin.c	2000-01-06 13:12:36.000000000 +0100
+++ svgalib-1.9.21/demos/spin.c	2005-08-03 13:22:23.000000000 +0200
@@ -78,9 +78,9 @@
 
 #define HORIZONTAL	0
 
-typedef unsigned int WORD;
+typedef unsigned short WORD;
 typedef unsigned char BYTE;
-typedef unsigned long DWORD;
+typedef unsigned int   DWORD;
 
 typedef struct {
 	float x, y, z;
Only in svgalib-1.9.21/demos: spin.c.wip2
diff -urbBw svgalib-1.9.21.orig/gl/driver.c svgalib-1.9.21/gl/driver.c
--- svgalib-1.9.21.orig/gl/driver.c	2000-04-18 11:45:18.000000000 +0200
+++ svgalib-1.9.21/gl/driver.c	2005-08-03 13:22:23.000000000 +0200
@@ -1135,7 +1135,7 @@
 {
     char *vp;
     ASSIGNVP32(x1, y, vp);
-    __memsetlong(vp, c, x2 - x1 + 1);
+    __memset4(vp, c, x2 - x1 + 1);
 }
 
 void __svgalib_driver32p_hline(int x1, int y, int x2, int c)
@@ -1148,11 +1148,11 @@
     SETWRITEPAGED(vp, rvp, chunksize, page);
     l = (x2 - x1 + 1) * 4;
     if (l <= chunksize)
-	__memsetlong(rvp, c, l / 4);
+	__memset4(rvp, c, l / 4);
     else {
-	__memsetlong(rvp, c, chunksize / 4);
+	__memset4(rvp, c, chunksize / 4);
 	vga_setpage(page + 1);
-	__memsetlong(VBUF, c, (l - chunksize) / 4);
+	__memset4(VBUF, c, (l - chunksize) / 4);
     }
 }
 
@@ -1162,7 +1162,7 @@
     int i;
     ASSIGNVP32(x, y, vp);
     for (i = 0; i < h; i++) {
-	__memsetlong(vp, c, w);
+	__memset4(vp, c, w);
 	vp += BYTEWIDTH;
     }
 }
@@ -1183,15 +1183,15 @@
 		vga_setpage(page);
 		vp &= 0xffff;
 	    } else {		/* page break within line */
-		__memsetlong(VBUF + vp, c, (0x10000 - vp) / 4);
+		__memset4(VBUF + vp, c, (0x10000 - vp) / 4);
 		page++;
 		vga_setpage(page);
-		__memsetlong(VBUF, c, ((vp + w * 4) & 0xffff) / 4);
+		__memset4(VBUF, c, ((vp + w * 4) & 0xffff) / 4);
 		vp = (vp + BYTEWIDTH) & 0xffff;
 		continue;
 	    }
         };
-	__memsetlong(VBUF + vp, c, w);
+	__memset4(VBUF + vp, c, w);
 	vp += BYTEWIDTH;
     }
 }
Only in svgalib-1.9.21/gl: driver.c.wip2
diff -urbBw svgalib-1.9.21.orig/gl/inlstring.h svgalib-1.9.21/gl/inlstring.h
--- svgalib-1.9.21.orig/gl/inlstring.h	2005-04-17 09:07:19.000000000 +0200
+++ svgalib-1.9.21/gl/inlstring.h	2005-08-03 13:22:23.000000000 +0200
@@ -11,9 +11,8 @@
 #define __memsetb(dst,c,n)			memset((dst),(c),(n))
 #define __memset(dst,c,n)			memset((dst),(c),(n))
 
-static inline void *__memsetlong(void *s, long c, size_t count) {
-    long *p=s;
-    int i;
+static inline void *__memset4(void *s, int c, size_t count) {
+    int i, *p=s;
     for(i=0;i<count;i++)*p++=c;
     return s;
 }
@@ -25,7 +24,7 @@
     return s;
 }
 
-static inline void *__memset3(void *s, short c, size_t count) {
+static inline void *__memset3(void *s, int c, size_t count) {
     unsigned char *p=s;
     int i;
     for(i=0;i<count;i++) {
@@ -96,7 +95,7 @@
 }
 
 static inline void *
- __memsetlong(void *s, unsigned c, size_t count)
+ __memset4(void *s, unsigned c, size_t count)
 {
   long dummy1;
   int dummy2;
Only in svgalib-1.9.21/gl: inlstring.h.wip2
diff -urbBw svgalib-1.9.21.orig/gl/line.c svgalib-1.9.21/gl/line.c
--- svgalib-1.9.21.orig/gl/line.c	2000-04-18 10:47:33.000000000 +0200
+++ svgalib-1.9.21/gl/line.c	2005-08-03 13:22:23.000000000 +0200
@@ -204,7 +204,7 @@
 		    *((unsigned char *) (vp + 1)) = (c>>8);    \
 		    *((unsigned char *) (vp + 2)) = (c>>16);
 
-#define insert_pixel_4 *((unsigned long *) vp) = c;
+#define insert_pixel_4 *((unsigned int *) vp) = c;
 
     bytesperrow = BYTEWIDTH;
 
@@ -301,7 +301,7 @@
 		    *((unsigned char *) (vp + fp + 1)) = (c>>8);    \
 		    *((unsigned char *) (vp + fp + 2)) = (c>>16);
 
-#define insert_pixel_4 *((unsigned long *) (vp + fp)) = c;
+#define insert_pixel_4 *((unsigned int *) (vp + fp)) = c;
 
 
     if (MODETYPE == CONTEXT_PAGED) {
Only in svgalib-1.9.21/gl: line.c.wip2
Only in svgalib-1.9.21: sharedlib
diff -urbBw svgalib-1.9.21.orig/src/clockchip/clockchip.h svgalib-1.9.21/src/clockchip/clockchip.h
--- svgalib-1.9.21.orig/src/clockchip/clockchip.h	1997-06-22 17:46:22.000000000 +0200
+++ svgalib-1.9.21/src/clockchip/clockchip.h	2005-08-03 13:22:23.000000000 +0200
@@ -25,7 +25,7 @@
     void (*DAC_restoreState) (const unsigned char *regs);
     void (*DAC_initializeState) (unsigned char *regs, int bpp, int colormode,
 				 int pixelclock);
-    long TextFrequency;
+    int TextFrequency;
     int DAC_stateSize;
 } ClockChipMethods;
 
Only in svgalib-1.9.21/src/clockchip: clockchip.h.wip2
diff -urbBw svgalib-1.9.21.orig/src/clockchip/icd2061a.c svgalib-1.9.21/src/clockchip/icd2061a.c
--- svgalib-1.9.21.orig/src/clockchip/icd2061a.c	2004-09-10 13:12:14.000000000 +0200
+++ svgalib-1.9.21/src/clockchip/icd2061a.c	2005-08-03 13:22:23.000000000 +0200
@@ -43,7 +43,7 @@
 {50.0, 51.0, 53.2, 58.5, 60.7, 64.4, 66.8, 73.5,
  75.6, 80.9, 83.2, 91.5, 100.0, 120.0, 120.0000001};
 
-static long I2061A_SelectClock(long frequency)
+static int I2061A_SelectClock(int frequency)
 				/* in KHz */
 {
     unsigned int m;
@@ -99,10 +99,10 @@
 	    }
 	}
     }
-    return ((((((long) besti << 7) | (bestp - 3)) << 3) | bestm) << 7) | (bestq - 2);
+    return ((((((int) besti << 7) | (bestp - 3)) << 3) | bestm) << 7) | (bestq - 2);
 }
 
-static int I2061A_GetClock(long dwv)
+static int I2061A_GetClock(int dwv)
 {
     int clock_q = (dwv & 0x7f) + 2;
     int clock_m = (dwv >> 7) & 7;
@@ -117,7 +117,7 @@
 #define wrt_clk_bit(v) port_out_r(MIS_W, v), (void)port_in(crtcaddr), (void)port_in(crtcaddr)
 
 /* ATTENTION: This assumes CRTC registers and S3 registers to be UNLOCKED! */
[...2055 lines suppressed...]
 
     int dir;
-    long X;
+    int X;
 
-    long nz;
-    long g0, g1h = 0, g1l = 0;
+    int nz;
+    int g0, g1h = 0, g1l = 0;
 #ifdef INTERP
-    long c0;
-    long c_y;
+    int c0;
+    int c_y;
 #endif
 #ifdef WRAP
-    long X0, Y0;
+    int X0, Y0;
     int bf = tri->bf;
-    long xd_y, yd_y;
+    int xd_y, yd_y;
 #endif
 
     dir = 1;
@@ -197,11 +197,11 @@
 
     if (y2 == y0)
 	return;
-    g0 = ((long) (x2 - x0) << SHLB) / (y2 - y0);
+    g0 = ((int) (x2 - x0) << SHLB) / (y2 - y0);
     if (y1 != y0)
-	g1h = ((long) (x1 - x0) << SHLB) / (y1 - y0);
+	g1h = ((int) (x1 - x0) << SHLB) / (y1 - y0);
     if (y2 != y1)
-	g1l = ((long) (x2 - x1) << SHLB) / (y2 - y1);
+	g1l = ((int) (x2 - x1) << SHLB) / (y2 - y1);
 
     dir = dir & 1;
 
Only in svgalib-1.9.21/threeDKit: tri.c.wip2
diff -urbBw svgalib-1.9.21.orig/threeDKit/triangl.c svgalib-1.9.21/threeDKit/triangl.c
--- svgalib-1.9.21.orig/threeDKit/triangl.c	1997-10-03 20:34:37.000000000 +0200
+++ svgalib-1.9.21/threeDKit/triangl.c	2005-08-03 13:22:23.000000000 +0200
@@ -146,33 +146,33 @@
 
 
 static int px1, px2, py;
-static long c;
+static int c;
 
 #ifdef INTERP
-static long c_x;
+static int c_x;
 #endif
 
 #ifdef WRAP
-static long xd, xd_x, yd, yd_x;
+static int xd, xd_x, yd, yd_x;
 static unsigned char *dat;
 #endif
 
-static long dx0, dy0;
+static int dx0, dy0;
 
 #if defined(WRAP) && defined(INTERP)
 
 /* this must only occur once */
 
-long color_lookup[TRIANGLE_COLOR_LOOKUP_TABLE_SIZE];
-static long *_color_lookup;
+int color_lookup[TRIANGLE_COLOR_LOOKUP_TABLE_SIZE];
+static int *_color_lookup;
 
-void gl_trisetcolorlookup (int i, long c)
+void gl_trisetcolorlookup (int i, int c)
 {
     if(i < TRIANGLE_COLOR_LOOKUP_TABLE_SIZE)
 	color_lookup[i] = c;
 }
 
-long gl_trigetcolorlookup (int i)
+int gl_trigetcolorlookup (int i)
 {
     if(i < TRIANGLE_COLOR_LOOKUP_TABLE_SIZE)
 	return color_lookup[i];
@@ -189,8 +189,8 @@
 
 #else
 
-extern long color_lookup[TRIANGLE_COLOR_LOOKUP_TABLE_SIZE];
-static long *_color_lookup;
+extern int color_lookup[TRIANGLE_COLOR_LOOKUP_TABLE_SIZE];
+static int *_color_lookup;
 extern void (*tri_drawpoint) (int, int, int);
 static void (*_tri_drawpoint) (int, int, int);
 
Only in svgalib-1.9.21/threeDKit: triangl.c.wip2
Only in svgalib-1.9.21/threeDKit: triangl.o
diff -urbBw svgalib-1.9.21.orig/threeDKit/triangle.h svgalib-1.9.21/threeDKit/triangle.h
--- svgalib-1.9.21.orig/threeDKit/triangle.h	1997-06-05 23:52:43.000000000 +0200
+++ svgalib-1.9.21/threeDKit/triangle.h	2005-08-03 13:22:23.000000000 +0200
@@ -23,7 +23,7 @@
 
 void gl_striangle (int x0, int y0, int x1, int y1, int x2, int y2, int color, int bf);
 
-void gl_trisetcolorlookup (int i, long c);
-long gl_trigetcolorlookup (int i);
+void gl_trisetcolorlookup (int i, int c);
+int  gl_trigetcolorlookup (int i);
 
 void gl_trisetdrawpoint (void (setpixelfunc) (int, int, int));
Only in svgalib-1.9.21/threeDKit: triangle.h.wip2
Only in svgalib-1.9.21/threeDKit: triangle.o
diff -urbBw svgalib-1.9.21.orig/threeDKit/trisetpixel.c svgalib-1.9.21/threeDKit/trisetpixel.c
--- svgalib-1.9.21.orig/threeDKit/trisetpixel.c	1997-10-03 20:34:41.000000000 +0200
+++ svgalib-1.9.21/threeDKit/trisetpixel.c	2005-08-03 13:22:23.000000000 +0200
@@ -219,7 +219,7 @@
     unsigned short offst;
     int pg;
     declarevp;
-    long vp = 0;
+    int vp = 0;
     if (__clip) {
 	if (y < __clipy1 || y > __clipy2)
 	    return;
@@ -275,7 +275,7 @@
     unsigned short offst;
     int pg;
     declarevp;
-    long vp = 0;
+    int vp = 0;
     if (__clip) {
 	if (y < __clipy1 || y > __clipy2)
 	    return;
Only in svgalib-1.9.21/threeDKit: trisetpixel.c.wip2
diff -urbBw svgalib-1.9.21.orig/threeDKit/wrapdemo.c svgalib-1.9.21/threeDKit/wrapdemo.c
--- svgalib-1.9.21.orig/threeDKit/wrapdemo.c	2005-07-30 15:22:24.000000000 +0200
+++ svgalib-1.9.21/threeDKit/wrapdemo.c	2005-08-03 13:22:23.000000000 +0200
@@ -105,7 +105,7 @@
 void xchgxy (TD_Surface * surf)
 {
     int j;
-    long t;
+    int t;
 
     for (j = 0; j < surf->l * surf->w; j++) {
 	t = surf->point[j].x;
@@ -169,7 +169,7 @@
 /* These two are scale factors for the screen: */
 /* xscale is now calculated so that the maximum volume (-2^15 to 2^15 or
    -2^31 to 2^31) will just fit inside the screen width at this distance: */
-    ellip_demo->xscale = (long) ellip_demo->distance * EL_screen_width / (32768 * 2);
+    ellip_demo->xscale = (int) ellip_demo->distance * EL_screen_width / (32768 * 2);
     ellip_demo->yscale = (float) ellip_demo->xscale * EL_SCREEN_ASPECT
 	* EL_screen_height / EL_screen_width;	/*to get display aspect square */
 
Only in svgalib-1.9.21/threeDKit: wrapdemo.c.wip2
diff -urbBw svgalib-1.9.21.orig/threeDKit/wrapsurf.c svgalib-1.9.21/threeDKit/wrapsurf.c
--- svgalib-1.9.21.orig/threeDKit/wrapsurf.c	1997-10-03 20:34:52.000000000 +0200
+++ svgalib-1.9.21/threeDKit/wrapsurf.c	2005-08-03 13:22:23.000000000 +0200
@@ -90,15 +90,15 @@
 		int, int, int, int, int,
 	TD_tridata *) = s->draw_wtriangle;
     int mesh;
-    long d1, d2, d3, d4, d;
-    long x1, y1, c1;
-    long x2, y2, c2;
-    long x3, y3, c3;
-    long x4, y4, c4;
-    long u1, v1;
-    long u2, v2;
-    long u3, v3;
-    long u4, v4;
+    int d1, d2, d3, d4, d;
+    int x1, y1, c1;
+    int x2, y2, c2;
+    int x3, y3, c3;
+    int x4, y4, c4;
+    int u1, v1;
+    int u2, v2;
+    int u3, v3;
+    int u4, v4;
     int furthest, clockwise = 0;
     TD_tridata tri;
 
Only in svgalib-1.9.21/threeDKit: wrapsurf.c.wip2
Only in svgalib-1.9.21/threeDKit: wrapsurf.o
Only in svgalib-1.9.21/threeDKit: wtriangle.o
Only in svgalib-1.9.21/utils: .depend
Only in svgalib-1.9.21/utils: convfont
Only in svgalib-1.9.21/utils: convfont.o
Only in svgalib-1.9.21/utils: dumpreg
Only in svgalib-1.9.21/utils: dumpreg.o
Only in svgalib-1.9.21/utils: gtfcalc
Only in svgalib-1.9.21/utils: restorefont
Only in svgalib-1.9.21/utils: restorefont.o
Only in svgalib-1.9.21/utils: restorepalette
Only in svgalib-1.9.21/utils: restorepalette.o
Only in svgalib-1.9.21/utils: restoretextmode
Only in svgalib-1.9.21/utils: restoretextmode.o

svgalib-1.9.21-x86_64.patch:

--- NEW FILE svgalib-1.9.21-x86_64.patch ---
--- svgalib-1.9.21/src/config/libvga.config.x86_64	2005-08-03 14:35:59.000000000 +0200
+++ svgalib-1.9.21/src/config/libvga.config	2005-08-03 14:35:59.000000000 +0200
@@ -347,35 +347,29 @@
 # chipset VGA		# Standard VGA
 # chipset EGA		# EGA
 # chipset ET3000	# Tseng ET3000
-# chipset ET4000	# Tseng ET4000
 # chipset Cirrus	# Cirrus Logic GD542x/543x/544x
-# chipset TVGA		# Trident TVGA8900/9000
 # chipset Oak		# Oak Technologies 037/067/077
 # chipset S3		# S3 chipsets
 # chipset GVGA6400	# Genoa 6400
 # chipset ARK		# ARK Logic
 # chipset ATI		# old ATI VGA
-# chipset Mach32	# ATI Mach32
 # chipset ALI		# ALI2301
 # chipset Mach64	# ATI Mach64 - deprecated, use RAGE driver
 # chipset ET6000        # Tseng ET6000
 # chipset APM	 	# Alliance Technology AT 24/25/3D
 # chipset NV3		# nVidia Riva 128
-# chipset VESA          # nicely behaved Vesa Bioses
 # chipset MX		# MX86251 (some Voodoo Rush boards)
 # chipset PARADISE 	# WD90C31
 # chipset RAGE		# RagePro (and might work with some older mach64)
 # chipset BANSHEE	# Banshee/V3.
 # chipset SIS		# SiS 5597/6326/620/530 cards / integrated vga.
 # chipset I740		# Intel i740 based cards.
-# chipset NEOMAGIC
 # chipset LAGUNA	# Cirrus Logic Laguna series (546X)
 # chipset FBDEV		# Use kernel fbdev, instead of direct hardware.
 # chipset G400		# Matrox Mystique/G100/G200/G400/G450
 # chipset R128		# Ati Rage128 and Radeon
 # chipset SAVAGE	# S3 chipsets Savage, Virge, and some Trio64
 # chipset MILLENNIUM	# Matrox Millennium and Millennium II
-# chipset I810		# Intel i810/815 integrated video
 # chipset TRIDENT	# Trident PCI and AGP chipsets
 # chipset RENDITION	# Rendition V2100/V2200
 # chipset G450C2
@@ -422,12 +416,6 @@
 # Clockchip ICD2061A  # The only one supported right now
 
 
-VesaText	      # Helps the VESA driver with text mode restoration
-		      # problems.
-
-# VesaSave 14	      # changing value might help text mode restoring
-		      # problems with VESA driver. Legal values: 0-15
-
 # NoVCControl	      # Disables svgalib's finding a new VC if run
 		      # from X, also disables svgalib restoring textmode when
 		      # switching VC's (bad). Good fo using dumpreg under X,
@@ -439,9 +427,6 @@
                       # try enabling this. If it helps, please report to
                       # me (matan at svgalib.org)
 
-# NeoMagicLibretto100 # Enable if you have a NeoMagic card on a Toshiba
-                      # Libretto 100, 110, etc
-
 # FbdevNoVga          # When this is set the FBDEV chipset drivers doesn't
 		      # (try to) use standardvga modes through the vga driver.
 		      # this means that no special rights other then access to

svgalib-1.9.22.diff:

--- NEW FILE svgalib-1.9.22.diff ---
diff -X xclude -ubBwrN svgalib-1.9.21/Makefile svgalib-1.9.22/Makefile
--- svgalib-1.9.21/Makefile	2005-03-18 15:49:10.000000000 +0200
+++ svgalib-1.9.22/Makefile	2005-05-10 15:53:08.000000000 +0300
@@ -213,7 +213,7 @@
 lib3dkit-install:
 	(cd threeDKit/; $(MAKE) install)
 	 
-install: uninstall installheaders $(INSTALLSHAREDLIB) installconfig \
+install: installheaders $(INSTALLSHAREDLIB) installconfig \
 	$(INSTALLSTATICLIB) $(INSTALLUTILS) $(INSTALLMAN) $(INSTALLMODULE) $(INSTALLDEV) \
 	lib3dkit-install
 	@echo
diff -X xclude -ubBwrN svgalib-1.9.21/Makefile.cfg svgalib-1.9.22/Makefile.cfg
--- svgalib-1.9.21/Makefile.cfg	2005-04-14 23:21:02.000000000 +0300
+++ svgalib-1.9.22/Makefile.cfg	2005-07-25 22:21:59.000000000 +0300
@@ -9,7 +9,7 @@
 # to n means yes!
 
 MAJOR_VER = 1
-MINOR_VER = 9.21
+MINOR_VER = 9.22
 VERSION = $(MAJOR_VER).$(MINOR_VER)
 
 #----------------------------------------------------------------------
@@ -74,8 +74,10 @@
 # DEBUG_ACCEL = yes
 # DEBUG_KEYBOARD = yes
 
-# uncomment this if you want to compile svgalib to work without kernel
-# helper - this means that svgalib programs need to run as root.
+# uncomment this if you want do not want to compile and install the svgalib
+# kernel helper. - This means that svgalib programs need to run as root, you
+# must also enable the NoHelper line in libvga.config. Or you can compile and
+# install the svgalib kernel helper seperatly.
 # NO_HELPER = y
 
 # uncomment this if your compiler fails on compiling the assembler in
diff -X xclude -ubBwrN svgalib-1.9.21/demos/bg_test.c svgalib-1.9.22/demos/bg_test.c
--- svgalib-1.9.21/demos/bg_test.c	2000-01-06 14:12:36.000000000 +0200
+++ svgalib-1.9.22/demos/bg_test.c	2005-07-16 22:59:22.000000000 +0300
@@ -57,13 +57,13 @@
      }
  vga_init();
  printf("This is small test for background runin.\n");
- if (vga_runinbackground_version()==1)
+ if (vga_runinbackground_version()==1 || vga_runinbackground_version()>=3)
      {
-      printf("Background runin enabled. mode 1\n");
+      printf("Background runin enabled. mode %d\n", vga_runinbackground_version());
      }
    else
      {
-      printf("Svgalib is not mode 1 background capable.\n");
+      printf("Svgalib is not background capable.\n");
       printf("Test ended.\n");
       return(0);
      }
diff -X xclude -ubBwrN svgalib-1.9.21/demos/testgl.c svgalib-1.9.22/demos/testgl.c
--- svgalib-1.9.21/demos/testgl.c	2002-04-03 10:31:14.000000000 +0300
+++ svgalib-1.9.22/demos/testgl.c	2005-07-27 14:46:06.000000000 +0300
@@ -173,7 +173,7 @@
 {
     vga_init();
     
-    if(argc==2) {
+    if(argc>=2) {
         timescale=atoi(argv[1]);
         if(timescale<1)timescale=1;
     }
@@ -205,6 +205,8 @@
     if (COLORS == 256)
 	gl_setrgbpalette();
 
+	if(argc==3)sleep(2);
+
     test();
 
     /* Now do the same with clipping enabled. */
diff -X xclude -ubBwrN svgalib-1.9.21/doc/Makefile svgalib-1.9.22/doc/Makefile
--- svgalib-1.9.21/doc/Makefile	2002-12-19 23:44:33.000000000 +0200
+++ svgalib-1.9.22/doc/Makefile	2005-07-02 19:21:57.000000000 +0300
@@ -3,18 +3,21 @@
 srcdir    = ..
 VPATH     = $(srcdir)/doc
 
-SVGALIB1=man7/svgalib.7 man5/libvga.config.5 man7/svgalib.chips.7\
+SVGALIB1=man7/svgalib.7 man5/libvga.config.5 man5/libvga.et4000.5 \
+	man5/svgalibrc.5 man7/svgalib.chips.7 \
 	man7/svgalib.et4000.7 man7/svgalib.mach32.7\
 	man6/mach32info.6 man3/vga_* man3/keyboard_* man3/mouse_* \
+	man3/joystick_* man3/currentcontext.3 man3/graph_mem.3 \
 	man1/convfont.1 man1/dumpreg.1 man1/fix132x43.1 man1/restorefont.1 \
 	man1/restorepalette.1 man1/restoretextmode.1 man1/runx.1 man1/savetextmode.1 \
 	man1/setmclk.1 man1/textmode.1\
 	man1/svgakeymap.1 \
+	man6/joytest.6 man6/mjoytest.6 man6/printftest.6 man6/svidtune.6 \
 	man6/eventtest.6 man6/forktest.6 man6/fun.6 man6/keytest.6\
 	man6/mousetest.6 man6/speedtest.6 man6/spin.6\
 	man6/testaccel.6 man6/threed.6 man6/vgatest.6 man6/accel.6\
 	man6/bg_test.6 man6/scrolltest.6 man6/testlinear.6\
-	man8/mode3.8 man6/lineart.6
+	man7/svgalib.faq.7 man8/mode3.8 man8/vga_reset.8 man6/lineart.6
 
 VGAGL1=man7/vgagl.7 $(shell ls man3/gl_* | grep -v tri ) man6/testgl.6
 
@@ -23,25 +26,20 @@
 SVGALIB=$(subst man,$(srcdir)/doc/man,$(SVGALIB1))
 VGAGL=$(subst man,$(srcdir)/doc/man,$(VGAGL1))
 THREED=$(subst man,$(srcdir)/doc/man,$(THREED1))
-MANPAGES=$(shell cd $(srcdir)/doc; find man? -type f -print)
-UNCOMANPAGES=$(subst .gz, , $(MANPAGES))
+COMPMANPAGES=$(shell cd $(srcdir)/doc; find man? -name "*.gz" -type f -print)
 
 .PHONY: clean ascii dvi ps install gunzip gzip
 
 gunzip:
-	for dir in man?; do\
-		echo gunzipping manpages in $$dir;\
-		for file in $$dir/*; do \
-			gunzip $$file; \
-		done; \
+	echo gunzipping manpages
+	for i in $(COMPMANPAGES); do\
+		gunzip $$i; \
 	done
 
 gzip:
-	for dir in man?; do\
-		echo gzipping manpages in $$dir;\
-		for file in $$dir/*; do \
-			gzip $$file; \
-		done; \
+	echo gzipping manpages
+	for i in $(SVGALIB1) $(VGAGL1) $(THREED1); do\
+		gzip $$i; \
 	done
 
 ../0-README: man7/svgalib.7
@@ -68,18 +66,10 @@
 install: gzip
 	mkdir -p $(mandir)/man1 $(mandir)/man3 $(mandir)/man5 \
 		 $(mandir)/man6 $(mandir)/man7 $(mandir)/man8
-	$(INSTALL_DATA) $(srcdir)/doc/man1/* $(mandir)/man1
-	$(INSTALL_DATA) $(srcdir)/doc/man3/* $(mandir)/man3
-	$(INSTALL_DATA) $(srcdir)/doc/man5/* $(mandir)/man5
-	$(INSTALL_DATA) $(srcdir)/doc/man6/* $(mandir)/man6
-	$(INSTALL_DATA) $(srcdir)/doc/man7/* $(mandir)/man7
-	$(INSTALL_DATA) $(srcdir)/doc/man8/* $(mandir)/man8
-	for dir in man? ; do \
-		echo gunzipping manpages in $$dir;\
-		for file in $$dir/*; do \
-			gunzip $$file; \
-		done; \
+	for i in $(COMPMANPAGES); do\
+		$(INSTALL_DATA) $(srcdir)/doc/$$i $(mandir)/$$i; \
 	done
+	make gunzip
 ifdef MAKEWHATIS
 	@echo "Rebuilding the whatis database (this is slow!)"
 	@echo "You can comment this out in Makefile.cfg!"
@@ -88,10 +78,10 @@
 
 uninstall:
 	@echo Removing all svgalib man pages.
-	@for dir in $(mandir) /usr/man /usr/local/man; do \
+	@for dir in $(mandir) ; do \
 		if [ -d $$dir ]; then \
 			cd $$dir; \
-			rm -f $(MANPAGES) $(UNCOMANPAGES); \
+			rm -f $(COMPMANPAGES) $(UNCOMANPAGES); \
 		fi; \
 	done;\
 
diff -X xclude -ubBwrN svgalib-1.9.21/doc/man8/vga_reset.8 svgalib-1.9.22/doc/man8/vga_reset.8
--- svgalib-1.9.21/doc/man8/vga_reset.8	1970-01-01 02:00:00.000000000 +0200
+++ svgalib-1.9.22/doc/man8/vga_reset.8	2005-07-02 18:47:49.000000000 +0300
@@ -0,0 +1,17 @@
+.TH vga_reset 8 2004-01-26 "Svgalib (>= 1.4.0)" "Svgalib User Manual"
+.SH NAME
+vga_reset \- reset video graphic board
+.SH SYNOPSIS
+.B vga_reset
+.SH DESCRIPTION
+Call real mode c000:0003, which should be the video card's initialization
+routine. Should work in some cases when mode3 fails to restore text mode.
+.SH BUGS
+Using this program is unsafe, and might (depending on the bios) result in
+a video card in a state that requires a hard reset to restore to normal,
+or even a hung computer.
+.SH SEE ALSO
+.BR mode3 (8).
+.SH AUTHOR
+This manual page was written by Guillem Jover <guillem at debian.org>.
+
diff -X xclude -ubBwrN svgalib-1.9.21/gl/grlib.c svgalib-1.9.22/gl/grlib.c
--- svgalib-1.9.21/gl/grlib.c	2002-04-19 11:15:31.000000000 +0300
+++ svgalib-1.9.22/gl/grlib.c	2005-07-27 14:48:42.000000000 +0300
@@ -3,6 +3,7 @@
 
[...6677 lines suppressed...]
 }
 
 #endif	/* TESTING */
diff -X xclude -ubBwrN svgalib-1.9.21/utils/restorefont.c svgalib-1.9.22/utils/restorefont.c
--- svgalib-1.9.21/utils/restorefont.c	1997-12-04 23:48:32.000000000 +0200
+++ svgalib-1.9.22/utils/restorefont.c	2005-07-02 18:41:30.000000000 +0300
@@ -4,6 +4,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include "../src/libvga.h"
 
 /*
  * Note: Observe that when writing the font to a file, the file to write is
@@ -11,11 +12,11 @@
  * given up). This means that there is no major security hole lurking here.
  */
 
-void main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
     FILE *f;
     unsigned char *font;
-    size_t font_size = 0x2000; /* buffer size in 1.2.11 and before */
+    size_t font_size = FONT_SIZE; /* buffer size in 1.2.11 and before */
     int can_set = 0;
     struct stat statbuf;
 
@@ -24,23 +25,23 @@
 	printf("Syntax: restorefont option filename\n");
 	printf("	-r filename	Restore VGA font from file.\n");
 	printf("	-w filename	Write current VGA font to file.\n");
-	exit(0);
+	return 0;
     }
     if (argv[1][0] != '-') {
 	printf("Must specify -r or -w.\n");
-	exit(1);
+	return 1;
     }
     switch (argv[1][1]) {
     case 'r':
     case 'w':
 	if (argc != 3) {
 	    printf("Must specify filename.\n");
-	    exit(1);
+	    return 1;
 	}
 	break;
     default:
 	printf("Invalid option. Must specify -r or -w.\n");
-	exit(1);
+	return 1;
     }
     vga_disabledriverreport();
     vga_setchipset(VGA);	/* avoid SVGA detection */
@@ -52,6 +53,9 @@
 	    can_set = 1;
 	    /* Query the preferred data size: */
 	    font_size = vga_ext_set(VGA_EXT_FONT_SIZE, 0);
+	    if (font_size < FONT_SIZE) {
+		    font_size = FONT_SIZE;
+	    }	    
 	}
     }
 
@@ -71,7 +75,7 @@
 	    perror("restorefont");
 	  ex_no_errno:
 	    vga_setmode(TEXT);
-	    exit(1);
+	    return 1;
 	}
 	if (fstat(fileno(f), &statbuf))
 	    goto error;
@@ -113,5 +117,5 @@
 	break;
     }
     vga_setmode(TEXT);
-    exit(0);
+    return 0;
 }
diff -X xclude -ubBwrN svgalib-1.9.21/utils/restorepalette.c svgalib-1.9.22/utils/restorepalette.c
--- svgalib-1.9.21/utils/restorepalette.c	2002-02-20 14:24:53.000000000 +0200
+++ svgalib-1.9.22/utils/restorepalette.c	2005-07-10 22:26:49.000000000 +0300
@@ -105,7 +105,7 @@
     }
 }
 
-void
+int
 main (int argc, char *argv[])
 {
   int i;
@@ -117,6 +117,7 @@
   if (vga_getcurrentchipset () != EGA)
     {
       /* Restore textmode/16-color mode palette */
+		if (vga_getcurrentchipset() != FBDEV)
       for (i = 0; i < 16; i++)
 	{
 	  port_in (IS1_RC);
@@ -132,9 +133,11 @@
 	vga_setpalette (i, default_red[i], default_green[i],
 			default_blue[i]);
 
+      if (vga_getcurrentchipset() != FBDEV) {
       port_in (IS1_RC);
       delay ();
       port_out (0x20, ATT_IW);	/* enable display */
     }
-  exit (0);
+    }
+  return 0;
 }
diff -X xclude -ubBwrN svgalib-1.9.21/utils/restoretextmode.c svgalib-1.9.22/utils/restoretextmode.c
--- svgalib-1.9.21/utils/restoretextmode.c	1996-12-18 01:12:28.000000000 +0200
+++ svgalib-1.9.22/utils/restoretextmode.c	2005-07-02 18:41:30.000000000 +0300
@@ -14,7 +14,7 @@
 
 unsigned char regs[MAX_REGS];
 
-void
+int
 main (int argc, char *argv[])
 {
   vga_init ();
@@ -24,12 +24,12 @@
       printf ("Syntax: restoretextmode option filename\n");
       printf ("	-r filename	Restore registers from file.\n");
       printf ("	-w filename	Write registers to file.\n");
-      exit (0);
+      return 0;
     }
   if (argv[1][0] != '-')
     {
       printf ("Must specify -r or -w.\n");
-      exit (1);
+      return 1;
     }
   switch (argv[1][1])
     {
@@ -38,12 +38,12 @@
       if (argc != 3)
 	{
 	  printf ("Must specify filename.\n");
-	  exit (1);
+	  return 1;
 	}
       break;
     default:
       printf ("Invalid option. Must specify -r or -w.\n");
-      exit (1);
+      return 1;
     }
   if (argv[1][1] == 'r')
     {
@@ -53,14 +53,14 @@
 	{
 	error:
 	  perror ("restoretextmode");
-	  exit (1);
+	  return 1;
 	}
       if (1 != fread (regs, MAX_REGS, 1, f))
 	{
 	  if (errno)
 	    goto error;
 	  puts ("restoretextmode: input file corrupted.");
-	  exit (1);
+	  return 1;
 	}
       fclose (f);
     }
@@ -86,5 +86,5 @@
       if (fclose (f))
 	goto error;
     }
-  exit (0);
+  return 0;
 }
diff -X xclude -ubBwrN svgalib-1.9.21/utils/setmclk.c svgalib-1.9.22/utils/setmclk.c
--- svgalib-1.9.21/utils/setmclk.c	2004-09-10 17:35:45.000000000 +0300
+++ svgalib-1.9.22/utils/setmclk.c	2005-07-02 18:41:30.000000000 +0300
@@ -51,7 +51,7 @@
       printf ("Not a Cirrus.\n");
       printf ("Continue anyway (y/n)?\n");
       if (getchar () != 'y')
-	exit (-1);
+	return -1;
     }
 
   /* Unlock extended registers. */
@@ -85,5 +85,5 @@
   OUTB (0x3c5, NEW_MCLK);
   printf ("New MCLK value: %02x\n", NEW_MCLK);
 
-  exit (0);
+  return 0;
 }


--- NEW FILE svgalib-todo ---
wip:
-don't allow any vga modes (not even 320x200x256, mode 5) with fbdev and
 fbdev_novga, it barfs in vgaclear.c because of outb instructions. If the
 framebuffer can handle it, it will still be available as mode 146.
-use /sys/bus/pci for linear fd.
-when mem_fd == -1 (nohelper, secure) and linear_fd != -1 and trying to set
 runinbackground and CM can handle emulatepage set emulatepage instead of
 refusing to runinbackground.

wip2:
-fix a cut and paste error in fbdev.c which caused fbdev_set_virtual_height
 to not do anything, leaving yres_virtual at yres .
-add fbdev_put_vscreeninfo, which tries to put the vscreen info three times
 before giving up:
 1st with yres_virtual as calculated by fbdev_set_virtual_height
 2nd with yres_virtual set to 2x yres
 3th with yres_virtual set to yres
 This is needed because even with the max of 8192 in fbdev_set_virtual_height
 fbdev still doesn't like the yres_virtuals we calculate for all modes,
 with this 3 attempts approach much more modes are available.
-update fbdev_getmodeinfo to calculate maxpixels based on the yres_virtual
 which actually succeeded.
-check all uses of long, replace most with int because:
 -most of the times a 32 bit variable is enough (it works on i386 where
  a long is 32 bit doesn't it), 64 bit is a waste of memory and slower.
 -sometimes a long ptr is used to walk past MMIO mapped 32 bits registers,
  which causes it to walk in steps of 64 bits, skipping a reg each time,
  which is a plain bug. This also goes for other use of long ptrs to point
  to 32 bits data (memsetlong, memcpylong) .
-change modeline for 640x480 at 72Hz in timing.c to Xorg's builtin default
 modeline for 640x480 at 72Hz, the old one makes my monitor go into powersaving
 mode.
-restore textmode and return an error code if chipset_setregs fails
 in vga_setmode.
-use the same checks done in vga_runinbackground, in
 vga_runinbackgroundversion to determine if runinbackground is ok.
-add fbdev_novga docs to libvga.config
  





todo:
-check mode 5 (320x200x256, vgadriver, 146 works fine) and 145
 (400x300 modeX) with radeon.
-VESA on x86_64 ?!

cleanups:
-clean up makefiles, use TOPDIR everywhere, set include paths so that
compilation of utils, gl threeDkit will work without install libvga first
-check init return value in setchip xxx.
-This has inspired me to get rid of the unneeded GM pointer in svgalib, GM
(in drivers sometimes still called __svgalib_graph_mem) always points to
BANKED_POINTER after a setmode, and no code checks for it not being set
(which is ok, progs should call setmode before drawingfuncs) so tomorrow I'm
going through the entire source and replace it all with BANKED_POINTER.
Which imho is a better name, and makes things less confusing, why have 2
ptrs for the same thing? 
-vga_setchipsetandfeatures should do same sanitychecks as vga_setchipset
-move come from background call to above forbidvtrelease=0
-add chipset range check to disable_chipset, setchipset
-get_perm in vga_fork is bullshit, because done already is 1 so it will do
 nothing! Same goes for  __vga_map;
-ioperm is not needed when doing iopl, what does iopl(value lower then 3) do?
-ioperm does nog get inherited by fork, iopl does.
-vga_set_LRMI_callbacks is done in a zillion places
-move only do this once readconfig var to readconfig func.
-move only do this once vars for map_mmio and map_mem to the funcs.
-__svgalib_flipaway may be made static
-__svgalib_runinbackground may be made static
-map_mem may be made static
-__svgalib_savemem may be removed
-don't open /dev/mem in drivers instead use mem_fd
-do we need to make sure fd's 0,1,2, are going somewhere in vga_init,
 or can this be delayed till open_mem?
-Remove release_acquire debug stuff
-properly check mmap, fork execv and other return values.
-make map_vgaxxxio static


strangeness: 
-inconsistent use of __svgalib_secondary in flip_away vs flip_back
-vga_flip vs console switches


--- NEW FILE svgalib.spec ---
Name:		svgalib
Version:	1.9.21
Release:	2
Summary:	Low-level fullscreen SVGA graphics library

Group:		System Environment/Libraries
License:	Public Domain
URL:		http://www.svgalib.org/
Source0:	http://www.arava.co.il/matan/svgalib/svgalib-%{version}.tar.gz
Source1:	svgalib-todo
Patch0:		svgalib-1.9.22.diff
Patch1:		svgalib-1.9.21-makefiles.patch
Patch2:		svgalib-1.4.3-fhs.patch
Patch3:		svgalib-1.9.21-demos.patch
Patch4:		svgalib-1.9.21-wip.patch
Patch5:		svgalib-1.9.21-wip2.patch
Patch6:		svgalib-1.9.21-cfg.patch
Patch7:		svgalib-1.9.21-x86_64.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Provides:	libvga = %{version}-%{release}

%description
The svgalib package provides the SVGAlib low-level graphics library
for Linux.  SVGAlib is a library which allows applications to use full
screen graphics on a variety of hardware platforms. Some games and
utilities use SVGAlib for their graphics. For details on
supported chipsets, see man 7 svgalib (when svgalib is installed).

%package devel
Summary:	Development tools for the SVGAlib graphics library
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Provides:	libvga-devel = %{version}-%{release}

%description devel
The svgalib-devel package contains the libraries and header files
needed to build programs which will use the SVGAlib low-level graphics
library.

%prep
%setup -q 
%patch0 -p1
%patch1 -p1 -b .makefiles
%patch2 -p1 -b .fhs
%patch3 -p1
%patch4 -p1 -b .wip
%patch5 -p1 -b .wip2
%patch6 -p1 -b .defaultcfg
%ifnarch %{ix86}
%patch7 -p1 -b .x86_64
%endif
#the testlinear demo needs svgalib's internal libvga header, so copy it to the
#demo dir
cp src/libvga.h demos

%build
#%{?_smp_mflags} doesn't work on x86_64 chances are it will fail on
#some i386 machines too.
make OPTIMIZE="-Wno-pointer-sign $RPM_OPT_FLAGS" LDFLAGS= \
  prefix=%{_prefix} \
  NO_HELPER=y \
  INCLUDE_ET4000_DRIVER=y \
  INCLUDE_OAK_DRIVER=y \
  INCLUDE_MACH32_DRIVER=y \
  INCLUDE_ET3000_DRIVER=y \
  INCLUDE_GVGA6400_DRIVER=y \
  INCLUDE_ATI_DRIVER=y \
  INCLUDE_G450C2_DRIVER=y \
  INCLUDE_ET4000_DRIVER_TEST=y \
  INCLUDE_FBDEV_DRIVER_TEST=y \
  INCLUDE_VESA_DRIVER_TEST=y \
  shared
cd utils
make OPTIMIZE="-Wno-pointer-sign $RPM_OPT_FLAGS" LDFLAGS= \
  prefix=%{_prefix}
cd ..
cd threeDKit
make OPTIMIZE="-Wno-pointer-sign $RPM_OPT_FLAGS" LDFLAGS= \
  prefix=%{_prefix} lib3dkit.so.1.9.22
cd ..

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/vga
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
make \
  TOPDIR=$RPM_BUILD_ROOT \
  prefix=$RPM_BUILD_ROOT/%{_prefix} \
  mandir=$RPM_BUILD_ROOT/%{_mandir} \
  sharedlibdir=$RPM_BUILD_ROOT/%{_libdir} \
  NO_HELPER=y \
  MANFORMAT=compressed \
  "INSTALL_PROGRAM=install -p -m 755" \
  "INSTALL_SCRIPT=install -p -m 755" \
  "INSTALL_SHLIB=install -p -m 755" \
  "INSTALL_DATA=install -p -m 644" \
  install
#for %ghost
touch $RPM_BUILD_ROOT/etc/vga/fontdata
touch $RPM_BUILD_ROOT/etc/vga/textregs

%clean
rm -fr $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc doc/CHANGES doc/README.joystick doc/README.keymap lrmi-0.6m/README
%doc doc/README.multi-monitor doc/README.vesa doc/TODO doc/dual-head-howto
%dir %{_sysconfdir}/vga/
%config(noreplace) %{_sysconfdir}/vga/dvorak-us.keymap
%config(noreplace) %{_sysconfdir}/vga/libvga.config
%config(noreplace) %{_sysconfdir}/vga/libvga.et4000
%config(noreplace) %{_sysconfdir}/vga/null.keymap
%ghost %{_sysconfdir}/vga/fontdata
%ghost %{_sysconfdir}/vga/textregs
%{_bindir}/*
%{_libdir}/*.so.*
%{_mandir}/man[^3]/*

%files devel
%defattr(-,root,root,-)
%doc demos doc/DESIGN doc/Driver-programming-HOWTO doc/README.patching
%{_includedir}/*
%{_libdir}/*.so
%{_mandir}/man3/*

%changelog
* Wed Aug 3 2005 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9.21-2
- I've been working with upstream to get most patches intergrated, so
  most patches are gone now.
- Reviewed and fixed the entire source tree for 64 bit cleanness.
- While working with upstream I've been busy fixing some bugs and improving
  security in nohelper mode. From now on /dev/mem gets closed immediatly
  after getchipset (vga_init) has been called. Lots of work has been done
  to keep all functionality and api & abi compatibility intact, even
  while /dev/mem is no longer available. This does however mean that
  in nohelper mode runinbackground and emulated paging (ppc or secondary card)
  are only available on 2.6 kernels now.
- Made nohelper mode configurable from the configfile, if the user wants he
  can build the kernel module from the svgalib-srcs and use this with the RPM
  packaged libs, all this has not been released by upstream yet. The merged
  part of all this is in patch 0, patch 4 and 5 contain work which still needs
  to be merged.
- Patch6: set some sane default in the configfile.
- Patch7: remove options not available on non-i386 from the configfile when
  building for non-i386.

* Fri Jul 1 2005 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9.21-1
- Yet another attempt at getting svgalib into Fedora Extras (formerly .us).
- Upstream has reintroduced suid root use in 1.9.20 as an alternative to the
  helper-kernel-module. This allows us to build a sane (kernel module free)
  package of the 1.9 (devel) versions. The 1.4 (stable) versions haven't
  seen an update in ages and don't support most modern cards -> Update to the
  latest upstream devel release 1.9.21 .
- Split the Debian patches in some sane parts, redo against 1.9.21 where
  nescesarry.
- Don't patch Makefile.cfg instead just pass the nescesarry options to make
  in %%build and %%install.
- Reintroduce %%_smp_mflags, this seems to work fine with 1.9.21 .

* Tue Jul 27 2004 Hans de Goede <j.w.r.degoede at hhs.nl>
0:1.4.5-0.fdr.6
- Removed unnescesarry and wrong Requires(%post,%postun)
- Fixed ExclusiveArch
- Removed the Packager tag
- Removed %%_smp_mflags, this doesn't work
- Modified patch2 so that only the real manpages and not the
  patch backups get gzipped and installed, renamed patch
  to svgalib-1.4.3-man to reflect this change.
- Removed 0-INSTALL from docs
- Don't use README.* this also puts patch backups in the docs
- Moved README.patches from svgalib to svgalib-devel
- Removed unnescesarry creation of dirs in %%install, the Makefile creates
  most for us.
- Removed %%preun removing /etc/vga/fontdate and /etc/vga/textregs,
  instead made them owned by svgalib using %%ghost
- Made files in /etc/vga %%config(noreplace)

* Fri Jul 16 2004 Hans de Goede <j.w.r.degoede at hhs.nl>
0:1.4.5-0.fdr.5
- new RPM on base of the original RH 6.2 SRPM, all the patches from the
  latest debian pkg, and parts from the first fedora releases by Andreas.

* Tue Sep 02 2003 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
0:1.4.5-0.fdr.4
- Added severn compile fix provided by Michael Schwendt (#444 #6)

* Sat Aug 30 2003 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
0:1.4.3-0.fdr.3
- Fixed stuff from #444 #4 :)

* Sun Jul 13 2003 Andreas Bierfert (awjb) <andreas.bierfert[AT]awbsworld.de>
0:1.4.3-0.fdr.2
- Fixed minor rpmlint warnings
* Tue Jul 01 2003 Andreas Bierfert (awjb) <andreas.bierfert[AT]awbsworld.de>
0:1.4.3-0.fdr.1
- Initial RPM release.

* Thu Feb  3 2000 Bill Nottingham <notting at redhat.com>
- handle compressed man pages

* Tue Jan 18 2000 Bill Nottingham <notting at redhat.com>
- update to 1.4.1 final

* Wed Dec 08 1999 Michael Maher <mike at lastfoot.com>
- built pre release of 1.4.1

* Mon Sep 13 1999 Bill Nottingham <notting at redhat.com>
- strip binaries

* Fri Aug 27 1999 Bill Nottingham <notting at redhat.com>
- update to 1.4.0, sort out patches

* Sun May 16 1999 Jeff Johnson <jbj at redhat.com>
- don't remove old binaries (not from BUILD_ROOT!) during install (#2735).

* Wed Mar 31 1999 Preston Brown <pbrown at redhat.com>
- moved temporary svgalib files to /var/lib/svgalib

* Sun Mar 21 1999 Cristian Gafton <gafton at redhat.com> 
- auto rebuild in the new build environment (release 2)

* Sun Aug 23 1998 Jeff Johnson <jbj at redhat.com>
- verify dumpreg is not setuid (problem #760)
- specfile fiddles

* Thu Jul 30 1998 Cristian Gafton <gafton at redhat.com>
- upgraded to 1.3.0
- security patch

* Thu May 07 1998 Prospector System <bugs at redhat.com>
- translations modified for de, fr, tr

* Thu Apr 30 1998 Cristian Gafton <gafton at redhat.com>
- devel package moved to Development/Libraries

* Mon Apr 06 1998 Erik Troan <ewt at redhat.com>
- updated to svgalib 1.2.13
- uses a build root

* Mon Nov  3 1997 Michael Fulbright <msf at redhat.com>
- removed Mach64 from configuration, as the driver does not work

* Tue Oct 14 1997 Donnie Barnes <djb at redhat.com>
- spec file cleanups


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/svgalib/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	5 Aug 2005 09:34:12 -0000	1.1
+++ .cvsignore	5 Aug 2005 09:37:40 -0000	1.2
@@ -0,0 +1 @@
+svgalib-1.9.21.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/svgalib/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	5 Aug 2005 09:34:12 -0000	1.1
+++ sources	5 Aug 2005 09:37:40 -0000	1.2
@@ -0,0 +1 @@
+1bd8892ee38481051e4b4d85008c86be  svgalib-1.9.21.tar.gz




More information about the fedora-extras-commits mailing list