Skip to contentSkip to conversation

fbdev: Static pseudocolor with depth less than 4 does exist

PATCH In review Antonino A. Daplas 3 participants 6 messages Apr 29, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 10/12 fbdev: Static pseudocolor with depth less than 4 does exist

A static pseudocolor visual with depth less than 4 does exist, so let's not accidentally upscale the depth with this configuration

---

 drivers/video/fbmem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/fbmem.c +1 -1
index 1cb9acf..19cb4c5 100644
@@ -432,7 +432,7 @@ int fb_prepare_logo(struct fb_info *info
 			depth = info->var.green.length;
 	}
 
-	if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) {
+	if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
 		/* assume console colormap */
 		depth = 4;
 	}

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#1 lore raw
Quoted 2 lines · Antonino A. Daplas

A static pseudocolor visual with depth less than 4 does exist, so let's not accidentally upscale the depth with this configuration

Yes it does, at least on Mac/m68k.

Now the real question is: why doesn't macfb set FB_VISUAL_STATIC_PSEUDOCOLOR if there's no macfb_setpalette routine?

Quoted 11 lines

---

 drivers/video/fbmem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/fbmem.c +0 -0
index 1cb9acf..19cb4c5 100644

drivers/video/fbmem.c int fb_prepare_logo(struct fb_info *info · line 438

Quoted 8 lines
drivers/video/fbmem.c +1 -1
@@ -432,7 +432,7 @@ int fb_prepare_logo(struct fb_info *info
 			depth = info->var.green.length;
 	}
 
-	if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) {
+	if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
 		/* assume console colormap */
 		depth = 4;
 	}

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

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#2 lore raw
Quoted 8 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino A. Daplas

A static pseudocolor visual with depth less than 4 does exist, so let's not accidentally upscale the depth with this configuration

Yes it does, at least on Mac/m68k.

Now the real question is: why doesn't macfb set FB_VISUAL_STATIC_PSEUDOCOLOR if there's no macfb_setpalette routine?

It should. The other question is, what to do with static pseudocolor? Do we always assume console colors? Or do we make drivers fill their own info->cmap entries and not alter the contents when fb_set_cmap() is called?

Also, I made vesafb's visual static_pseudocolor if the mode is not VGA compatible and the protected mode interface is absent. Fortunately, the VGA colormap is carried over to vesafb, so by accident, the console color map coincides with the hardware CLUT and the logo and console displays correctly.

Tony

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#3 lore raw

[ [email protected] removed as it seems to bounce? ]

Quoted 5 lines · Antonino A. Daplas
Quoted 4 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino A. Daplas

A static pseudocolor visual with depth less than 4 does exist, so let's not accidentally upscale the depth with this configuration

Quoted 8 lines
Quoted 4 lines

Yes it does, at least on Mac/m68k.

Now the real question is: why doesn't macfb set FB_VISUAL_STATIC_PSEUDOCOLOR if there's no macfb_setpalette routine?

It should. The other question is, what to do with static pseudocolor? Do we always assume console colors? Or do we make drivers fill their own info->cmap entries and not alter the contents when fb_set_cmap() is called?

I don't think you can always assume console colors. Only the driver (if anyone knows at all) knows the palette.

On the other hand, at least on Mac/m68k the palette is inherited from MacOS. It would be possible for the Penguin booter to programs the standard console palette under MacOS, just before booting the kernel, but as I don't know much about Penguin, I have no idea whether that's currently done.

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

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#4 lore raw
Quoted 4 lines · Geert Uytterhoeven

On the other hand, at least on Mac/m68k the palette is inherited from MacOS. It would be possible for the Penguin booter to programs the standard console palette under MacOS, just before booting the kernel, but as I don't know much about Penguin, I have no idea whether that's currently done.

I'm not sure I have the latest version of Penguin, but the version I have laying around has an option to set the current palette before loading the kernel. I don't remember if it was on by default.

Brad Boyer
[email protected]

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#5 lore raw
In reply to Geert Uytterhoeven
Quoted 15 lines · Geert Uytterhoeven

[ [email protected] removed as it seems to bounce? ]

Quoted 11 lines · Antonino A. Daplas
Quoted 7 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino A. Daplas

A static pseudocolor visual with depth less than 4 does exist, so let's not accidentally upscale the depth with this configuration

Yes it does, at least on Mac/m68k.

Now the real question is: why doesn't macfb set FB_VISUAL_STATIC_PSEUDOCOLOR if there's no macfb_setpalette routine?

It should. The other question is, what to do with static pseudocolor? Do we always assume console colors? Or do we make drivers fill their own info->cmap entries and not alter the contents when fb_set_cmap() is called?

Quoted 8 lines

I don't think you can always assume console colors. Only the driver (if anyone knows at all) knows the palette.

On the other hand, at least on Mac/m68k the palette is inherited from MacOS. It would be possible for the Penguin booter to programs the standard console palette under MacOS, just before booting the kernel, but as I don't know much about Penguin, I have no idea whether that's currently done.

Making the palette match the console would be the simplest solution. Otherwise, we make the drivers export a color map which will be read-only. Then fbcon and other clients will just have to alter their palette to best fit the hardware.

Tony

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642