Thread (15 messages) flat view 15 messages, 3 authors, 2003-01-11

Re: fb_imageblit()

From: Antonino Daplas <hidden>
Date: 2003-01-05 18:19:20

On Mon, 2003-01-06 at 00:38, Geert Uytterhoeven wrote:
I have a few questions and comments related to fb_imageblit().

 1. Why is the logo data in fb_image.data stored in an `unpacked' way? I.e.
    each byte of the logo data corresponds to one pixel of the image,
    irrespective of the depth of the image.
I asked before what would be the content of the logo data and it was
agreed that the logo data would either contain indices to the
pseudo_palette for truecolor and directcolor or the pixel itself for the
rest so it's consistent with the rest of the soft accel functions. 
Fixing the minimum unit to one byte seems a reasonable compromise
between maximum number of colors available and size of logo data.  Plus,
it would be simpler to code.
    However, I do see one good reason: it makes life easier for planar
    displays, since a fast c2p (chunky-to-planar) convertor doesn't have to
    care about the image depth, the source data is always 1 byte per pixel.

 2. If fb_image.depth == 1, how can fb_imageblit() distinguish between drawing
    a monochrome image (e.g. penguin logo) and color expanding a monochrome
    image (e.g. drawing text)? It's not possible to handle them the same, since
    image data for color expansion is packed, while image data for monochrome
    image drawing is not.
I noticed this before but completely forgot about it because I have no
monochrome graphics card to test :-)
    
    If monochrome image data would be packed as well, it could be handled by
    setting fb_image.fg_color = 1 and fb_image.bg_color = 0 (or vice versa for
    mono10), and fb_set_logo() becomes simpler as well.

    If we retain the unpacked data for images, we need some other flag to
    indicate color expansion. Perhaps setting fb_image.depth to 0?
If we change the contents of the logo data, then it makes sense to pack
the logo data also.  However, if we stick to indices, we might as well
retain the "unpacked" 8-bit format.  I think setting fb_image.depth to 0
to mean color expansion is more appropriate. Drivers that will need
trivial changing would be tgafb, i810fb, rivafb, tdfxfb, atyfb, vga16fb
and of course cfb_imgblt.c, softcursor.c and fbcon.c.

I'll submit a patch if everyone agrees.  

Tony




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help