Skip to contentSkip to conversation

FB accel capabilities patch

PATCH In review David Eger 10 participants 18 messages May 19, 2004 – May 21, 2004

Subsystems (2)
lore
Share & tools
lore

David Eger

author
#0 lore raw

Dear Andrew,

A month or two ago I noticed that the framebuffer console driver doesn't know to do proper framebuffer acceleration in Linux 2.6; I've implemented a solution Geert suggested where each framebuffer driver advertizes its hardware capabilities via fb_info->flags. Please apply to -mm so I can get wider testing.

The patches are at:

http://www.yak.net/random/fbdev-patches/accel-cap-take2/relative2mainline/

The core of these patches is enabling the use of the following flags:

+/* FBIF = FB_Info.Flags */
+#define FBIF_MODULE 0x0001 /* Low-level driver is a module */
+#define FBIF_HWACCEL_DISABLED 0x0002
+
+/* hints */
+#define FBIF_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */
+#define FBIF_READS_FAST 0x0080 /* soft-copy faster than rendering */
+
+/* hardware supported ops */
+#define FBIF_HWACCEL_NONE 0x0000
+#define FBIF_HWACCEL_COPYAREA 0x0100
+#define FBIF_HWACCEL_FILLRECT 0x0200
+#define FBIF_HWACCEL_ROTATE 0x0400
+#define FBIF_HWACCEL_IMAGEBLIT 0x0800
+#define FBIF_HWACCEL_XPAN 0x1000
+#define FBIF_HWACCEL_YPAN 0x2000
+#define FBIF_HWACCEL_YWRAP 0x4000

Patches to each individual driver will trickle in as I get to them; Since these are only hints to the "application" of fbcon, the fact that the hints aren't yet accurate for all drivers (default is zero/one depending on if the fb driver is a module) is OK, and nothing should break with these patches. Each driver also doesn't have to reimplement a noaccel flag (to disable acceleration, mainly for testing new accel code), since it will be already in fb_info now ;-)

-dte

---
getting bounce messages from me? let me know and you'll go on my whitelist

#1 lore raw
Quoted 3 lines · David Eger

A month or two ago I noticed that the framebuffer console driver doesn't
know to do proper framebuffer acceleration in Linux 2.6;

For what fbdev operations will acceleration be used?

Quoted 4 lines

I've implemented
a solution Geert suggested where each framebuffer driver advertizes its hardware capabilities via fb_info->flags. Please apply to -mm so I can get wider testing.

The larger patch gets a bunch of rejects against Linus's current tree. Please update and resend.

Please send the patches via email, too. That way lots of people help to check your code and it's considerably less fiddly at my end.

Canonical form is one patch per email, with the changelog at the top of the email, with a useful Subject: which describes the patch. Each patch email will have a different subject, and that subject ain't the name of the file which holds the patch! The patch will be in the body of the email of your MUA is halfway sane. As an attachment if not.

Thanks.

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click

#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 2 lines · David Eger

A month or two ago I noticed that the framebuffer console driver doesn't
know to do proper framebuffer acceleration in Linux 2.6;

For what fbdev operations will acceleration be used?

Text console acceleration (rectangle copy, rectangle fill, bitmap expansion, panning, y-wrap). These have been in use since ages, but the current 2.6 fbcon code doesn't use all of it anymore.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click

#3 lore raw
In reply to Andrew Morton
Quoted 6 lines · Andrew Morton
Quoted 3 lines · David Eger

A month or two ago I noticed that the framebuffer console driver doesn't
know to do proper framebuffer acceleration in Linux 2.6;

For what fbdev operations will acceleration be used?

Ok, the story is ... fbdevs do have optional accel hooks for copyarea, rectfill, and imageblit. However, the current fbcon console subsystem doesn't properly adapt it's drawing techniques based on the accel capabilities (blit + redraw is more efficient for example when you have a fast accelerated copyarea, while full redraw is better in other cases, etc...)

This patch adds "hints" provided by the fbdev to inform fbcon what are its accel capabilities.

Ben.

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

#4 lore raw

[OT ML related]

I all,
sorry for posting this issue here, but I don't know a better place.

My propose is to prepend every message coming from this ML with a fixed and significant string, my choice is "[LKML]: "

It is true I can already filter the ML header, but such a string would be a great aid for an eye-driven search whenever I had to look at my inbox from a pine on a machine different from the mine.

tnx

Signature · 4 lines
<?php echo '       Emiliano `AlberT` Gabrielli       '."\n".
           '  E-Mail: AlberT_AT_SuperAlberT_it  '."\n".
           '  Web:    http://SuperAlberT.it  '."\n".
'  IRC:    #php,#AES azzurra.com '."\n".'ICQ: 158591185'; ?>
#5 lore raw

Re: [OT ML related]

From: Emiliano 'AlberT' Gabrielli <[email protected]>
Date: Thu, May 20, 2004 at 10:19:51AM +0200

Quoted 3 lines

My propose is to prepend every message coming from this ML with a fixed and significant string, my choice is "[LKML]: "

Use procmail and do it yourself.

Jurriaan

Signature · 3 lines
If it sounds too good to be true, it's probably Linux.
	Seen on Usenet
Debian (Unstable) GNU/Linux 2.6.6-mm4 2x6062 bogomips 1.04 1.98
#6 lore raw

Re: [OT ML related]

Quoted 4 lines · Jurriaan
Quoted 2 lines

My propose is to prepend every message coming from this ML with a fixed and significant string, my choice is "[LKML]: "

Use procmail and do it yourself.

uhm... what a nice answer...

Signature · 4 lines
<?php echo '       Emiliano `AlberT` Gabrielli       '."\n".
           '  E-Mail: AlberT_AT_SuperAlberT_it  '."\n".
           '  Web:    http://SuperAlberT.it  '."\n".
'  IRC:    #php,#AES azzurra.com '."\n".'ICQ: 158591185'; ?>
#7 lore raw

Re: [OT ML related]

Hi Emiliano :)

* Emiliano 'AlberT' Gabrielli <[email protected]> dixit:

Quoted 5 lines · Jurriaan
Quoted 3 lines
Quoted 2 lines

My propose is to prepend every message coming from this ML with a fixed and significant string, my choice is "[LKML]: "

Use procmail and do it yourself.

uhm... what a nice answer...

It is, really, because it you look at the headers of messages
coming from the LKML, they have a X-Mailing-List header you can use for filtering, so there is no need to add a string in the subject. If you look at common subjects in this list, you can see some of them are pretty large, so prepending '[LKML]:' will be bloat.

You can use procmail to do that filtering based upon the
X-Mailing-List header, but you can also use your Mail User Agent to do more or less the same. I see you use KMail, and I don't know if you can use it to filter messages, but you can do with mutt or elmo (AFAIK) without procmail.

IMHO, adding a string to the subject (I assume that you were
talking about adding the string to the subject and not to the message body) is not needed and will impose visual clutter. If you cannot (or don't want to) use procmail, try to do the filtering with your MUA if it is powerful enough.

Raúl Núñez de Arenas Coronado

Signature · 2 lines
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
#8 lore raw

Re: [OT ML related]

Quoted 5 lines · DervishD

IMHO, adding a string to the subject (I assume that you were
talking about adding the string to the subject and not to the message body) is not needed and will impose visual clutter. If you cannot (or don't want to) use procmail, try to do the filtering with your MUA if it is powerful enough.

Obviously I know that I can filter it using the header (I said it in my first post)... but my opinion is that a prepended string in the Subject can be very usefull... I understand that here nobody thinks the same thing, so never mind :-)

Signature · 4 lines
<?php echo '       Emiliano `AlberT` Gabrielli       '."\n".
           '  E-Mail: AlberT_AT_SuperAlberT_it  '."\n".
           '  Web:    http://SuperAlberT.it  '."\n".
'  IRC:    #php,#AES azzurra.com '."\n".'ICQ: 158591185'; ?>
#9 lore raw

Re: [OT ML related]

Quoted 11 lines · Emiliano 'AlberT' Gabrielli
Quoted 5 lines · DervishD

IMHO, adding a string to the subject (I assume that you were
talking about adding the string to the subject and not to the message body) is not needed and will impose visual clutter. If you cannot (or don't want to) use procmail, try to do the filtering with your MUA if it is powerful enough.

Obviously I know that I can filter it using the header (I said it in my first post)... but my opinion is that a prepended string in the Subject can be very usefull... I understand that here nobody thinks the same thing, so never mind :-)

You're not the first to ask the question. It's actually been asked too many times before, so we have a URL to point people at:

	http://lkml.org/faq/lkmlfaq-3.html#s3-18
Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core
#10 lore raw

PATCH 1/4 James' fbcon init and con2fb cleanup

In reply to Andrew Morton

James' patch to fix up the fbcon initialization sequence:
fixes con2fb initialization

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet

#   2004/05/15 21:42:23+02:00 [email protected] 
#   fbcon initialization cleanup; No more calling fb_console_init twice. 
#   - James Simmons
# 
# drivers/video/fbmem.c
#   2004/05/15 21:36:32+02:00 [email protected] +2 -2
#   fb con init cleanup
# 
# drivers/video/console/fbcon.h
#   2004/05/15 21:36:32+02:00 [email protected] +1 -1
#   fix con2fb API
# 
# drivers/video/console/fbcon.c
#   2004/05/15 21:36:31+02:00 [email protected] +21 -28
#   fbcon init cleanup:
#    factor out retrieving the vc_data from the fbcon_event_notify path
#    remove fbcon_event_notifier_registered cruft
#    cleanup/fix con2fb code
# 
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	Sat May 15 22:54:19 2004
+++ b/drivers/video/console/fbcon.c	Sat May 15 22:54:19 2004
@@ -296,15 +296,17 @@
  *	Maps a virtual console @unit to a frame buffer device
  *	@newidx.
  */
-int set_con2fb_map(int unit, int newidx)
+int set_con2fb_map(int start, int end, int newidx)
 {
-	struct vc_data *vc = vc_cons[unit].d;
+	struct vc_data *vc = vc_cons[start].d;
+	int i;

if (!vc)
return -ENODEV;
- con2fb_map[unit] = newidx;
+ for (i = start; i < end; i++)
+ con2fb_map[i] = newidx;
fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
- return take_over_console(&fb_con, unit, unit, fbcon_is_default);
+ return take_over_console(&fb_con, start, end, fbcon_is_default);
}

/*
@@ -2203,34 +2205,32 @@
return 0;
}

-static void fbcon_suspended(struct fb_info *info)
+static void fbcon_suspended(struct fb_info *info, struct vc_data *vc)
{
/* Clear cursor, restore saved data */
- info->cursor.enable = 0;
- info->fbops->fb_cursor(info, &info->cursor);
+ fbcon_cursor(vc, CM_ERASE);
}

-static void fbcon_resumed(struct fb_info *info)
+static void fbcon_resumed(struct fb_info *info, struct vc_data *vc)
{
- struct vc_data *vc;
-
- if (info->currcon < 0)
- return;
- vc = vc_cons[info->currcon].d;
-
update_screen(vc->vc_num);
}
static int fbcon_event_notify(struct notifier_block *self,
unsigned long action, void *data)
{
struct fb_info *info = (struct fb_info *) data;
+ struct vc_data *vc;
+
+ if (info->currcon < 0)
+ return 0;
+ vc = vc_cons[info->currcon].d;

switch(action) {
case FB_EVENT_SUSPEND:
- fbcon_suspended(info);
+ fbcon_suspended(info, vc);
break;
case FB_EVENT_RESUME:
- fbcon_resumed(info);
+ fbcon_resumed(info, vc);
break;
}
return 0;
@@ -2265,12 +2265,14 @@
.notifier_call = fbcon_event_notify,
};

-static int fbcon_event_notifier_registered;
-
int __init fb_console_init(void)
{
int err;

+ acquire_console_sem();
+ fb_register_client(&fbcon_event_notifer);
+ release_console_sem();
+
if (!num_registered_fb)
return -ENODEV;

@@ -2281,12 +2283,6 @@
if (err)
return err;

- acquire_console_sem();
- if (!fbcon_event_notifier_registered) {
- fb_register_client(&fbcon_event_notifer);
- fbcon_event_notifier_registered = 1;
- }
- release_console_sem();
return 0;
}

@@ -2289,10 +2285,7 @@
void __exit fb_console_exit(void)
{
acquire_console_sem();
- if (fbcon_event_notifier_registered) {
- fb_unregister_client(&fbcon_event_notifer);
- fbcon_event_notifier_registered = 0;
- }
+ fb_unregister_client(&fbcon_event_notifer);
release_console_sem();
give_up_console(&fb_con);
}

drivers/video/console/fbcon.h +1 -1
diff -Nru a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
@@ -38,7 +38,7 @@
 
 /* drivers/video/console/fbcon.c */
 extern char con2fb_map[MAX_NR_CONSOLES];
-extern int set_con2fb_map(int unit, int newidx);
+extern int set_con2fb_map(int start, int end, int newidx);
 
     /*
      *  Attribute Decoding
drivers/video/fbmem.c +2 -2
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
@@ -1096,9 +1096,9 @@
 		if (!registered_fb[con2fb.framebuffer])
 		    return -EINVAL;
 		if (con2fb.console != 0)
-			set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
+			set_con2fb_map(con2fb.console-1, con2fb.console-1, con2fb.framebuffer);
 		else
-			fb_console_init();		
+			set_con2fb_map(0, MAX_NR_CONSOLES, con2fb.framebuffer);
 		return 0;
 #endif	/* CONFIG_FRAMEBUFFER_CONSOLE */
 	case FBIOBLANK:
#11 lore raw

PATCH 2/4 FB accel capabilities (core update)

Baseline patch to make framebuffer/fbcon interaction more sane by basing the fbcon heuristics on capabilities advertized by underlying framebuffer via the fb_info.flags field.

This patch updates fbcon, fb.h, and skeletonfb.c.
It does *not* yet update the drivers themselves. They should compile and work, but their hinting is not correct yet, meaning most fb drivers will be slow until I set the flags to the right hinting driver-by-driver.

drivers/video/console/fbcon.c +51 -50
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
@@ -599,15 +599,14 @@
 static void fbcon_init(struct vc_data *vc, int init)
 {
 	int unit = vc->vc_num;
-	struct fb_info *info;
 
-	/* on which frame buffer will we open this console? */
-	info = registered_fb[(int) con2fb_map[unit]];
+	/* get the frame buffer capabilities for the fb we are opening */
+	int cap = registered_fb[(int) con2fb_map[unit]]->flags;
 	
-	if (info->var.accel_flags)
-		fb_display[unit].scrollmode = SCROLL_YNOMOVE;
-	else
-		fb_display[unit].scrollmode = SCROLL_YREDRAW;
+	if ((cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED))
+		fb_display[unit].scrollmode = SCROLL_ACCEL;
+	else /* default to something safe */
+		fb_display[unit].scrollmode = SCROLL_REDRAW;
 	con_set_default_unimap(unit);
 	fbcon_set_display(vc, init, !init);
 }
@@ -622,21 +621,23 @@
 static __inline__ void updatescrollmode(struct display *p, struct vc_data *vc)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	int cap = info->flags;
 
-	int m;
-	if (p->scrollmode & __SCROLL_YFIXED)
-		return;
-	if (divides(info->fix.ywrapstep, vc->vc_font.height) &&
-	    divides(vc->vc_font.height, info->var.yres_virtual))
-		m = __SCROLL_YWRAP;
-	else if (divides(info->fix.ypanstep, vc->vc_font.height) &&
+	if ((cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED))
+		p->scrollmode = SCROLL_ACCEL;
+	else if ((cap & FBINFO_HWACCEL_YWRAP) &&
+		divides(info->fix.ywrapstep, vc->vc_font.height) &&
+		divides(vc->vc_font.height, info->var.yres_virtual))
+		p->scrollmode = SCROLL_WRAP;
+	else if ((cap & FBINFO_HWACCEL_YPAN) &&
+		 divides(info->fix.ypanstep, vc->vc_font.height) &&
 		 info->var.yres_virtual >= info->var.yres + vc->vc_font.height)
-		m = __SCROLL_YPAN;
-	else if (p->scrollmode & __SCROLL_YNOMOVE)
-		m = __SCROLL_YREDRAW;
+		p->scrollmode = SCROLL_PAN;
+	else if (cap & FBINFO_READS_FAST)
+		/* okay, we'll use software version of accel funcs... */
+		p->scrollmode = SCROLL_ACCEL; 
 	else
-		m = __SCROLL_YMOVE;
-	p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
+		p->scrollmode = SCROLL_REDRAW;
 }
 
 static void fbcon_set_display(struct vc_data *vc, int init, int logo)
@@ -647,7 +648,7 @@
 	unsigned short *save = NULL, *r, *q;
 	struct font_desc *font;
 
-	if (vc->vc_num != fg_console || (info->flags & FBINFO_FLAG_MODULE) ||
+	if (vc->vc_num != fg_console || (info->flags & FBINFO_MODULE) ||
 	    (info->fix.type == FB_TYPE_TEXT))
 		logo = 0;
 
@@ -1311,7 +1312,7 @@
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	int scroll_partial = !(p->scrollmode & __SCROLL_YNOPARTIAL);
+	int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
 
 	if (!info->fbops->fb_blank && console_blanked)
 		return 0;
@@ -1335,15 +1336,15 @@
 			fbcon_softback_note(vc, t, count);
 		if (logo_shown >= 0)
 			goto redraw_up;
-		switch (p->scrollmode & __SCROLL_YMASK) {
-		case __SCROLL_YMOVE:
+		switch (p->scrollmode) {
+		case SCROLL_ACCEL:
 			accel_bmove(vc, info, t + count, 0, t, 0,
 					 b - t - count, vc->vc_cols);
 			accel_clear(vc, info, b - count, 0, count,
 					 vc->vc_cols);
 			break;
 
-		case __SCROLL_YWRAP:
+		case SCROLL_WRAP:
 			if (b - t - count > 3 * vc->vc_rows >> 2) {
 				if (t > 0)
 					fbcon_bmove(vc, 0, 0, count, 0, t,
@@ -1353,15 +1354,15 @@
 					fbcon_bmove(vc, b - count, 0, b, 0,
 						    vc->vc_rows - b,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_up;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t + count, 0, t, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_up;
 			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YPAN:
+		case SCROLL_PAN:
 			if ((p->yscroll + count <=
 			     2 * (p->vrows - vc->vc_rows))
 			    && ((!scroll_partial && (b - t == vc->vc_rows))
@@ -1376,15 +1377,15 @@
 					fbcon_bmove(vc, b - count, 0, b, 0,
 						    vc->vc_rows - b,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_up;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t + count, 0, t, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_up;
 			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YREDRAW:
+		case SCROLL_REDRAW:
 		      redraw_up:
 			fbcon_redraw(vc, p, t, b - t - count,
 				     count * vc->vc_cols);
@@ -1402,14 +1403,14 @@
 	case SM_DOWN:
 		if (count > vc->vc_rows)	/* Maximum realistic size */
 			count = vc->vc_rows;
-		switch (p->scrollmode & __SCROLL_YMASK) {
-		case __SCROLL_YMOVE:
+		switch (p->scrollmode) {
+		case SCROLL_ACCEL:
 			accel_bmove(vc, info, t, 0, t + count, 0,
 					 b - t - count, vc->vc_cols);
 			accel_clear(vc, info, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YWRAP:
+		case SCROLL_WRAP:
 			if (b - t - count > 3 * vc->vc_rows >> 2) {
 				if (vc->vc_rows - b > 0)
 					fbcon_bmove(vc, b, 0, b - count, 0,
@@ -1419,15 +1420,15 @@
 				if (t > 0)
 					fbcon_bmove(vc, count, 0, 0, 0, t,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_down;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t, 0, t + count, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_down;
 			fbcon_clear(vc, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YPAN:
+		case SCROLL_PAN:
 			if ((count - p->yscroll <= p->vrows - vc->vc_rows)
 			    && ((!scroll_partial && (b - t == vc->vc_rows))
 				|| (scroll_partial
@@ -1441,15 +1442,15 @@
 				if (t > 0)
 					fbcon_bmove(vc, count, 0, 0, 0, t,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_down;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t, 0, t + count, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_down;
 			fbcon_clear(vc, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YREDRAW:
+		case SCROLL_REDRAW:
 		      redraw_down:
 			fbcon_redraw(vc, p, b - 1, b - t - count,
 				     -count * vc->vc_cols);
@@ -1594,12 +1595,12 @@
 	}
 	if (info)
 		info->var.yoffset = p->yscroll = 0;
-        fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
-	switch (p->scrollmode & __SCROLL_YMASK) {
-	case __SCROLL_YWRAP:
+ 	fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
+	switch (p->scrollmode) {
+	case SCROLL_WRAP:
 		scrollback_phys_max = p->vrows - vc->vc_rows;
 		break;
-	case __SCROLL_YPAN:
+	case SCROLL_PAN:
 		scrollback_phys_max = p->vrows - 2 * vc->vc_rows;
 		if (scrollback_phys_max < 0)
 			scrollback_phys_max = 0;
@@ -2173,11 +2174,11 @@
 
 	offset = p->yscroll - scrollback_current;
 	limit = p->vrows;
-	switch (p->scrollmode && __SCROLL_YMASK) {
-	case __SCROLL_YWRAP:
+	switch (p->scrollmode) {
+	case SCROLL_WRAP:
 		info->var.vmode |= FB_VMODE_YWRAP;
 		break;
-	case __SCROLL_YPAN:
+	case SCROLL_PAN:
 		limit -= vc->vc_rows;
 		info->var.vmode &= ~FB_VMODE_YWRAP;
 		break;
drivers/video/console/fbcon.h +19 -32

59 lines not on this page · raw message

drivers/video/skeletonfb.c +7 -1
diff -Nru a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
@@ -539,7 +539,13 @@
     info.fbops = &xxxfb_ops;
     info.fix = xxxfb_fix;
     info.pseudo_palette = pseudo_palette;
-    info.flags = FBINFO_FLAG_DEFAULT;
+
+    /*
+     * Set up flags to indicate what sort of acceleration your
+     * driver can provide (pan/wrap/copyarea/etc.) and whether it 
+     * is a module -- see FBINFO_* in include/linux/fb.h
+     */
+    info.flags = FBINFO_DEFAULT;
     info.par = current_par;
 
     /*
include/linux/fb.h +25 -6
diff -Nru a/include/linux/fb.h b/include/linux/fb.h
@@ -125,7 +125,8 @@
 	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
 					/* (physical address) */
 	__u32 mmio_len;			/* Length of Memory Mapped I/O  */
-	__u32 accel;			/* Type of acceleration available */
+	__u32 accel;			/* Indicate to driver which	*/
+					/*  specific chip/card we have	*/
 	__u16 reserved[3];		/* Reserved for future compatibility */
 };
 
@@ -154,7 +155,7 @@
 #define FB_ACTIVATE_ALL	       64	/* change all VCs on this fb	*/
 #define FB_ACTIVATE_FORCE     128	/* force apply even when no change*/
 
-#define FB_ACCELF_TEXT		1	/* text mode acceleration */
+#define FB_ACCELF_TEXT		1	/* (OBSOLETE) see fb_info.flags and vc_mode */
 
 #define FB_SYNC_HOR_HIGH_ACT	1	/* horizontal sync high active	*/
 #define FB_SYNC_VERT_HIGH_ACT	2	/* vertical sync high active	*/
@@ -200,7 +201,7 @@
 	__u32 height;			/* height of picture in mm    */
 	__u32 width;			/* width of picture in mm     */
 
-	__u32 accel_flags;		/* acceleration flags (hints)	*/
+	__u32 accel_flags;		/* (OBSOLETE) see fb_info.flags */
 
 	/* Timing: All values in pixclocks, except pixclock (of course) */
 	__u32 pixclock;			/* pixel clock in ps (pico seconds) */
@@ -502,10 +503,28 @@
 	int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
 };
 
+/* FBINFO_* = fb_info.flags bit flags */
+#define FBINFO_MODULE		0x0001	/* Low-level driver is a module */
+#define FBINFO_HWACCEL_DISABLED	0x0002
+
+/* hints */
+#define FBINFO_PARTIAL_PAN_OK	0x0040 /* otw use pan only for double-buffering */
+#define FBINFO_READS_FAST		0x0080 /* soft-copy faster than rendering */
+
+/* hardware supported ops */
+#define FBINFO_HWACCEL_NONE	0x0000
+#define FBINFO_HWACCEL_COPYAREA	0x0100
+#define FBINFO_HWACCEL_FILLRECT	0x0200
+#define FBINFO_HWACCEL_ROTATE	0x0400
+#define FBINFO_HWACCEL_IMAGEBLIT	0x0800
+#define FBINFO_HWACCEL_XPAN	0x1000
+#define FBINFO_HWACCEL_YPAN	0x2000
+#define FBINFO_HWACCEL_YWRAP	0x4000
+
+
 struct fb_info {
 	int node;
 	int flags;
-#define FBINFO_FLAG_MODULE	1	/* Low-level driver is a module */
 	struct fb_var_screeninfo var;	/* Current var */
 	struct fb_fix_screeninfo fix;	/* Current fix */
 	struct fb_monspecs monspecs;	/* Current Monitor specs */
@@ -528,9 +547,9 @@
 };
 
 #ifdef MODULE
-#define FBINFO_FLAG_DEFAULT	FBINFO_FLAG_MODULE
+#define FBINFO_DEFAULT	FBINFO_MODULE
 #else
-#define FBINFO_FLAG_DEFAULT	0
+#define FBINFO_DEFAULT	0
 #endif
 
 // This will go away
#12 lore raw

Re: [PATCH 1/4] James' fbcon init and con2fb cleanup

In reply to David Eger

I'm going to be sending these patch's very shortly to Andrew. I'm preparing the tree for him still.

Quoted 172 lines · David Eger

James' patch to fix up the fbcon initialization sequence:
fixes con2fb initialization

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet

#   2004/05/15 21:42:23+02:00 [email protected] 
#   fbcon initialization cleanup; No more calling fb_console_init twice. 
#   - James Simmons
# 
# drivers/video/fbmem.c
#   2004/05/15 21:36:32+02:00 [email protected] +2 -2
#   fb con init cleanup
# 
# drivers/video/console/fbcon.h
#   2004/05/15 21:36:32+02:00 [email protected] +1 -1
#   fix con2fb API
# 
# drivers/video/console/fbcon.c
#   2004/05/15 21:36:31+02:00 [email protected] +21 -28
#   fbcon init cleanup:
#    factor out retrieving the vc_data from the fbcon_event_notify path
#    remove fbcon_event_notifier_registered cruft
#    cleanup/fix con2fb code
# 
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
drivers/video/console/fbcon.c +21 -28
@@ -296,15 +296,17 @@
  *	Maps a virtual console @unit to a frame buffer device
  *	@newidx.
  */
-int set_con2fb_map(int unit, int newidx)
+int set_con2fb_map(int start, int end, int newidx)
 {
-	struct vc_data *vc = vc_cons[unit].d;
+	struct vc_data *vc = vc_cons[start].d;
+	int i;
 
 	if (!vc)
 		return -ENODEV;
-	con2fb_map[unit] = newidx;
+	for (i = start; i < end; i++)
+		con2fb_map[i] = newidx;
 	fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
-	return take_over_console(&fb_con, unit, unit, fbcon_is_default);
+	return take_over_console(&fb_con, start, end, fbcon_is_default);
 }
 
 /*
@@ -2203,34 +2205,32 @@
 	return 0;
 }
 
-static void fbcon_suspended(struct fb_info *info)
+static void fbcon_suspended(struct fb_info *info, struct vc_data *vc)
 {
 	/* Clear cursor, restore saved data */
-	info->cursor.enable = 0;
-	info->fbops->fb_cursor(info, &info->cursor);
+	fbcon_cursor(vc, CM_ERASE);
 }
 
-static void fbcon_resumed(struct fb_info *info)
+static void fbcon_resumed(struct fb_info *info, struct vc_data *vc)
 {
-	struct vc_data *vc;
-
-	if (info->currcon < 0)
-		return;
-	vc = vc_cons[info->currcon].d;
-
 	update_screen(vc->vc_num);
 }
 static int fbcon_event_notify(struct notifier_block *self, 
 			      unsigned long action, void *data)
 {
 	struct fb_info *info = (struct fb_info *) data;
+	struct vc_data *vc;
+
+	if (info->currcon < 0)
+		return 0;
+	vc = vc_cons[info->currcon].d;
 
 	switch(action) {
 	case FB_EVENT_SUSPEND:
-		fbcon_suspended(info);
+		fbcon_suspended(info, vc);
 		break;
 	case FB_EVENT_RESUME:
-		fbcon_resumed(info);
+		fbcon_resumed(info, vc);
 		break;
 	}
 	return 0;
@@ -2265,12 +2265,14 @@
 	.notifier_call	= fbcon_event_notify,
 };
 
-static int fbcon_event_notifier_registered;
-
 int __init fb_console_init(void)
 {
 	int err;
 
+	acquire_console_sem();
+	fb_register_client(&fbcon_event_notifer);
+	release_console_sem();
+
 	if (!num_registered_fb)
 		return -ENODEV;
 
@@ -2281,12 +2283,6 @@
 	if (err)
 		return err;
 
-	acquire_console_sem();
-	if (!fbcon_event_notifier_registered) {
-		fb_register_client(&fbcon_event_notifer);
-		fbcon_event_notifier_registered = 1;
-	} 
-	release_console_sem();
 	return 0;
 }
 
@@ -2289,10 +2285,7 @@
 void __exit fb_console_exit(void)
 {
 	acquire_console_sem();
-	if (fbcon_event_notifier_registered) {
-		fb_unregister_client(&fbcon_event_notifer);
-		fbcon_event_notifier_registered = 0;
-	}
+	fb_unregister_client(&fbcon_event_notifer);
 	release_console_sem();
 	give_up_console(&fb_con);
 }	

diff -Nru a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h

drivers/video/console/fbcon.h +1 -1
@@ -38,7 +38,7 @@
 
 /* drivers/video/console/fbcon.c */
 extern char con2fb_map[MAX_NR_CONSOLES];
-extern int set_con2fb_map(int unit, int newidx);
+extern int set_con2fb_map(int start, int end, int newidx);
 
     /*
      *  Attribute Decoding

diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c

drivers/video/fbmem.c +2 -3
@@ -1096,9 +1096,9 @@
 		if (!registered_fb[con2fb.framebuffer])
 		    return -EINVAL;
 		if (con2fb.console != 0)
-			set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
+			set_con2fb_map(con2fb.console-1, con2fb.console-1, con2fb.framebuffer);
 		else
-			fb_console_init();		
+			set_con2fb_map(0, MAX_NR_CONSOLES, con2fb.framebuffer);
 		return 0;
 #endif	/* CONFIG_FRAMEBUFFER_CONSOLE */
 	case FBIOBLANK:
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#13 lore raw

PATCH 3/4 s/FBINFO_FLAG_/FBINFO_/g

In reply to David Eger

# This is a BitKeeper generated diff -Nru style patch. #
# 2004/05/15 14:09:31+02:00 [email protected]
# Baseline patch to make framebuffer/fbcon interaction more sane by
# basing the fbcon heuristics on capabilities advertized by underlying
# framebuffer via the fb_info.flags field.
#
# This patch runs 's/FBINFO_FLAG_DEFAULT/FBINFO_DEFAULT/g' on the fb drivers
# to let them compile with the new flags (see part a of this patch).
#

drivers/video/S3triofb.c +1 -1
diff -Nru a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c
@@ -536,7 +536,7 @@
     fb_info.setcmap = &s3triofbcon_setcmap;
 #endif
 
-    fb_info.flags = FBINFO_FLAG_DEFAULT;
+    fb_info.flags = FBINFO_DEFAULT;
     if (register_framebuffer(&fb_info) < 0)
 	return;
 
drivers/video/amifb.c +1 -1
diff -Nru a/drivers/video/amifb.c b/drivers/video/amifb.c
@@ -2382,7 +2382,7 @@
 
 	fb_info.fbops = &amifb_ops;
 	fb_info.par = &currentpar;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, ami_modedb,
 			  NUM_TOTAL_MODES, &ami_modedb[defmode], 4)) {
drivers/video/atafb.c +1 -1
diff -Nru a/drivers/video/atafb.c b/drivers/video/atafb.c
@@ -2798,7 +2798,7 @@
 	fb_info.currcon = -1;
 	fb_info.switch_con = &atafb_switch;
 	fb_info.updatevar = &fb_update_var;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 	do_fb_set_var(&atafb_predefined[default_par-1], 1);
 	strcat(fb_info.modename, fb_var_names[default_par-1][0]);
 
drivers/video/aty/aty128fb.c +1 -1
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
@@ -1771,7 +1771,7 @@
 
 	/* fill in info */
 	info->fbops = &aty128fb_ops;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 #ifdef CONFIG_PMAC_PBOOK
 	par->lcd_on = default_lcd_on;
drivers/video/aty/atyfb_base.c +1 -1
diff -Nru a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
@@ -1790,7 +1790,7 @@
 
 	info->fbops = &atyfb_ops;
 	info->pseudo_palette = pseudo_palette;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 #ifdef CONFIG_PMAC_BACKLIGHT
 	if (M64_HAS(G3_PB_1_1) && machine_is_compatible("PowerBook1,1")) {
drivers/video/aty/radeon_base.c +1 -1
diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
@@ -1781,7 +1781,7 @@
 	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
-        info->flags = FBINFO_FLAG_DEFAULT;
+        info->flags = FBINFO_DEFAULT;
         info->fbops = &radeonfb_ops;
         info->display_fg = NULL;
         info->screen_base = (char *)rinfo->fb_base;
drivers/video/bw2.c +1 -1
diff -Nru a/drivers/video/bw2.c b/drivers/video/bw2.c
@@ -347,7 +347,7 @@
 
 	all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &bw2_ops;
 #if defined(CONFIG_SPARC32)
 	if (sdev)
drivers/video/cg14.c +1 -1
diff -Nru a/drivers/video/cg14.c b/drivers/video/cg14.c
@@ -550,7 +550,7 @@
 	all->par.mode = MDI_8_PIX;
 	all->par.ramsize = (is_8mb ? 0x800000 : 0x400000);
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &cg14_ops;
 	all->info.currcon = -1;
 	all->info.par = &all->par;
drivers/video/cg3.c +1 -1
diff -Nru a/drivers/video/cg3.c b/drivers/video/cg3.c
@@ -398,7 +398,7 @@
 		sbus_ioremap(&sdev->resource[0], CG3_REGS_OFFSET,
 			     sizeof(struct cg3_regs), "cg3 regs");
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &cg3_ops;
 #ifdef CONFIG_SPARC32
 	all->info.screen_base = (char *)
drivers/video/cg6.c +1 -1
diff -Nru a/drivers/video/cg6.c b/drivers/video/cg6.c
@@ -712,7 +712,7 @@
 		sbus_ioremap(&sdev->resource[0], CG6_FHC_OFFSET,
 			     sizeof(u32), "cgsix fhc");
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &cg6_ops;
 #ifdef CONFIG_SPARC32
 	all->info.screen_base = (char *)
drivers/video/chipsfb.c +1 -1
diff -Nru a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
@@ -362,7 +362,7 @@
 	p->var = chipsfb_var;
 
 	p->fbops = &chipsfb_ops;
-	p->flags = FBINFO_FLAG_DEFAULT;
+	p->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&p->cmap, 256, 0);
 
drivers/video/cirrusfb.c +1 -1
diff -Nru a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
@@ -2786,7 +2786,7 @@
 	fb_info->gen.info.changevar = NULL;
 	fb_info->gen.info.switch_con = &fbgen_switch;
 	fb_info->gen.info.updatevar = &fbgen_update_var;
-	fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info->gen.info.flags = FBINFO_DEFAULT;
 
 	for (j = 0; j < 256; j++) {
 		if (j < 16) {
drivers/video/clps711xfb.c +1 -1
diff -Nru a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c
@@ -372,7 +372,7 @@
 	strcpy(cfb->fix.id, "clps711x");
 
 	cfb->fbops		= &clps7111fb_ops;
-	cfb->flags		= FBINFO_FLAG_DEFAULT;
+	cfb->flags		= FBINFO_DEFAULT;
 
 	clps711x_guess_lcd_params(cfb);
 
drivers/video/controlfb.c +1 -1
diff -Nru a/drivers/video/controlfb.c b/drivers/video/controlfb.c
@@ -1010,7 +1010,7 @@
 	info->par = &p->par;
 	info->fbops = &controlfb_ops;
 	info->pseudo_palette = p->pseudo_palette;
-        info->flags = FBINFO_FLAG_DEFAULT;
+        info->flags = FBINFO_DEFAULT;
 	info->screen_base = (char *) p->frame_buffer + CTRLFB_OFF;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
drivers/video/cyber2000fb.c +1 -1
diff -Nru a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
@@ -1281,7 +1281,7 @@
 	cfb->fb.var.accel_flags	= FB_ACCELF_TEXT;
 
 	cfb->fb.fbops		= &cyber2000fb_ops;
-	cfb->fb.flags		= FBINFO_FLAG_DEFAULT;
+	cfb->fb.flags		= FBINFO_DEFAULT;
 	cfb->fb.pseudo_palette	= (void *)(cfb + 1);
 
 	fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);
drivers/video/ffb.c +1 -1
diff -Nru a/drivers/video/ffb.c b/drivers/video/ffb.c
@@ -1027,7 +1027,7 @@
 	all->par.prom_node = node;
 	all->par.prom_parent_node = parent;
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &ffb_ops;
 	all->info.screen_base = (char *) all->par.physbase + FFB_DFB24_POFF;
 	all->info.currcon = -1;
drivers/video/fm2fb.c +1 -1
diff -Nru a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
@@ -280,7 +280,7 @@
 	info->pseudo_palette = info->par;
 	info->par = NULL;
 	info->fix = fb_fix;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	if (register_framebuffer(info) < 0) {
 		fb_dealloc_cmap(&info->cmap);
drivers/video/g364fb.c +1 -1
diff -Nru a/drivers/video/g364fb.c b/drivers/video/g364fb.c
@@ -241,7 +241,7 @@
 	fb_info.screen_base = (char *) G364_MEM_BASE;	/* virtual kernel address */
 	fb_info.var = fb_var;
 	fb_info.fix = fb_fix;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&fb_info.cmap, 255, 0);
 
drivers/video/hgafb.c +1 -1
diff -Nru a/drivers/video/hgafb.c b/drivers/video/hgafb.c
@@ -558,7 +558,7 @@
 	hga_fix.smem_start = VGA_MAP_MEM(hga_vram_base);
 	hga_fix.smem_len = hga_vram_len;
 
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 	fb_info.var = hga_default_var;
 	fb_info.fix = hga_fix;
 	fb_info.monspecs.hfmin = 0;
drivers/video/hitfb.c +1 -1
diff -Nru a/drivers/video/hitfb.c b/drivers/video/hitfb.c
@@ -321,7 +321,7 @@
 	fb_info.var = hitfb_var;
 	fb_info.fix = hitfb_fix;
 	fb_info.pseudo_palette = pseudo_palette;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	fb_info.screen_base = (void *)hitfb_fix.smem_start;
 
drivers/video/hpfb.c +1 -1
diff -Nru a/drivers/video/hpfb.c b/drivers/video/hpfb.c
@@ -151,7 +151,7 @@
 	 *	Let there be consoles..
 	 */
 	fb_info.fbops = &hpfb_ops;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 	fb_info.var   = hpfb_defined;
 	fb_info.fix   = hpfb_fix;
 	fb_info.screen_base = (char *)hpfb_fix.smem_start;	// FIXME
drivers/video/i810/i810_main.c +1 -1
diff -Nru a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
@@ -1879,7 +1879,7 @@
 	info->screen_base = par->fb.virtual;
 	info->fbops = &par->i810fb_ops;
 	info->pseudo_palette = par->pseudo_palette;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 	
 	fb_alloc_cmap(&info->cmap, 256, 0);
 
drivers/video/igafb.c +1 -1
diff -Nru a/drivers/video/igafb.c b/drivers/video/igafb.c
@@ -357,7 +357,7 @@
                 video_cmap_len = 256;
 
 	info->fbops = &igafb_ops;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&info->cmap, video_cmap_len, 0);
 
drivers/video/imsttfb.c +1 -1
diff -Nru a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
@@ -1441,7 +1441,7 @@
 	info->var.pixclock = 1000000 / getclkMHz(par);
 
 	info->fbops = &imsttfb_ops;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&info->cmap, 0, 0);
 
drivers/video/kyro/fbdev.c +1 -1
diff -Nru a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
@@ -714,7 +714,7 @@
 	info->fix		= kyro_fix;
 	info->par		= currentpar;
 	info->pseudo_palette	= (void *)(currentpar + 1);
-	info->flags		= FBINFO_FLAG_DEFAULT;
+	info->flags		= FBINFO_DEFAULT;
 
 	SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
 
drivers/video/leo.c +1 -1
diff -Nru a/drivers/video/leo.c b/drivers/video/leo.c
@@ -588,7 +588,7 @@
 		sbus_ioremap(&sdev->resource[0], LEO_OFF_LX_CURSOR,
 			     sizeof(struct leo_cursor), "leolx cursor");
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &leo_ops;
 	all->info.currcon = -1;
 	all->info.par = &all->par;
drivers/video/macfb.c +1 -1
diff -Nru a/drivers/video/macfb.c b/drivers/video/macfb.c
@@ -947,7 +947,7 @@
 	fb_info.var		= macfb_defined;
 	fb_info.fix		= macfb_fix;
 	fb_info.pseudo_palette	= pseudo_palette;
-	fb_info.flags		= FBINFO_FLAG_DEFAULT;
+	fb_info.flags		= FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
 	
drivers/video/matrox/matroxfb_base.c +1 -1
diff -Nru a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
@@ -1716,7 +1716,7 @@
 	ACCESS_FBINFO(fbcon.fbops) = &ACCESS_FBINFO(fbops);
 	ACCESS_FBINFO(fbcon.pseudo_palette) = ACCESS_FBINFO(cmap);
 	/* after __init time we are like module... no logo */
-	ACCESS_FBINFO(fbcon.flags) = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT;
+	ACCESS_FBINFO(fbcon.flags) = hotplug ? FBINFO_MODULE : FBINFO_DEFAULT;
 	ACCESS_FBINFO(video.len_usable) &= PAGE_MASK;
 	fb_alloc_cmap(&ACCESS_FBINFO(fbcon.cmap), 256, 1);
 
drivers/video/matrox/matroxfb_crtc2.c +1 -1
diff -Nru a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
@@ -602,7 +602,7 @@
 	void* oldcrtc2;
 
 	m2info->fbcon.fbops = &matroxfb_dh_ops;
-	m2info->fbcon.flags = FBINFO_FLAG_DEFAULT;
+	m2info->fbcon.flags = FBINFO_DEFAULT;
 	m2info->fbcon.currcon = -1;
 	m2info->fbcon.pseudo_palette = m2info->cmap;
 	fb_alloc_cmap(&m2info->fbcon.cmap, 256, 1);
drivers/video/maxinefb.c +1 -1
diff -Nru a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c
@@ -159,7 +159,7 @@
 	fb_info.screen_base = (char *) maxinefb_fix.smem_start;
 	fb_info.var = maxinefb_defined;
 	fb_info.fix = maxinefb_fix;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&fb_info.cmap, 256, 0);
 
drivers/video/neofb.c +1 -1
diff -Nru a/drivers/video/neofb.c b/drivers/video/neofb.c
@@ -2055,7 +2055,7 @@
 	info->fix.accel = id->driver_data;
 
 	info->fbops = &neofb_ops;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 	info->pseudo_palette = (void *) (par + 1);
 	return info; 
 }
drivers/video/offb.c +1 -1
diff -Nru a/drivers/video/offb.c b/drivers/video/offb.c
@@ -527,7 +527,7 @@
 	info->screen_base = ioremap(address, fix->smem_len);
 	info->par = par;
 	info->pseudo_palette = (void *) (info + 1);
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
 
drivers/video/p9100.c +1 -1
diff -Nru a/drivers/video/p9100.c b/drivers/video/p9100.c
@@ -297,7 +297,7 @@
 		sbus_ioremap(&sdev->resource[0], 0,
 			     sizeof(struct p9100_regs), "p9100 regs");
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &p9100_ops;
 #ifdef CONFIG_SPARC32
 	all->info.screen_base = (char *)
drivers/video/platinumfb.c +1 -1
diff -Nru a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
@@ -311,7 +311,7 @@
 	/* Fill fb_info */
 	info->fbops = &platinumfb_ops;
 	info->pseudo_palette = pinfo->pseudo_palette;
-        info->flags = FBINFO_FLAG_DEFAULT;
+        info->flags = FBINFO_DEFAULT;
 	info->screen_base = (char *) pinfo->frame_buffer + 0x20;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
drivers/video/pm2fb.c +1 -1
diff -Nru a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
@@ -1124,7 +1124,7 @@
 	info->fbops    = &pm2fb_ops;
 	info->fix		= pm2fb_fix; 	
 	info->pseudo_palette	= (void *)(default_par + 1); 
-	info->flags		= FBINFO_FLAG_DEFAULT;
+	info->flags		= FBINFO_DEFAULT;
 
 #ifndef MODULE
 	if (!mode)
drivers/video/pm3fb.c +1 -1
diff -Nru a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
@@ -1608,7 +1608,7 @@
 		       fontn[l_fb_info->board_num]);
 	l_fb_info->gen.info.switch_con = &fbgen_switch;
 	l_fb_info->gen.info.updatevar = &fbgen_update_var;	/* */
-	l_fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
+	l_fb_info->gen.info.flags = FBINFO_DEFAULT;
 
 	pm3fb_mapIO(l_fb_info);
 
drivers/video/pmag-ba-fb.c +1 -1
diff -Nru a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
@@ -142,7 +142,7 @@
 	info->var = pmagbafb_defined;
 	info->fix = pmagbafb_fix; 
 	info->screen_base = pmagbafb_fix.smem_start;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&fb_info.cmap, 256, 0);
 	
drivers/video/pmagb-b-fb.c +1 -1
diff -Nru a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
@@ -145,7 +145,7 @@
 	info->var = pmagbbfb_defined;
 	info->fix = pmagbbfb_fix;
 	info->screen_base = pmagbbfb_fix.smem_start; 
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	fb_alloc_cmap(&fb_info.cmap, 256, 0);
 
drivers/video/pvr2fb.c +1 -1
diff -Nru a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
@@ -795,7 +795,7 @@
 	fb_info->fix		= pvr2_fix;
 	fb_info->par		= currentpar;
 	fb_info->pseudo_palette	= (void *)(fb_info->par + 1);
-	fb_info->flags		= FBINFO_FLAG_DEFAULT;
+	fb_info->flags		= FBINFO_DEFAULT;
 
 	if (video_output == VO_VGA)
 		defmode = DEFMODE_VGA;
drivers/video/q40fb.c +0 -0
diff -Nru a/drivers/video/q40fb.c b/drivers/video/q40fb.c
@@ -105,7 +105,7 @@
	info->var = q40fb_var;
	info->fix = q40fb_fix;
	info->fbops = &q40fb_ops;
-	info->flags = FBINFO_FLAG_DEFAULT;  /* not as module for now */
+	info->flags = FBINFO_DEFAULT;  /* not as module for now */
	info->pseudo_palette = info->par;
	info->par = NULL;
	info->screen_base = (char *) q40fb_fix.smem_start;
drivers/video/radeonfb.c +1 -1
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
@@ -2250,7 +2250,7 @@
 	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
-        info->flags = FBINFO_FLAG_DEFAULT;
+        info->flags = FBINFO_DEFAULT;
         info->fbops = &radeonfb_ops;
         info->display_fg = NULL;
         info->screen_base = (char *)rinfo->fb_base;
drivers/video/retz3fb.c +1 -1
diff -Nru a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c
@@ -1408,7 +1408,7 @@
 		fb_info->currcon = -1;
 		fb_info->switch_con = &z3fb_switch;
 		fb_info->updatevar = &z3fb_updatevar;
-		fb_info->flags = FBINFO_FLAG_DEFAULT;
+		fb_info->flags = FBINFO_DEFAULT;
 		strlcpy(fb_info->fontname, fontname, sizeof(fb_info->fontname));
 
 		if (z3fb_mode == -1)
drivers/video/riva/fbdev.c +1 -1
diff -Nru a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
@@ -1589,7 +1589,7 @@
 	struct riva_par *par = (struct riva_par *) info->par;
 	unsigned int cmap_len;
 
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 	info->var = rivafb_default_var;
 	info->fix = rivafb_fix;
 	info->fbops = &riva_fb_ops;
drivers/video/sa1100fb.c +1 -1
diff -Nru a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
@@ -1673,7 +1673,7 @@
 	fbi->fb.var.vmode	= FB_VMODE_NONINTERLACED;
 
 	fbi->fb.fbops		= &sa1100fb_ops;
-	fbi->fb.flags		= FBINFO_FLAG_DEFAULT;
+	fbi->fb.flags		= FBINFO_DEFAULT;
 	fbi->fb.monspecs	= monspecs;
 	fbi->fb.currcon		= -1;
 	fbi->fb.pseudo_palette	= (fbi + 1);
drivers/video/sgivwfb.c +1 -1
diff -Nru a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
@@ -790,7 +790,7 @@
 	fb_info.fbops = &sgivwfb_ops;
 	fb_info.pseudo_palette = pseudo_palette;
 	fb_info.par = &default_par;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	fb_info.screen_base = ioremap_nocache((unsigned long) sgivwfb_mem_phys, sgivwfb_mem_size);
 	if (!fb_info.screen_base) {
drivers/video/sis/sis_main.c +1 -1
diff -Nru a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
@@ -4914,7 +4914,7 @@
 	    	   }
 		}
 
-		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
+		sis_fb_info->flags = FBINFO_DEFAULT;
 		sis_fb_info->var = default_var;
 		sis_fb_info->fix = sisfb_fix;
 		sis_fb_info->par = &ivideo;
drivers/video/sstfb.c +1 -1
diff -Nru a/drivers/video/sstfb.c b/drivers/video/sstfb.c
@@ -1473,7 +1473,7 @@
 	f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
 	f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
-	info->flags	= FBINFO_FLAG_DEFAULT;
+	info->flags	= FBINFO_DEFAULT;
 	info->fbops	= &sstfb_ops;
 	info->currcon	= -1;
 	info->pseudo_palette = &all->pseudo_palette;
drivers/video/stifb.c +1 -1
diff -Nru a/drivers/video/stifb.c b/drivers/video/stifb.c
@@ -1324,7 +1324,7 @@
 	strcpy(fix->id, "stifb");
 	info->fbops = &stifb_ops;
 	info->screen_base = (void*) REGION_BASE(fb,1);
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 	info->currcon = -1;
 
 	/* This has to been done !!! */
drivers/video/sun3fb.c +1 -1
diff -Nru a/drivers/video/sun3fb.c b/drivers/video/sun3fb.c
@@ -576,7 +576,7 @@
 	fb->info.changevar = NULL;
 	fb->info.switch_con = &sun3fbcon_switch;
 	fb->info.updatevar = &sun3fbcon_updatevar;
-	fb->info.flags = FBINFO_FLAG_DEFAULT;
+	fb->info.flags = FBINFO_DEFAULT;
 	
 	fb->cursor.hwsize.fbx = 32;
 	fb->cursor.hwsize.fby = 32;
drivers/video/tcx.c +1 -1
diff -Nru a/drivers/video/tcx.c b/drivers/video/tcx.c
@@ -412,7 +412,7 @@
 		all->par.mmap_map[i].poff = sdev->reg_addrs[j].phys_addr;
 	}
 
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &tcx_ops;
 #ifdef CONFIG_SPARC32
 	all->info.screen_base = (char *)
drivers/video/tdfxfb.c +1 -1
diff -Nru a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
@@ -1253,7 +1253,7 @@
 	info->fix		= tdfx_fix; 	
 	info->par		= default_par;
 	info->pseudo_palette	= (void *)(default_par + 1); 
-	info->flags		= FBINFO_FLAG_DEFAULT;
+	info->flags		= FBINFO_DEFAULT;
 
 #ifndef MODULE
 	if (!mode_option)
drivers/video/tgafb.c +1 -1
diff -Nru a/drivers/video/tgafb.c b/drivers/video/tgafb.c
@@ -1425,7 +1425,7 @@
 	pci_read_config_byte(pdev, PCI_REVISION_ID, &all->par.tga_chip_rev);
 
 	/* Setup framebuffer.  */
-	all->info.flags = FBINFO_FLAG_DEFAULT;
+	all->info.flags = FBINFO_DEFAULT;
 	all->info.fbops = &tgafb_ops;
 	all->info.screen_base = (char *) all->par.tga_fb_base;
 	all->info.currcon = -1;
drivers/video/tridentfb.c +1 -1
diff -Nru a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
@@ -1149,7 +1149,7 @@
 	fb_info.fbops = &tridentfb_ops;
 
 
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 	fb_info.pseudo_palette = pseudo_pal;
 
 	if (!fb_find_mode(&default_var,&fb_info,mode,NULL,0,NULL,bpp))
drivers/video/tx3912fb.c +1 -1
diff -Nru a/drivers/video/tx3912fb.c b/drivers/video/tx3912fb.c
@@ -296,7 +296,7 @@
 	fb_info.var = tx3912fb_var;
 	fb_info.fix = tx3912fb_fix;
 	fb_info.pseudo_palette = pseudo_palette;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 
 	/* Clear the framebuffer */
 	memset((void *) fb_info.fix.smem_start, 0xff, fb_info.fix.smem_len);
drivers/video/valkyriefb.c +1 -1
diff -Nru a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c
@@ -541,7 +541,7 @@
 {
 	info->fbops = &valkyriefb_ops;
 	info->screen_base = (char *) p->frame_buffer + 0x1000;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 	info->pseudo_palette = p->pseudo_palette;
 	fb_alloc_cmap(&info->cmap, 256, 0);
 	info->par = &p->par;
drivers/video/vesafb.c +1 -1
diff -Nru a/drivers/video/vesafb.c b/drivers/video/vesafb.c
@@ -362,7 +362,7 @@
 	info->fbops = &vesafb_ops;
 	info->var = vesafb_defined;
 	info->fix = vesafb_fix;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	if (fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0) < 0) {
 		err = -ENXIO;
drivers/video/vfb.c +1 -1
diff -Nru a/drivers/video/vfb.c b/drivers/video/vfb.c
@@ -435,7 +435,7 @@
 	info->fix = vfb_fix;
 	info->pseudo_palette = &vfb_pseudo_palette;
 	info->par = NULL;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT;
 
 	retval = fb_alloc_cmap(&fb_info.cmap, 256, 0);
 	if (retval < 0)
drivers/video/vga16fb.c +1 -1
diff -Nru a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
@@ -1370,7 +1370,7 @@
 	vga16fb.var = vga16fb_defined;
 	vga16fb.fix = vga16fb_fix;
 	vga16fb.par = &vga16_par;
-	vga16fb.flags = FBINFO_FLAG_DEFAULT;
+	vga16fb.flags = FBINFO_DEFAULT;
 
 	vga16fb.fix.smem_start	= VGA_MAP_MEM(vga16fb.fix.smem_start);
 
drivers/video/virgefb.c +1 -1
diff -Nru a/drivers/video/virgefb.c b/drivers/video/virgefb.c
@@ -1788,7 +1788,7 @@
 	fb_info.currcon = -1;
 	fb_info.switch_con = &virgefb_switch;
 	fb_info.updatevar = &virgefb_updatevar;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	fb_info.flags = FBINFO_DEFAULT;
 	fbhw->init();
 	fbhw->decode_var(&virgefb_default, &par);
 	fbhw->encode_var(&virgefb_default, &par);
#14 lore raw

PATCH 4/4 radeonfb accel capabilities

In reply to David Eger

radeonfb: upgrade accel indication to fb_info->flags semantics
(now with accelerated framebuffer console!)

drivers/video/aty/radeon_accel.c +8 -2
diff -Nru a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c
@@ -30,7 +30,7 @@
   
 	if (info->state != FBINFO_STATE_RUNNING)
 		return;
-	if (radeon_accel_disabled()) {
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 		cfb_fillrect(info, region);
 		return;
 	}
@@ -96,7 +96,7 @@
   
 	if (info->state != FBINFO_STATE_RUNNING)
 		return;
-	if (radeon_accel_disabled()) {
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 		cfb_copyarea(info, area);
 		return;
 	}
@@ -144,6 +144,9 @@
 	u32 clock_cntl_index, mclk_cntl, rbbm_soft_reset;
 	u32 host_path_cntl;
 
+	if (rinfo->info->flags & FBINFO_HWACCEL_DISABLED)
+		return;
+	
 	radeon_engine_flush (rinfo);
 
     	/* Some ASICs have bugs with dynamic-on feature, which are  
@@ -239,6 +242,9 @@
 {
 	unsigned long temp;
 
+	if (rinfo->info->flags & FBINFO_HWACCEL_DISABLED)
+		return;
+	
 	/* disable 3D engine */
 	OUTREG(RB3D_CNTL, 0);
 
drivers/video/aty/radeon_base.c +13 -21
diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
@@ -242,8 +242,6 @@
 static int nomtrr = 0;
 #endif
 
-int radeonfb_noaccel = 0;
-
 /*
  * prototypes
  */
@@ -810,9 +808,8 @@
 	/* XXX I'm adjusting xres_virtual to the pitch, that may help XFree
 	 * with some panels, though I don't quite like this solution
 	 */
-  	if (radeon_accel_disabled()) {
+  	if (rinfo->info->flags & FBINFO_HWACCEL_DISABLED) {
 		v.xres_virtual = v.xres_virtual & ~7ul;
-		v.accel_flags = 0;
 	} else {
 		pitch = ((v.xres_virtual * ((v.bits_per_pixel + 1) / 8) + 0x3f)
  				& ~(0x3f)) >> 6;
@@ -1523,7 +1520,7 @@
 	newmode.crtc_v_sync_strt_wid = (((vSyncStart - 1) & 0xfff) |
 					 (vsync_wid << 16) | (v_sync_pol  << 23));
 
-	if (!radeon_accel_disabled()) {
+	if (!(info->flags & FBINFO_HWACCEL_DISABLED)) {
 		/* We first calculate the engine pitch */
 		rinfo->pitch = ((mode->xres_virtual * ((mode->bits_per_pixel + 1) / 8) + 0x3f)
  				& ~(0x3f)) >> 6;
@@ -1671,12 +1668,10 @@
 	if (!rinfo->asleep) {
 		radeon_write_mode (rinfo, &newmode);
 		/* (re)initialize the engine */
-		if (!radeon_accel_disabled())
-			radeonfb_engine_init (rinfo);
-	
+		radeonfb_engine_init (rinfo);
 	}
 	/* Update fix */
-	if (!radeon_accel_disabled())
+	if (!(info->flags & FBINFO_HWACCEL_DISABLED))
         	info->fix.line_length = rinfo->pitch*64;
         else
 		info->fix.line_length = mode->xres_virtual
@@ -1781,7 +1776,11 @@
 	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
-        info->flags = FBINFO_DEFAULT;
+        info->flags = FBINFO_DEFAULT
+		| FBINFO_HWACCEL_COPYAREA
+		| FBINFO_HWACCEL_FILLRECT
+		| FBINFO_HWACCEL_XPAN
+		| FBINFO_HWACCEL_YPAN;
         info->fbops = &radeonfb_ops;
         info->display_fg = NULL;
         info->screen_base = (char *)rinfo->fb_base;
@@ -1798,17 +1797,11 @@
         info->fix.type_aux = 0;
         info->fix.mmio_start = rinfo->mmio_base_phys;
         info->fix.mmio_len = RADEON_REGSIZE;
-	if (radeon_accel_disabled())
-	        info->fix.accel = FB_ACCEL_NONE;
-	else
-		info->fix.accel = FB_ACCEL_ATI_RADEON;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
-
-	if (radeon_accel_disabled())
-		info->var.accel_flags &= ~FB_ACCELF_TEXT;
-	else
-		info->var.accel_flags |= FB_ACCELF_TEXT;
+	
+	if (noaccel)
+		info->flags |= FBINFO_HWACCEL_DISABLED;
 
         return 0;
 }
@@ -2398,7 +2391,6 @@
 
 int __init radeonfb_init (void)
 {
-	radeonfb_noaccel = noaccel;
 	return pci_module_init (&radeonfb_driver);
 }
 
@@ -2420,7 +2412,7 @@
 			continue;
 
 		if (!strncmp(this_opt, "noaccel", 7)) {
-			noaccel = radeonfb_noaccel = 1;
+			noaccel = 1;
 		} else if (!strncmp(this_opt, "mirror", 6)) {
 			mirror = 1;
 		} else if (!strncmp(this_opt, "force_dfp", 9)) {
drivers/video/aty/radeon_pm.c +4 -6
diff -Nru a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
@@ -859,12 +859,10 @@
 
 	fb_set_suspend(info, 1);
 
-	if (!radeon_accel_disabled()) {
-		/* Make sure engine is reset */
-		radeon_engine_idle();
-		radeonfb_engine_reset(rinfo);
-		radeon_engine_idle();
-	}
+	/* Make sure engine is reset */
+	radeon_engine_idle();
+	radeonfb_engine_reset(rinfo);
+	radeon_engine_idle();
 
 	/* Blank display and LCD */
 	radeonfb_blank(VESA_POWERDOWN+1, info);
drivers/video/aty/radeonfb.h +0 -6
diff -Nru a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
@@ -527,12 +527,6 @@
 	printk(KERN_ERR "radeonfb: Idle Timeout !\n");
 }
 
-static inline int radeon_accel_disabled(void)
-{
-	extern int radeonfb_noaccel;
-	return radeonfb_noaccel;
-}
-
 #define radeon_engine_idle()		_radeon_engine_idle(rinfo)
 #define radeon_fifo_wait(entries)	_radeon_fifo_wait(rinfo,entries)
 
#15 lore raw
In reply to David Eger
Quoted 13 lines

A month or two ago I noticed that the framebuffer console driver doesn't know to do proper framebuffer acceleration in Linux 2.6; I've implemented a solution Geert suggested where each framebuffer driver advertizes its hardware capabilities via fb_info->flags. Please apply to -mm so I can get wider testing.

The patches are at:

http://www.yak.net/random/fbdev-patches/accel-cap-take2/relative2mainline/

The core of these patches is enabling the use of the following flags:

Review

Quoted 2 lines
(quoted diff) +2 -0
+/* FBIF = FB_Info.Flags */
+#define FBIF_MODULE		0x0001	/* Low-level driver is a module */

Ug. You changed that. Could that remain the same.

I have a patch coming that fixes the mode setting. It changes alot of the core fbcon.c so I will apply your patch to the fbdev-2.5 tree.

author
#16 lore raw

Quoting James Simmons <[email protected]>:

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+/* FBIF = FB_Info.Flags */
+#define FBIF_MODULE		0x0001	/* Low-level driver is a module */

Ug. You changed that. Could that remain the same.

Will it suffice to add

#define FBINFO_FLAG_MODULE FBIF_MODULE

for backwards compatibility?

I'd prefer the new flags to be FBIF_*, as the identifier FBINFO_FLAG_HWACCEL_COPYAREA seems sorta long to me...

I'll sync with linus's bk tomorrow and try to rework my main patch; the "mainline" patch I posted was against his bk shortly after 2.6.6...

Quoted 2 lines

I have a patch coming that fixes the mode setting. It changes alot of the core fbcon.c so I will apply your patch to the fbdev-2.5 tree.

I take it this is in addition to your con2fb patch I have posted at that web address?

-dte

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click

#17 lore raw
Quoted 9 lines

Will it suffice to add

#define FBINFO_FLAG_MODULE FBIF_MODULE

for backwards compatibility?

I'd prefer the new flags to be FBIF_*, as the identifier FBINFO_FLAG_HWACCEL_COPYAREA seems sorta long to me...

I agree. I dropped the _FLAG_ part. It just more readable with FBINFO. If you have no problem with that I will add it to the fbdev-2.6 BK tree. Andrew has asked me to move everything to a BK tree for him to pull.

Quoted 2 lines

I'll sync with linus's bk tomorrow and try to rework my main patch; the "mainline" patch I posted was against his bk shortly after 2.6.6...

I will setup the new fbdev-2.6 BK repos tonight for Andrew so try tomorrow to sync against that tree.

Quoted 2 lines

I take it this is in addition to your con2fb patch I have posted at that web address?

Yes. I see that patch works like a charm for you. :-)