: image.depth fix to accomodate monochrome cards
Subsystems (2)
PATCH 1/1 : image.depth fix to accomodate monochrome cards
James,
I've waited a few days, seems nobody objected.
Attached is a patch for linux-2.5.54 + James Simmons' latest fbdev.diff.
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
3. added a few commentaries in skeletonfb.c detailing image.depth and image.data.
Tony
drivers/video/cfbimgblt.c +1 -1
@@ -323,7 +323,7 @@ bitstart &= ~(bpl -1 ); dst1 = p->screen_base + bitstart; -if (image->depth ==1 ) { +if (image->depth ==0 ) {if (p->fix.visual ==FB_VISUAL_TRUECOLOR || p->fix.visual ==FB_VISUAL_DIRECTCOLOR ) { fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
drivers/video/console/fbcon.c +2 -2
@@ -395,7 +395,7 @@ image.dx = xx * vc->vc_font.width; image.dy = yy * vc->vc_font.height; image.height = vc->vc_font.height; - image.depth =1 ; + image.depth =0 ;if (!(vc->vc_font.width &7 )) {unsigned int pitch, cnt, i, j, k;
@@ -1170,7 +1170,7 @@ image.dy =real_y (p, ypos) * vc->vc_font.height; image.width = vc->vc_font.width; image.height = vc->vc_font.height; - image.depth =1 ; + image.depth =0 ; image.data = p->fontdata + (c & charmask) * vc->vc_font.height * width; info->fbops->fb_imageblit (info, &image);
drivers/video/fbmem.c +6 -7
@@ -386,6 +386,7 @@ palette_cmap.red = palette_red; palette_cmap.green = palette_green; palette_cmap.blue = palette_blue; + palette_cmap.transp =NULL ;for (i =0 ; i <LINUX_LOGO_COLORS ; i += n) { n =LINUX_LOGO_COLORS - i;
@@ -461,13 +462,11 @@break ;case 1 :case ~1 : -default : -for (i =0 ; i < (LOGO_W *LOGO_H )/8 ; i++) -for (j =0 ; j <8 ; j++) - logo[i*8 + j] = (linux_logo_bw[i] & (7 - j)) ? - ((needs_logo ==1 ) ?1 :0 ) : - ((needs_logo ==1 ) ?0 :1 ); -break ; +for (i =0 ; i < (LOGO_W *LOGO_H )/8 ; i++) { +u8 d = linux_logo_bw[i]; +for (j =0 ; j <8 ; j++, d <<=1 ) + logo[i*8 +j] = ((d ^ needs_logo) >>7 ) &1 ; + } } }
drivers/video/i810/i810_accel.c +1 -1
@@ -404,7 +404,7 @@return ; } -if (par->depth ==4 || image->depth !=1 ) { +if (par->depth ==4 || image->depth !=0 ) {wait_for_engine_idle (par);cfb_imageblit (p, image);return ;
drivers/video/riva/fbdev.c +1 -1
@@ -1323,7 +1323,7 @@volatile u32 *d;int i, j, size; -if (image->depth !=1 ) { +if (image->depth !=0 ) {wait_for_idle (par);cfb_imageblit (info, image);return ;
drivers/video/skeletonfb.c +7 -2
@@ -445,9 +445,14 @@* @fg_color: For mono bitmap images this is color data for * @bg_color: the foreground and background of the image to * write directly to the frmaebuffer. -* @depth: How many bits represent a single pixel for this image. +* @depth: This will be zero (0) if color expanding (character drawing). +* If nonzero, this represent the pixel depth of the data. * @data: The actual data used to construct the image on the display. -* @cmap: The colormap used for color images. +* It is a monochrome bitmap if color expanding. For image +* drawing, each byte of data represents 1 pixel irrespective +* of the framebuffer depth. The byte is either an index to the +* pseudo_palette for directcolor and truecolor, or the +* actual pixel written to the framebuffer. */ }
drivers/video/softcursor.c +1 -1
@@ -47,7 +47,7 @@ image.dy = cursor->image.dy; image.width = cursor->image.width; image.height = cursor->image.height; - image.depth = cursor->image.depth; + image.depth =0 ; image.data = data;if (info->fbops->fb_imageblit)
drivers/video/tdfxfb.c +1 -1
@@ -939,7 +939,7 @@u8 *chardata = (u8 *) pixmap->data;u32 srcfmt; -if (pixmap->depth ==1 ) { +if (pixmap->depth ==0 ) {banshee_make_room (par,8 + ((size +3 ) >>2 ));tdfx_outl (par,COLORFORE , pixmap->fg_color);tdfx_outl (par,COLORBACK , pixmap->bg_color);
drivers/video/tgafb.c +1 -1
@@ -572,7 +572,7 @@can do better than the generic code. */ /* ??? There is a DMA write mode; I wonder if that could be made to pull the data from the image buffer... */ -if (image->depth >1 ) { +if (image->depth >0 ) {cfb_imageblit (info, image);return ; }
drivers/video/vga16fb.c +1 -1
@@ -1301,7 +1301,7 @@void vga16fb_imageblit (struct fb_info *info,struct fb_image *image) { -if (image->depth ==1 ) +if (image->depth ==0 )vga_imageblit_expand (info, image);else if (image->depth == info->var.bits_per_pixel)vga_imageblit_color (info, image);
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 2 lines · Antonino Daplas
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
I'll have to do some more fixes there, since the monochrome logo is used not only on monochrome displays, but on all other displays with bits_per_pixel < 4 Since the pixel data in fb_image are colormap indices, they have to reflect the correct black' and white' colors on such displays.
E.g. on amifb (which supports all bits_per_pixel from 1 through 8) the logo showed up in black-and-blue with bits_per_pixel == 3, cfr. the first two entries of {red,green,blue}8[] in fbcmap.c.
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 4 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino Daplas
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
Quoted 9 lines
I'll have to do some more fixes there, since the monochrome logo is used not only on monochrome displays, but on all other displays with
bits_per_pixel< 4 Since the pixel data infb_imageare colormap indices, they have to reflect the correctblack' andwhite' colors on such displays.E.g. on amifb (which supports all
bits_per_pixelfrom 1 through 8) the logo showed up in black-and-blue withbits_per_pixel== 3, cfr. the first two entries of {red,green,blue}8[] infbcmap.c.
Hmm, I see. I think only linux_logo_bw will be the only one affected, since linux_logo_16 happens to match the console palette and in linux_logo, we either reset the palette and/or the cmap.
Would expanding each bit to the full bit depth work? Ie for bpp=8 using monochrome data, white is 0 and black is 0xff.
I think we still have several corner cases, such as TRUECOLOR with bpp <= 8, I'm not sure if that works.
Anyway, here's an updated patch for linux-2.5.54 + James Simmons' latest fbdev.diff. Not sure if it works though :-)
Tony
drivers/video/cfbimgblt.c +1 -1
@@ -323,7 +323,7 @@ bitstart &= ~(bpl -1 ); dst1 = p->screen_base + bitstart; -if (image->depth ==1 ) { +if (image->depth ==0 ) {if (p->fix.visual ==FB_VISUAL_TRUECOLOR || p->fix.visual ==FB_VISUAL_DIRECTCOLOR ) { fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
drivers/video/console/fbcon.c +2 -2
@@ -395,7 +395,7 @@ image.dx = xx * vc->vc_font.width; image.dy = yy * vc->vc_font.height; image.height = vc->vc_font.height; - image.depth =1 ; + image.depth =0 ;if (!(vc->vc_font.width &7 )) {unsigned int pitch, cnt, i, j, k;
@@ -1170,7 +1170,7 @@ image.dy =real_y (p, ypos) * vc->vc_font.height; image.width = vc->vc_font.width; image.height = vc->vc_font.height; - image.depth =1 ; + image.depth =0 ; image.data = p->fontdata + (c & charmask) * vc->vc_font.height * width; info->fbops->fb_imageblit (info, &image);
drivers/video/fbmem.c +17 -9
@@ -386,6 +386,7 @@ palette_cmap.red = palette_red; palette_cmap.green = palette_green; palette_cmap.blue = palette_blue; + palette_cmap.transp =NULL ;for (i =0 ; i <LINUX_LOGO_COLORS ; i += n) { n =LINUX_LOGO_COLORS - i;
@@ -448,26 +449,33 @@ palette[i] = i << redshift | i << greenshift | i << blueshift; } -static void __init fb_set_logo (struct fb_info *info,u8 *logo,int needs_logo) +#if defined (__BIG_ENDIAN) +#define BIT_SHIFT (x, shift) ((x) >> (shift)) +#else +#define BIT_SHIFT (x, shift) ((x) << (shift)) +#endif + +static void fb_set_logo (struct fb_info *info,u8 *logo,int needs_logo) {int i, j; +u8 mask = (u8 ) ~(BIT_SHIFT (0xffff , info->var.bits_per_pixel));switch (needs_logo) {case 4 : -for (i =0 ; i < (LOGO_W *LOGO_H )/2 ; i++) { +for (i =0 ; i < (LOGO_W *LOGO_H )/2 ; i++) { logo[i*2 ] = linux_logo16[i] >>4 ; logo[(i*2 )+1 ] = linux_logo16[i] &0xf ; }break ;case 1 :case ~1 : -default : -for (i =0 ; i < (LOGO_W *LOGO_H )/8 ; i++) -for (j =0 ; j <8 ; j++) - logo[i*8 + j] = (linux_logo_bw[i] & (7 - j)) ? - ((needs_logo ==1 ) ?1 :0 ) : - ((needs_logo ==1 ) ?0 :1 ); -break ; +for (i =0 ; i < (LOGO_W *LOGO_H )/8 ; i++) { +u8 d = linux_logo_bw[i]; +for (j =0 ; j <8 ; j++, d <<=1 ) + logo[i*8 +j] = (((d ^ needs_logo) >>7 ) &1 ) ? + mask :0 ; + } +break ; } }
drivers/video/i810/i810_accel.c +1 -1
@@ -404,7 +404,7 @@return ; } -if (par->depth ==4 || image->depth !=1 ) { +if (par->depth ==4 || image->depth !=0 ) {wait_for_engine_idle (par);cfb_imageblit (p, image);return ;
drivers/video/riva/fbdev.c +1 -1
@@ -1323,7 +1323,7 @@volatile u32 *d;int i, j, size; -if (image->depth !=1 ) { +if (image->depth !=0 ) {wait_for_idle (par);cfb_imageblit (info, image);return ;
drivers/video/skeletonfb.c +7 -2
@@ -445,9 +445,14 @@* @fg_color: For mono bitmap images this is color data for * @bg_color: the foreground and background of the image to * write directly to the frmaebuffer. -* @depth: How many bits represent a single pixel for this image. +* @depth: This will be zero (0) if color expanding (character drawing). +* If nonzero, this represent the pixel depth of the data. * @data: The actual data used to construct the image on the display. -* @cmap: The colormap used for color images. +* It is a monochrome bitmap if color expanding. For image +* drawing, each byte of data represents 1 pixel irrespective +* of the framebuffer depth. The byte is either an index to the +* pseudo_palette for directcolor and truecolor, or the +* actual pixel written to the framebuffer. */ }
drivers/video/softcursor.c +1 -1
@@ -47,7 +47,7 @@ image.dy = cursor->image.dy; image.width = cursor->image.width; image.height = cursor->image.height; - image.depth = cursor->image.depth; + image.depth =0 ; image.data = data;if (info->fbops->fb_imageblit)
drivers/video/tdfxfb.c +1 -1
@@ -939,7 +939,7 @@u8 *chardata = (u8 *) pixmap->data;u32 srcfmt; -if (pixmap->depth ==1 ) { +if (pixmap->depth ==0 ) {banshee_make_room (par,8 + ((size +3 ) >>2 ));tdfx_outl (par,COLORFORE , pixmap->fg_color);tdfx_outl (par,COLORBACK , pixmap->bg_color);
drivers/video/tgafb.c +1 -1
@@ -572,7 +572,7 @@can do better than the generic code. */ /* ??? There is a DMA write mode; I wonder if that could be made to pull the data from the image buffer... */ -if (image->depth >1 ) { +if (image->depth >0 ) {cfb_imageblit (info, image);return ; }
drivers/video/vga16fb.c +1 -1
@@ -1301,7 +1301,7 @@void vga16fb_imageblit (struct fb_info *info,struct fb_image *image) { -if (image->depth ==1 ) +if (image->depth ==0 )vga_imageblit_expand (info, image);else if (image->depth == info->var.bits_per_pixel)vga_imageblit_color (info, image);
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 10 lines · Antonino Daplas
Quoted 9 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino Daplas
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
I'll have to do some more fixes there, since the monochrome logo is used not only on monochrome displays, but on all other displays with
bits_per_pixel< 4 Since the pixel data infb_imageare colormap indices, they have to reflect the correctblack' andwhite' colors on such displays.
Quoted 8 lines
Quoted 4 lines
E.g. on amifb (which supports all
bits_per_pixelfrom 1 through 8) the logo showed up in black-and-blue withbits_per_pixel== 3, cfr. the first two entries of {red,green,blue}8[] infbcmap.c.Hmm, I see. I think only
linux_logo_bwwill be the only one affected, sincelinux_logo_16happens to match the console palette and inlinux_logo, we either reset the palette and/or the cmap.
Indeed.
Quoted 2 lines
Would expanding each bit to the full bit depth work? Ie for bpp=8 using monochrome data, white is 0 and black is
0xff.
For bpp=8 that won't work, since we have 16 console colors only :-)
But for bpp=[1-3] that's OK, cfr. fbcmap.c.
BTW, perhaps it makes sense to just pass the appropriate black' and white' pixel values to the logo conversion routine? Preferably through a 2-element array, so we can index it with the logo data bit value instead of using tests/branches. Then we'd have:
- mono01: black = (1<<bits_per_pixel)-1, white = 0
- mono10: black = 0, white = (1<<bits_per_pixel)-1
- pseudocolor depth 1: black = 0, white = 1
- pseudocolor depth 2: black = 0, white = 3
- pseudocolor depth 3: black = 0, white (actually light grey) = 7
And thanks to the (1<<depth)-1' instead of 1' for the mono* cases, monochrome with bits_per_pixel = e.g. 8 will work as well.
What do you think?
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 20 lines · Geert Uytterhoeven
Quoted 10 lines · Antonino Daplas
Quoted 9 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino Daplas
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
I'll have to do some more fixes there, since the monochrome logo is used not only on monochrome displays, but on all other displays with
bits_per_pixel< 4 Since the pixel data infb_imageare colormap indices, they have to reflect the correctblack' andwhite' colors on such displays.Quoted 8 lines
Quoted 4 lines
E.g. on amifb (which supports all
bits_per_pixelfrom 1 through 8) the logo showed up in black-and-blue withbits_per_pixel== 3, cfr. the first two entries of {red,green,blue}8[] infbcmap.c.Hmm, I see. I think only
linux_logo_bwwill be the only one affected, sincelinux_logo_16happens to match the console palette and inlinux_logo, we either reset the palette and/or the cmap.
Quoted 7 lines
Indeed.
Quoted 2 lines
Would expanding each bit to the full bit depth work? Ie for bpp=8 using monochrome data, white is 0 and black is
0xff.For bpp=8 that won't work, since we have 16 console colors only :-)
Of course :-)
Quoted 7 lines
But for bpp=[1-3] that's OK, cfr.
fbcmap.c.BTW, perhaps it makes sense to just pass the appropriate
black' andwhite' pixel values to the logo conversion routine? Preferably through a 2-element array, so we can index it with the logo data bit value instead of using tests/branches. Then we'd have:
Something like this?
static void fb_set_logo(struct fb_info *info, u8 *logo, int needs_logo)
{
int i, j;
u8 mask[2] = {0,0};
switch (needs_logo) {
case 4:
for (i = 0; i < (LOGO_W * LOGO_H)/2; i++) {
logo[i*2] = linux_logo16[i] >> 4;
logo[(i*2)+1] = linux_logo16[i] & 0xf;
}
break;
case 1:
case ~1:
mask[1] = (u8) ~(BIT_SHIFT(0xffff, info->var.bits_per_pixel));
for (i = 0; i < (LOGO_W * LOGO_H)/8; i++) {
u8 d = linux_logo_bw[i];
for (j = 0; j < 8; j++, d <<= 1)
logo[i*8+j] = mask[((d ^ needs_logo) >> 7) & 1];
}
break;
}
}Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 56 lines · Antonino Daplas
Quoted 20 lines · Geert Uytterhoeven
Quoted 10 lines · Antonino Daplas
Quoted 9 lines · Geert Uytterhoeven
Quoted 2 lines · Antonino Daplas
2. diff submitted by Geert: cleaner logo data preparation for monochrome cards and correct initialization of palette_cmap.transp.
I'll have to do some more fixes there, since the monochrome logo is used not only on monochrome displays, but on all other displays with
bits_per_pixel< 4 Since the pixel data infb_imageare colormap indices, they have to reflect the correctblack' andwhite' colors on such displays.Quoted 8 lines
Quoted 4 lines
E.g. on amifb (which supports all
bits_per_pixelfrom 1 through 8) the logo showed up in black-and-blue withbits_per_pixel== 3, cfr. the first two entries of {red,green,blue}8[] infbcmap.c.Hmm, I see. I think only
linux_logo_bwwill be the only one affected, sincelinux_logo_16happens to match the console palette and inlinux_logo, we either reset the palette and/or the cmap.Quoted 7 lines
Indeed.
Quoted 2 lines
Would expanding each bit to the full bit depth work? Ie for bpp=8 using monochrome data, white is 0 and black is
0xff.For bpp=8 that won't work, since we have 16 console colors only :-)
Of course :-)
Quoted 7 lines
But for bpp=[1-3] that's OK, cfr.
fbcmap.c.BTW, perhaps it makes sense to just pass the appropriate
black' andwhite' pixel values to the logo conversion routine? Preferably through a 2-element array, so we can index it with the logo data bit value instead of using tests/branches. Then we'd have:Something like this?
static void
fb_set_logo(struct fb_info *info, u8 *logo, int needs_logo){ int i, j; u8 mask[2] = {0,0}; switch (needs_logo) { case 4: for (i = 0; i < (LOGO_W * LOGO_H)/2; i++) { logo[i*2] = linux_logo16[i] >> 4; logo[(i*2)+1] = linux_logo16[i] & 0xf; } break; case 1: case ~1: mask[1] = (u8) ~(BIT_SHIFT(0xffff, info->var.bits_per_pixel));
Quoted 8 lines
for (i = 0; i < (LOGO_W * LOGO_H)/8; i++) {
u8 d = linux_logo_bw[i];
for (j = 0; j < 8; j++, d <<= 1)
logo[i*8+j] = mask[((d ^ needs_logo) >> 7) & 1];
}
break;
}
}Yes, looks ok.
BTW, you can get rid of the `d ^ needs_logo' inside the loop by initializing mask[] based on the value of needs_logo.
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 3 lines
I think we still have several corner cases, such as TRUECOLOR with bpp <= 8, I'm not sure if that works.
The matorx millenium has such a mode. So such things do exist.
drivers/video/cfbimgblt.c line 326
Quoted 2 lines
drivers/video/cfbimgblt.c +1
-1-if (image->depth ==1 ) { +if (image->depth ==0 ) {
P.S
I'm just not to crazy about the depth equal zero thing. I just pitcure
developers having a hard time with it.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 5 lines · James Simmons
Quoted 2 lines
I think we still have several corner cases, such as TRUECOLOR with bpp <= 8, I'm not sure if that works.
The matorx millenium has such a mode. So such things do exist.
Quoted 7 lines
drivers/video/cfbimgblt.c line 326
Quoted 2 lines
drivers/video/cfbimgblt.c +1
-1-if (image->depth ==1 ) { +if (image->depth ==0 ) {
P.SI'm just not to crazy about the depth equal zero thing. I just pitcure
developers having a hard time with it.
Monochrome color expansion just works differently: it expands the zeroes and ones in a bitmap based on fg_color and bg_color, while image drawing draws an image containing colormap indices to the frame buffer.
Do you have a better suggestion?
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 11 lines · Geert Uytterhoeven
Quoted 10 lines · James Simmons
Quoted 2 lines
I think we still have several corner cases, such as TRUECOLOR with bpp <= 8, I'm not sure if that works.
The matorx millenium has such a mode. So such things do exist.
drivers/video/cfbimgblt.c line 326
Quoted 2 lines
drivers/video/cfbimgblt.c +1
-1-if (image->depth ==1 ) { +if (image->depth ==0 ) {
P.S
Quoted 9 lines
Quoted 2 lines
I'm just not to crazy about the depth equal zero thing. I just pitcure
developers having a hard time with it.Monochrome color expansion just works differently: it expands the zeroes and ones in a bitmap based on
fg_colorandbg_color, while image drawing draws an image containing colormap indices to the frame buffer.Do you have a better suggestion?
If James is a bit skeptical about this, how about doing it this way:
If image.fg_color and image.bg_color == 0, then each byte of image.data is an index to the pseudo_palette, or the actual pixel, whatever the case may be. Otherwise, image.data is a monochrome bitmap that should be expanded using fg_color and bg_color.
No other changes will be needed except that mono cards have to test for fg_color and bg_color, and we need to memset the fb_image structure to 0 in fb_set_logo(). Non-mono cards will continue testing for image.depth.
Do you think this will work? The only problem I can think of is a color expansion request where both bg and fg is 0.
Or to totally eliminate the above possibility, add an extra field in struct fb_image to denote color expansion vs logo drawing. Again, only mono cards will need to do this test.
Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 19 lines · Antonino Daplas
Quoted 10 lines · Geert Uytterhoeven
Quoted 2 lines · James Simmons
I'm just not to crazy about the depth equal zero thing. I just pitcure
developers having a hard time with it.Monochrome color expansion just works differently: it expands the zeroes and ones in a bitmap based on
fg_colorandbg_color, while image drawing draws an image containing colormap indices to the frame buffer.Do you have a better suggestion?
If James is a bit skeptical about this, how about doing it this way:
If image.fg_color and image.bg_color == 0, then each byte of image.data is an index to the
pseudo_palette, or the actual pixel, whatever the case may be. Otherwise, image.data is a monochrome bitmap that should be expanded usingfg_colorandbg_color.
Quoted 6 lines
No other changes will be needed except that mono cards have to test for
fg_colorandbg_color, and we need to memset thefb_imagestructure to 0 infb_set_logo(). Non-mono cards will continue testing for image.depth.Do you think this will work? The only problem I can think of is a color expansion request where both bg and fg is 0.
And that can happen, try <ESC>[31m<ESC>[41m to set both to red.
Quoted 3 lines
Or to totally eliminate the above possibility, add an extra field in struct
fb_imageto denote color expansion vs logo drawing. Again, only mono cards will need to do this test.
Ugh, why invent a new field if we can use an existing field? depth == 0 is invalid for image blitting anyway.
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines
Do you think this will work? The only problem I can think of is a color expansion request where both bg and fg is 0.
Quoted 9 lines
And that can happen, try <ESC>[31m<ESC>[41m to set both to red.
Quoted 3 lines
Or to totally eliminate the above possibility, add an extra field in struct
fb_imageto denote color expansion vs logo drawing. Again, only mono cards will need to do this test.Ugh, why invent a new field if we can use an existing field? depth == 0 is invalid for image blitting anyway.
No argument here.
Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 4 lines · Antonino Daplas
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
What's the status of this issue? Monochrome is still broken due to this.
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 Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 8 lines · Geert Uytterhoeven
Quoted 4 lines · Antonino Daplas
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
What's the status of this issue? Monochrome is still broken due to this.
It's still the same :-(
Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Quoted 7 lines
Quoted 5 lines
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
What's the status of this issue? Monochrome is still broken due to this.
Ug. There are a few issues left to deal with.
1) The cursor issue. We need to add in the cusor ioctl call for people to use. Theortically there should be no issues with using soft_cursor with full color images with xxfb_imageblit. I like to see dest go away in struct fb_cursor. It's a matter of taking advantage of the upper console layer here. We shouldn't have any static variables in accel_cursor because if we have multiple cards we have problems. I plan to work on that.
2) Tileblits and stuff. I have been thinking about this and I really like to make it even more generic. We also have seperate buffers for textures for example which could also be used to draw fonts. The first thing is allocating or retreiving memory space for where to store the images. Second is to draw it. I guess a index of position would be used.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 8 lines · James Simmons
Quoted 7 lines
Quoted 5 lines
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
What's the status of this issue? Monochrome is still broken due to this.
How about assigning fb_image.{bg_color,fg_color} to -1 if not color expanding? Since the pseudo_palette will not exceed 255, this should be safe.
Quoted 5 lines
Ug. There are a few issues left to deal with.
1) The cursor issue. We need to add in the cusor ioctl call for people to use. Theortically there should be no issues with using
soft_cursorwith full color images withxxfb_imageblit. I like to see dest go away in
In order to do this, fb_imageblit has to support transparency (using a transparency bitmask). Userland apps will rarely have rectangular mouse cursor pointers. Also, it will need to support ROP's invert and copy. This will break fb_imageblit.
Also, we have to double-buffer what's underneath the cursor.
Tony
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 11 lines · Antonino Daplas
Quoted 6 lines · James Simmons
Quoted 6 lines
Quoted 4 lines
1. Changed meaning of image.depth. If image.depth == 0, it flags for color expansion, otherwise, it flags for image drawing (without color expansion). This change is to accomodate monochrome cards so they can differentiate character drawing from logo drawing.
What's the status of this issue? Monochrome is still broken due to this.
How about assigning fb_image.{bg_color,fg_color} to -1 if not color expanding? Since the
pseudo_palettewill not exceed 255, this should be safe.
Unless we ever want to support colors > 256 (or real pixel values)?
Alternatively, we can split imageblit in two routines, one for image drawing, and one for color expansion.
So we now have 3 options:
1. image.depth = 0 means color expansion,
2. fb_image.{bg_color,fg_color} = -1 means color expansion,
3. separate functions for image drawing and color expansion.
I still favor solution 1, since image.depth = 0 is not possible for images, while fb_image.{bg_color,fg_color} = -1 (= 0xffffffff) may become valid in the future, and the last one is more work to adapt the current drivers.
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:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf