Skip to contentSkip to conversation

broken cfb* support in the 2.5.31-bk

PATCH In review Petr Vandrovec 4 participants 8 messages Aug 14, 2002 – Aug 22, 2002 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 broken cfb* support in the 2.5.31-bk

Hi Linus, hello others,
please apply this.

line_length, type and visual moved from display struct to the fb_info's fix structure during last fbdev updates. Unfortunately generic code was not updated together, so now every fbdev driver is broken.

Thanks,
Petr Vandrovec [email protected]

drivers/video/fbcon-cfb16.c +1 -1
diff -urdN linux/drivers/video/fbcon-cfb16.c linux/drivers/video/fbcon-cfb16.c
@@ -36,7 +36,7 @@
 
 void fbcon_cfb16_setup(struct display *p)
 {
-    p->next_line = p->line_length ? p->line_length : p->var.xres_virtual<<1;
+    p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<1;
     p->next_plane = 0;
 }
 
drivers/video/fbcon-cfb32.c +1 -1
diff -urdN linux/drivers/video/fbcon-cfb32.c linux/drivers/video/fbcon-cfb32.c
@@ -25,7 +25,7 @@
 
 void fbcon_cfb32_setup(struct display *p)
 {
-    p->next_line = p->line_length ? p->line_length : p->var.xres_virtual<<2;
+    p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<2;
     p->next_plane = 0;
 }
 
drivers/video/fbcon-cfb4.c +1 -1
diff -urdN linux/drivers/video/fbcon-cfb4.c linux/drivers/video/fbcon-cfb4.c
@@ -50,7 +50,7 @@
 
 void fbcon_cfb4_setup(struct display *p)
 {
-    p->next_line = p->line_length ? p->line_length : p->var.xres_virtual>>1;
+    p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual>>1;
     p->next_plane = 0;
 }
 
drivers/video/fbcon-cfb8.c +1 -1
diff -urdN linux/drivers/video/fbcon-cfb8.c linux/drivers/video/fbcon-cfb8.c
@@ -41,7 +41,7 @@
 
 void fbcon_cfb8_setup(struct display *p)
 {
-    p->next_line = p->line_length ? p->line_length : p->var.xres_virtual;
+    p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual;
     p->next_plane = 0;
 }
 
drivers/video/fbcon-vga-planes.c +22 -22

134 lines not on this page · raw message

drivers/video/fbcon.c +8 -8
diff -urdN linux/drivers/video/fbcon.c linux/drivers/video/fbcon.c
@@ -2306,7 +2306,7 @@
 	}
 #endif
 #if defined(CONFIG_FBCON_CFB4)
-	if (depth == 4 && p->type == FB_TYPE_PACKED_PIXELS) {
+	if (depth == 4 && info->fix.type == FB_TYPE_PACKED_PIXELS) {
 		src = logo;
 		for( y1 = 0; y1 < LOGO_H; y1++) {
 			dst = fb + y1*line + x/2;
@@ -2320,7 +2320,7 @@
 	}
 #endif
 #if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FB_SBUS)
-	if (depth == 8 && p->type == FB_TYPE_PACKED_PIXELS) {
+	if (depth == 8 && info->fix.type == FB_TYPE_PACKED_PIXELS) {
 	    /* depth 8 or more, packed, with color registers */
 		
 	    src = logo;
@@ -2335,8 +2335,8 @@
 #if defined(CONFIG_FBCON_AFB) || defined(CONFIG_FBCON_ILBM) || \
     defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P4) || \
     defined(CONFIG_FBCON_IPLAN2P8)
-	if (depth >= 2 && (p->type == FB_TYPE_PLANES ||
-			   p->type == FB_TYPE_INTERLEAVED_PLANES)) {
+	if (depth >= 2 && (info->fix.type == FB_TYPE_PLANES ||
+			   info->fix.type == FB_TYPE_INTERLEAVED_PLANES)) {
 	    /* planes (normal or interleaved), with color registers */
 	    int bit;
 	    unsigned char val, mask;
@@ -2388,9 +2388,9 @@
 #if defined(CONFIG_FBCON_MFB) || defined(CONFIG_FBCON_AFB) || \
     defined(CONFIG_FBCON_ILBM) || defined(CONFIG_FBCON_HGA)
 
-	if (depth == 1 && (p->type == FB_TYPE_PACKED_PIXELS ||
-			   p->type == FB_TYPE_PLANES ||
-			   p->type == FB_TYPE_INTERLEAVED_PLANES)) {
+	if (depth == 1 && (p->fix.type == FB_TYPE_PACKED_PIXELS ||
+			   p->fix.type == FB_TYPE_PLANES ||
+			   p->fix.type == FB_TYPE_INTERLEAVED_PLANES)) {
 
 	    /* monochrome */
 	    unsigned char inverse = p->inverse || p->visual == FB_VISUAL_MONO01
@@ -2411,7 +2411,7 @@
 	}
 #endif
 #if defined(CONFIG_FBCON_VGA_PLANES)
-	if (depth == 4 && p->type == FB_TYPE_VGA_PLANES) {
+	if (depth == 4 && info->fix.type == FB_TYPE_VGA_PLANES) {
 		outb_p(1,0x3ce); outb_p(0xf,0x3cf);
 		outb_p(3,0x3ce); outb_p(0,0x3cf);
 		outb_p(5,0x3ce); outb_p(0,0x3cf);
#1 lore raw
Quoted 7 lines

Hi Linus, hello others,
please apply this.

line_length, type and visual moved from display struct to the fb_info's fix structure during last fbdev updates. Unfortunately generic code was not updated together, so now every fbdev driver is broken.

That was done to push people to port there drivers to the new api. I applied the patch to the Bk repository but expect more breakage.

#7 lore raw
In reply to Petr Vandrovec
Quoted 7 lines

Hi Linus, hello others,
please apply this.

line_length, type and visual moved from display struct to the fb_info's fix structure during last fbdev updates. Unfortunately generic code was not updated together, so now every fbdev driver is broken.

That was done to push people to port there drivers to the new api. I applied the patch to the Bk repository but expect more breakage.

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#2 lore raw
In reply to James Simmons
Quoted 1 line · James Simmons

That was done to push people to port there drivers to the new api.

Well, what _is_ the new API?

Anyway, you could apply this patch, for a start. I wish you would be a bit more careful about details.

Paul.

drivers/video/Makefile +1 -1
diff -urN linux-2.5/drivers/video/Makefile pmac-2.5/drivers/video/Makefile
@@ -60,7 +60,7 @@
 obj-$(CONFIG_FB_3DFX)             += tdfxfb.o
 obj-$(CONFIG_FB_MAC)              += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o 
 obj-$(CONFIG_FB_HP300)            += hpfb.o cfbfillrect.o cfbimgblt.o
-obj-$(CONFIG_FB_OF)               += offb.o cfbfillrect.o cfbimgblit.o cfbcopyarea.o
+obj-$(CONFIG_FB_OF)               += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
 obj-$(CONFIG_FB_IMSTT)            += imsttfb.o
 obj-$(CONFIG_FB_RETINAZ3)         += retz3fb.o
 obj-$(CONFIG_FB_CLGEN)            += clgenfb.o
#3 lore raw
Quoted 6 lines
Quoted 2 lines

That was done to push people to port there drivers to the new api.

Well, what _is_ the new API?

From the details in skeletonfb.c.

 *  I have started rewriting this driver as a example of the upcoming new API
 *  The primary goal is to remove the console code from fbdev and place it
 *  into fbcon.c. This reduces the code and makes writing a new fbdev driver
 *  easy since the author doesn't need to worry about console internals. It
 *  also allows the ability to run fbdev without a console/tty system on top
 *  of it.
 *
 *  First the roles of struct fb_info and struct display have changed. Struct
 *  display will go away. The way the the new framebuffer console code will
 *  work is that it will act to translate data about the tty/console in
 *  struct vc_data to data in a device independent way in struct fb_info. Then
 *  various functions in struct fb_ops will be called to store the device
 *  dependent state in the par field in struct fb_info and to change the
 *  hardware to that state. This allows a very clean seperation of the fbdev
 *  layer from the console layer. It also allows one to use fbdev on its own
 *  which is a bounus for embedded devices. The reason this approach works is
 *  for each framebuffer device when used as a tty/console device is allocated
 *  a set of virtual terminals to it. Only one virtual terminal can be active
 *  per framebuffer device. We already have all the data we need in struct
 *  vc_data so why store a bunch of colormaps and other fbdev specific data
 *  per virtual terminal.
 *  As you can see doing this makes the con parameter pretty much useless
 *  for struct fb_ops functions, as it should be. Also having struct
 *  fb_var_screeninfo and other data in fb_info pretty much eliminates the
 *  need for get_fix and get_var. Once all drivers use the fix, var, and cmap
 *  fbcon can be written around these fields. This will also eliminate the
 *  need to regenerate struct fb_var_screeninfo, struct fb_fix_screeninfo
 *  struct fb_cmap every time get_var, get_fix, get_cmap functions are called
 *  as many drivers do now.

See skeletonfb.c for further details.

Quoted 2 lines

Anyway, you could apply this patch, for a start. I wish you would be a bit more careful about details.

Done. Well the good news is I have aquired more hardware for different platforms to test my work on :-)

MS: (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons  [[email protected]] 	                ____/|
fbdev/console/gfx developer                             \ o.O|

http://www.linux-fbdev.org =(_)=
http://linuxgfx.sourceforge.net U
http://linuxconsole.sourceforge.net

#4 lore raw
Quoted 5 lines · James Simmons
Quoted 2 lines

Anyway, you could apply this patch, for a start. I wish you would be a bit more careful about details.

Done. Well the good news is I have aquired more hardware for different platforms to test my work on :-)

You don't need more hardware to protect yourself against such typos. A cross-compiler (or sometimes even your native gcc) is sufficient ;-)

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

#5 lore raw
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Anyway, you could apply this patch, for a start. I wish you would be a bit more careful about details.

Done. Well the good news is I have aquired more hardware for different platforms to test my work on :-)

You don't need more hardware to protect yourself against such typos. A cross-compiler (or sometimes even your native gcc) is sufficient ;-)

That I also lack except for ARM and mips. Do you know where I can get a developement kit for for ppc and m68k?

#6 lore raw
Quoted 11 lines · James Simmons
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Anyway, you could apply this patch, for a start. I wish you would be a bit more careful about details.

Done. Well the good news is I have aquired more hardware for different platforms to test my work on :-)

You don't need more hardware to protect yourself against such typos. A cross-compiler (or sometimes even your native gcc) is sufficient ;-)

That I also lack except for ARM and mips. Do you know where I can get a developement kit for for ppc and m68k?

The usual rules for creating cross-{binutils,gcc} apply here.

If you run Debian, check out the toolchain-source package.

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