linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sisfb accel capabilities
@ 2004-06-03  2:44 David Eger
  2004-06-03  9:52 ` Thomas Winischhofer
  0 siblings, 1 reply; 9+ messages in thread
From: David Eger @ 2004-06-03  2:44 UTC (permalink / raw)
  To: Thomas Winischhofer; +Cc: linux-fbdev-devel


Dear Thomas,

The following patch updates sisfb for the new fb accel capabilities
patch I'm sending upstream.  By default, this patch will rely on your
copyarea() and fillrect() accel functions instead of the panning. 
Please test the core patch + this patch, and let me know your console
works.  I'm interested to hear what speeds you see :-)

Also, using fbset to turn acceleration on and off ought to work, though
i still think this is better done via sysfs... just don't have time to
learn that ATM...

-dte

sisfb: update to new fbinfo.flags accel capabilities

Signed-off-by: David Eger <eger@havoc.gtf.org>
 
# drivers/video/sis/sis_main.h
#   2004/06/02 22:49:50+02:00 eger@rosencrantz.theboonies.us +1 -1
#   get rid of referece to setup variable
# 
# drivers/video/sis/sis_main.c
#   2004/06/02 22:49:49+02:00 eger@rosencrantz.theboonies.us +33 -35
#   migrate to new fbinfo->flags hwaccel semantics;
#   
#   get rid of attempt to do "wrap" in pan_display, 
#   as the code doesn't seem to indicate it actually ever worked.
#   wrap is just a weird amiga thing anyways ;-)
# 
# drivers/video/sis/sis_accel.h
#   2004/06/02 22:49:49+02:00 eger@rosencrantz.theboonies.us +0 -1
#   get rid of referece to setup variable
# 
# drivers/video/sis/sis_accel.c
#   2004/06/02 22:49:49+02:00 eger@rosencrantz.theboonies.us +0 -1
#   get rid of referece to setup variable
# 
diff -Nru a/drivers/video/sis/sis_accel.c b/drivers/video/sis/sis_accel.c
--- a/drivers/video/sis/sis_accel.c	Wed Jun  2 22:51:34 2004
+++ b/drivers/video/sis/sis_accel.c	Wed Jun  2 22:51:34 2004
@@ -79,7 +79,6 @@
 
 extern struct     video_info ivideo;
 extern VGA_ENGINE sisvga_engine;
-extern int sisfb_accel;
 
 static const int sisALUConv[] =
 {
diff -Nru a/drivers/video/sis/sis_accel.h b/drivers/video/sis/sis_accel.h
--- a/drivers/video/sis/sis_accel.h	Wed Jun  2 22:51:34 2004
+++ b/drivers/video/sis/sis_accel.h	Wed Jun  2 22:51:34 2004
@@ -525,7 +525,6 @@
                        int srcx, int height, int width);
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
-extern int sisfb_accel;
 void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 #endif
diff -Nru a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
--- a/drivers/video/sis/sis_main.c	Wed Jun  2 22:51:34 2004
+++ b/drivers/video/sis/sis_main.c	Wed Jun  2 22:51:34 2004
@@ -1104,10 +1104,19 @@
 		ivideo.org_x = ivideo.org_y = 0;
 		ivideo.video_linelength = ivideo.video_width * (ivideo.video_bpp >> 3);
 		ivideo.accel = 0;
+#if defined(STUPID_ACCELF_TEXT_SHIT) || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5)
+	if (var->accel_flags == FB_ACCELF_TEXT)
+		info->flags &= ~FBINFO_HWACCEL_DISABLED;
+	else
+		info->flags |= FBINFO_HWACCEL_DISABLED;
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,5)
+		ivideo.accel = !(info->flags & FBINFO_HWACCEL_DISABLED);
+#else
 		if(sisfb_accel) {
 		   ivideo.accel = (var->accel_flags & FB_ACCELF_TEXT) ? -1 : 0;
 		}
-
+#endif
 		sisfb_set_vparms();
 
 		ivideo.current_width = ivideo.video_width;
@@ -1654,14 +1663,11 @@
 {
 	int err;
 
-	if (var->vmode & FB_VMODE_YWRAP) {
-		if (var->yoffset < 0 || var->yoffset >= fb_display[con].var.yres_virtual || var->xoffset)
-			return -EINVAL;
-	} else {
-		if (var->xoffset+fb_display[con].var.xres > fb_display[con].var.xres_virtual ||
-		    var->yoffset+fb_display[con].var.yres > fb_display[con].var.yres_virtual)
-			return -EINVAL;
-	}
+	if (var->vmode & FB_VMODE_YWRAP)
+		return -EINVAL;
+	if (var->xoffset+fb_display[con].var.xres > fb_display[con].var.xres_virtual ||
+	    var->yoffset+fb_display[con].var.yres > fb_display[con].var.yres_virtual)
+		return -EINVAL;
 
         if(con == currcon) {
 	   if((err = sisfb_pan_var(var)) < 0) return err;
@@ -1669,10 +1675,6 @@
 
 	fb_display[con].var.xoffset = var->xoffset;
 	fb_display[con].var.yoffset = var->yoffset;
-	if (var->vmode & FB_VMODE_YWRAP)
-		fb_display[con].var.vmode |= FB_VMODE_YWRAP;
-	else
-		fb_display[con].var.vmode &= ~FB_VMODE_YWRAP;
 
 	return 0;
 }
@@ -2060,30 +2062,21 @@
 {
 	int err;
 
+	if (var->vmode & FB_VMODE_YWRAP) 
+	    	return -EINVAL;
 	if (var->xoffset > (var->xres_virtual - var->xres))
 		return -EINVAL;
 	if (var->yoffset > (var->yres_virtual - var->yres))
 		return -EINVAL;
 
-	if (var->vmode & FB_VMODE_YWRAP) {
-		if (var->yoffset < 0 ||
-		    var->yoffset >= info->var.yres_virtual ||
-		    var->xoffset)
-		    	return -EINVAL;
-	} else {
-		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
-		    var->yoffset + info->var.yres > info->var.yres_virtual)
-			return -EINVAL;
-	}
+	if (var->xoffset + info->var.xres > info->var.xres_virtual ||
+	    var->yoffset + info->var.yres > info->var.yres_virtual)
+		return -EINVAL;
     
 	if((err = sisfb_pan_var(var)) < 0) return err;
 
 	info->var.xoffset = var->xoffset;
 	info->var.yoffset = var->yoffset;
-	if (var->vmode & FB_VMODE_YWRAP)
-		info->var.vmode |= FB_VMODE_YWRAP;
-	else
-		info->var.vmode &= ~FB_VMODE_YWRAP;
 
 	return 0;
 }
@@ -2111,7 +2104,7 @@
 	mmio_off = PAGE_ALIGN((start & ~PAGE_MASK) + ivideo.heapstart);
 	if(off >= mmio_off) {
 		off -= mmio_off;		
-		if(info->var.accel_flags) return -EINVAL;
+		if (!(info->flags & FBINFO_HWACCEL_DISABLED)) return -EINVAL;
 
 		start = (unsigned long) ivideo.mmio_base;
 		len = PAGE_ALIGN((start & ~PAGE_MASK) + sisfb_mmio_size);
@@ -4897,12 +4890,12 @@
 	   	   }
 	        }
 
-		ivideo.accel = 0;
-		if(sisfb_accel) {
-		   ivideo.accel = -1;
-		   default_var.accel_flags |= FB_ACCELF_TEXT;
-		   sisfb_initaccel();
-		}
+		ivideo.accel = sisfb_accel;
+		sisfb_initaccel();
+
+#ifdef STUPID_ACCELF_TEXT_SHIT
+		default_var.accel_flags = sisfb_accel ? FB_ACCELF_TEXT : 0;
+#endif
 
 		if(sisfb_ypan) {
 		   /* Maximize regardless of sisfb_max at startup */
@@ -4914,7 +4907,12 @@
 	    	   }
 		}
 
-		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
+		sis_fb_info->flags = FBINFO_DEFAULT
+				   | FBINFO_HWACCEL_YPAN
+				   | FBINFO_HWACCEL_XPAN
+				   | FBINFO_HWACCEL_COPYAREA
+				   | FBINFO_HWACCEL_FILLRECT
+				   | ((sisfb_accel) ? 0 : FBINFO_HWACCEL_DISABLED);
 		sis_fb_info->var = default_var;
 		sis_fb_info->fix = sisfb_fix;
 		sis_fb_info->par = &ivideo;
diff -Nru a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
--- a/drivers/video/sis/sis_main.h	Wed Jun  2 22:51:34 2004
+++ b/drivers/video/sis/sis_main.h	Wed Jun  2 22:51:34 2004
@@ -402,7 +402,7 @@
 static int sisfb_fstn = 0;
 
 VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
-int 	   sisfb_accel = -1;
+static int sisfb_accel = -1; /* synced to !(info.flags & FBINFO_HWACCEL_DISABLED */
 
 /* These are to adapted according to VGA_ENGINE type */
 static int sisfb_hwcursor_size = 0;


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-06-06 13:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-03  2:44 [PATCH] sisfb accel capabilities David Eger
2004-06-03  9:52 ` Thomas Winischhofer
2004-06-03 13:26   ` David Eger
2004-06-03 15:07     ` Antonino A. Daplas
2004-06-03 16:40     ` Thomas Winischhofer
2004-06-03 17:08       ` David Eger
2004-06-06 11:19         ` Geert Uytterhoeven
2004-06-06 13:19           ` Thomas Winischhofer
2004-06-06 11:08   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).