rpms/svgalib/devel svgalib-1.9.21-wip3.patch, NONE, 1.1 svgalib-todo, 1.1, 1.2 svgalib.spec, 1.3, 1.4

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Sun Aug 7 07:49:55 UTC 2005


Author: jwrdegoede

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

Modified Files:
	svgalib-todo svgalib.spec 
Added Files:
	svgalib-1.9.21-wip3.patch 
Log Message:
fix 320x200x256(mode 5) on atleast radeons and probably others too

svgalib-1.9.21-wip3.patch:

--- NEW FILE svgalib-1.9.21-wip3.patch ---
Only in svgalib-1.9.21: log
Only in svgalib-1.9.21: log2
diff -ur svgalib-1.9.21.orig/src/vga.c svgalib-1.9.21/src/vga.c
--- svgalib-1.9.21.orig/src/vga.c	2005-08-05 18:17:09.000000000 +0200
+++ svgalib-1.9.21/src/vga.c	2005-08-07 09:19:31.000000000 +0200
@@ -2166,7 +2166,6 @@
 		if (__svgalib_emulatepage && (modeinfo->flags & CAPABLE_LINEAR) &&
 				!(modeinfo->flags & LINEAR_USE)) {
 			__svgalib_driverspecs->linear(LINEAR_ENABLE, 0);
-			__svgalib_modeinfo_linearset |= IS_LINEAR;
 	}
 
 		if (!flip) /* set graphics mode termio */
@@ -2302,11 +2301,10 @@
     modeinfo.flags &= modeinfo_mask;
 
     /* Many cards have problems with linear 320x200x256 mode */
-    if(mode==G320x200x256)modeinfo.flags &= (~CAPABLE_LINEAR) & (~IS_LINEAR) ;
+    if(mode==G320x200x256)modeinfo.flags &= (~CAPABLE_LINEAR) & (~LINEAR_USE);
 
-    /* If all needed info is here, signal if linear support has been enabled */
-    if ((modeinfo.flags & (CAPABLE_LINEAR | EXT_INFO_AVAILABLE)) ==
-	(CAPABLE_LINEAR | EXT_INFO_AVAILABLE)) {
+    /* Signal if linear support has been enabled */
+    if (modeinfo.flags & CAPABLE_LINEAR) {
 	modeinfo.flags |= __svgalib_modeinfo_linearset;
     }
 
@@ -2329,15 +2327,14 @@
 			infotable[mode].ydim<miny || infotable[mode].ydim>maxy)
 		return 0;
 	
-    if(__svgalib_emulatepage && STDVGAMODE(mode) && (mode!=G320x200x256))
+    if(__svgalib_emulatepage && STDVGAMODE(mode))
         return 0;
 
     if (!chipset_modeavailable(mode))
         return 0;
 
     modeinfo = vga_getmodeinfo(mode);
-    if (__svgalib_emulatepage && (mode!=G320x200x256) &&
-        !(modeinfo->flags & (CAPABLE_LINEAR|LINEAR_USE)))
+    if (__svgalib_emulatepage && !(modeinfo->flags & CAPABLE_LINEAR))
         return 0;
 
     return 1;
@@ -2621,7 +2618,8 @@
 
 	size = VMEM;
 	alloc_graph_buf(size);
-		if(__svgalib_modeinfo_linearset & LINEAR_USE) {
+		if((__svgalib_modeinfo_linearset & LINEAR_USE) &&
+		   (CM != G320x200x256)) {
 			memcpy(graph_buf, LINEAR_POINTER, size);
 		} else {
 	page = 0;
@@ -2642,6 +2640,7 @@
 static void restorestate(void)
 {
     int i;
+    vga_modeinfo *modeinfo;
 
     vga_screenoff();
 
@@ -2656,7 +2655,13 @@
 
 	if(saved_linear)
 		vga_setlinearaddressing();
-
+	
+	modeinfo = vga_getmodeinfo(CM);
+	if (__svgalib_emulatepage && (modeinfo->flags & CAPABLE_LINEAR) &&
+	    !(modeinfo->flags & LINEAR_USE)) {
+		__svgalib_driverspecs->linear(LINEAR_ENABLE, 0);
+	}
+    
     if (CM == G320x200x256 && VMEM <= 65536) {
 	memcpy(GM, graph_buf, 65536);
     } else if (MODEX || CM == G800x600x16 || (STDVGAMODE(CM) && CM != G320x200x256)) {
@@ -2715,7 +2720,8 @@
 
 		DPRINTF("Restoring %dK of video memory.\n", (size + 2) / 1024);
 
-		if(__svgalib_modeinfo_linearset & LINEAR_USE) {
+		if((__svgalib_modeinfo_linearset & LINEAR_USE) &&
+		   (CM != G320x200x256)) {
 			memcpy(LINEAR_POINTER, graph_buf, size);
 		} else {
 		page = 0;
@@ -4034,10 +4040,8 @@
             /* 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)) ))) {
+    	    if ((__svgalib_linear_mem_fd != -1) && ( (CM == TEXT) ||
+    	        (modeinfo->flags & CAPABLE_LINEAR) ) ) {
     	        /* only do this if we are not already emulating pages */
     	        if (!__svgalib_emulatepage)
     	        {
@@ -4049,7 +4053,6 @@
                         if ((modeinfo->flags & CAPABLE_LINEAR) &&
                             !(modeinfo->flags & LINEAR_USE)) {
                             __svgalib_driverspecs->linear(LINEAR_ENABLE, 0);
-                            __svgalib_modeinfo_linearset |= IS_LINEAR;
                         }
                     }
                     map_banked(MAP_FIXED);
@@ -4087,10 +4090,8 @@
        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. */
     modeinfo = vga_getmodeinfo(CM);
-    if ((__svgalib_linear_mem_fd != -1) && ( (CM == TEXT) || (
-        ( (modeinfo->flags & CAPABLE_LINEAR) ||
-          (modeinfo->flags & LINEAR_USE) ) &&
-        (!STDVGAMODE(CM) || (CM == G320x200x256)) )))
+    if ((__svgalib_linear_mem_fd != -1) && ( (CM == TEXT) ||
+        (modeinfo->flags & CAPABLE_LINEAR) ) )
     return 3;
     
     return 0;
Only in svgalib-1.9.21/src: vga.c~
diff -ur svgalib-1.9.21.orig/src/vgamisc.c svgalib-1.9.21/src/vgamisc.c
--- svgalib-1.9.21.orig/src/vgamisc.c	2005-08-05 18:17:09.000000000 +0200
+++ svgalib-1.9.21/src/vgamisc.c	2005-08-07 08:15:54.000000000 +0200
@@ -55,7 +55,7 @@
 
 /*
  * The way IS_LINEAR gets indicated is rather convoluted; if the driver
- * has EXT_INFO_AVAILABLE, setlinearaddressing will enable
+ * is CAPABLE_LINEAR, setlinearaddressing will enable
  * the flag in __svgalib_linearset which gets set in the modeinfo by
  * vga_getmodeinfo(). The driver must turn off the flag in
  * __svgalib_linearset if linear addressing gets disabled (e.g. when
Only in svgalib-1.9.21/src: vgamisc.c~
diff -ur svgalib-1.9.21.orig/src/vgapix.c svgalib-1.9.21/src/vgapix.c
--- svgalib-1.9.21.orig/src/vgapix.c	2005-08-05 18:17:09.000000000 +0200
+++ svgalib-1.9.21/src/vgapix.c	2005-08-07 09:10:54.000000000 +0200
@@ -45,7 +45,8 @@
     case 1:
 	offset = y * CI.xbytes + x;
 
-	if (__svgalib_modeinfo_linearset & LINEAR_USE ) {
+        if((__svgalib_modeinfo_linearset & LINEAR_USE) &&
+           (CM != G320x200x256)) {
             *(LINEAR_POINTER+offset)=COL;
         } else {
 	    /* select segment */
@@ -144,7 +145,8 @@
 	return pix;
     case 1:
 	offset = y * CI.xbytes + x;
-	if (__svgalib_modeinfo_linearset & LINEAR_USE ) {
+        if((__svgalib_modeinfo_linearset & LINEAR_USE) &&
+           (CM != G320x200x256)) {
             return *(LINEAR_POINTER+offset);
         }
 	/* select segment */
Only in svgalib-1.9.21/src: vgapix.c~


Index: svgalib-todo
===================================================================
RCS file: /cvs/extras/rpms/svgalib/devel/svgalib-todo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- svgalib-todo	5 Aug 2005 09:37:40 -0000	1.1
+++ svgalib-todo	7 Aug 2005 07:49:52 -0000	1.2
@@ -36,14 +36,33 @@
  vga_runinbackgroundversion to determine if runinbackground is ok.
 -add fbdev_novga docs to libvga.config
   
-
-
-
+wip3:
+-vga_getmodeinfo used to check for EXT_INFO_AVAILABLE in modeinfo.flags,
+ before adding __svgalib_modeinfo_linearset to modeinfo.flags. This seems wrong,
+ since lots of drivers don't set EXT_INFO_AVAILABLE but do support linear
+ just fine, so the check has been simplified to just checking for
+ CAPABLE_LINEAR . Otherwise a program could get/do:
+ -call getmodeinfo, see that mode is linear capable
+ -call setlinearaddressing, which indicates success
+ -call getmodeinfo again, still don't see the IS_LINEAR flag.
+-in setmode don't set IS_LINEAR in __svgalib_modeinfo_linearset when enabling
+ LFB because of emulating page, although the LFB has been explicitly
+ enabled, this was not on the users request, so we mustnot return
+ LINEAR_POINTER, but GM in getgraphmem hence IS_LINEAR shouldnot be set.
+ And it is also not correct to report IS_LINEAR in getmodeinfo when not
+ explicitly requested.
+ (all this happened only for cards which need the LFB explicitly enabled).
+-in restorestate enable linear mode when emulating pages on cards which
+ need it explictly enabled, checking saved_linear is no longer enough,
+ since we no longer set IS_LINEAR in this case unless explicitly requested
+ by the user.
+-320x200x256 is linear because it fits within one page, but it should be
+ accessed through GM not through LINEAR_POINTER. Fix this in: vga.c & vgapix.c.
+-Because of the above we cannot do 320x200x256 when emulating pages,
+ update vga_hasmode for this. 
 
 
 todo:
--check mode 5 (320x200x256, vgadriver, 146 works fine) and 145
- (400x300 modeX) with radeon.
 -VESA on x86_64 ?!
 
 cleanups:


Index: svgalib.spec
===================================================================
RCS file: /cvs/extras/rpms/svgalib/devel/svgalib.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- svgalib.spec	5 Aug 2005 17:51:41 -0000	1.3
+++ svgalib.spec	7 Aug 2005 07:49:52 -0000	1.4
@@ -1,6 +1,6 @@
 Name:		svgalib
 Version:	1.9.21
-Release:	3
+Release:	4
 Exclusivearch:	%{ix86} x86_64
 Summary:	Low-level fullscreen SVGA graphics library
 
@@ -18,6 +18,7 @@
 Patch6:		svgalib-1.9.21-cfg.patch
 Patch7:		svgalib-1.9.21-x86_64.patch
 Patch8:		svgalib-1.9.21-ppc.patch
+Patch9:		svgalib-1.9.21-wip3.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Provides:	libvga = %{version}-%{release}
 
@@ -52,6 +53,7 @@
 %patch7 -p1 -b .x86_64
 %endif
 #%patch8 -p1 -b .ppc
+%patch9 -p1 -b .wip3
 
 #the testlinear demo needs svgalib's internal libvga header, so copy it to the
 #demo dir
@@ -133,6 +135,10 @@
 %{_mandir}/man3/*
 
 %changelog
+* Sun Aug 7 2005 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9.21-4
+- Add patch 9 which fixes 320x200x256(mode 5) on atleast radeons and probably
+  others too.
+
 * Fri Aug 5 2005 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9.21-3
 - Add patch 8 to try to fix compilation on ppc.
 - PPC has issues with the use of iopl ioperm inb and outb




More information about the scm-commits mailing list