Skip to contentSkip to conversation

radeonfb: more updates

PATCH New Benjamin Herrenschmidt 1 participant 1 message Feb 10, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 radeonfb: more updates

Hi James !

Some last minute updates to radeonfb :) Remove obsolete memset (and fix a bug where we would lose rinfo->info and thus crash at boot, I though I sent that fix to you already but apparently I missed it).

Remove some bitfields (useless & evil)

Also shield the accel functions vs. a sleeping ship (see my other comment, it's rather difficult to prevent fbcon to trying to draw anyway, so rather than adding dummy functions, I added those checks)

This drivers with the uptodate fbdev code works, sleeps & wakes up fine on pmac laptops.

drivers/video/aty/radeon_accel.c +8 -0
diff -urN fbdev-2.5/drivers/video/aty/radeon_accel.c linuxppc-2.5-benh/drivers/video/aty/radeon_accel.c
@@ -28,6 +28,8 @@
 	struct fb_fillrect modded;
 	int vxres, vyres;
   
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
 	if (radeon_accel_disabled()) {
 		cfb_fillrect(info, region);
 		return;
@@ -79,6 +81,8 @@
 	modded.width  = area->width;
 	modded.height = area->height;
   
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
 	if (radeon_accel_disabled()) {
 		cfb_copyarea(info, area);
 		return;
@@ -104,6 +108,8 @@
 {
 	struct radeonfb_info *rinfo = info->par;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
 	radeon_engine_idle();
 
 	cfb_imageblit(info, image);
@@ -113,6 +119,8 @@
 {
 	struct radeonfb_info *rinfo = info->par;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return 0;
 	radeon_engine_idle();
 
 	return 0;
drivers/video/aty/radeon_base.c +3 -7
diff -urN fbdev-2.5/drivers/video/aty/radeon_base.c linuxppc-2.5-benh/drivers/video/aty/radeon_base.c
@@ -727,7 +727,7 @@
 
 static int radeonfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info)
 {
-	struct radeonfb_info *rinfo = (struct radeonfb_info *) info->par;
+	struct radeonfb_info *rinfo = info->par;
         struct fb_var_screeninfo v;
         int nom, den;
 	unsigned int pitch;
@@ -1703,9 +1703,7 @@
 
 static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
 {
-	struct fb_info *info;
-
-	info = rinfo->info;
+	struct fb_info *info = rinfo->info;
 
 	info->currcon = -1;
 	info->par = rinfo;
@@ -2006,9 +2004,7 @@
 		return -ENODEV;
 	}
 	rinfo = info->par;
-	rinfo->info = info;
-	
-	memset (rinfo, 0, sizeof (struct radeonfb_info));
+	rinfo->info = info;	
 	rinfo->pdev = pdev;
 	
 	spin_lock_init(&rinfo->reg_lock);
drivers/video/aty/radeonfb.h +6 -6
diff -urN fbdev-2.5/drivers/video/aty/radeonfb.h linuxppc-2.5-benh/drivers/video/aty/radeonfb.h
@@ -285,12 +285,12 @@
 
 	int			pitch, bpp, depth;
 
-	int			has_CRTC2 : 1;
-	int			is_mobility : 1;
-	int			is_IGP : 1;
-	int			R300_cg_workaround : 1;
-	int			reversed_DAC : 1;
-	int			reversed_TMDS : 1;
+	int			has_CRTC2;
+	int			is_mobility;
+	int			is_IGP;
+	int			R300_cg_workaround;
+	int			reversed_DAC;
+	int			reversed_TMDS;
 	struct panel_info	panel_info;
 	int			mon1_type;
 	u8			*mon1_EDID;

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn