From: Antonino Daplas <adaplas@pol.net>
To: James Simmons <jsimmons@infradead.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux Frame Buffer Device Development
<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: fb_imageblit()
Date: 08 Jan 2003 10:41:47 +0800 [thread overview]
Message-ID: <1041993390.927.38.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44.0301072215370.17129-100000@phoenix.infradead.org>
On Wed, 2003-01-08 at 06:23, James Simmons wrote:
> > >
> > > 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.
>
> The requirement I made of imageblit was to always use packed data. What
> the indices approach was to to always use a struct fb_cmap. This way it
> didn't matter if used a pseudocolor mode or a directcolor mode.
I've thought of that also, packing the data according to the pixel depth.
However, this will be very inefficient since image blitting
will go like this:
a. Prepare logo data so each pixel of data is in directcolor format (if
we will use the cmap), so depth corresponds to framebuffer depth, and
data is packed.
b. Pass the structure to cfb_imageblit.
c. In cfb_imageblit, unpack the logo data:
d. Get each color component from the cmap data.
e. Recreate pixel data based on var.[color].offset and
var.[color].length.
f. Write the pixel data in packed form to the framebuffer.
Whereas, with the current approach:
a. Prepare logo data such that each pixel corresponds to one byte.
b. Pass the structure to cfb_imageblit.
c. Read color information from pseudopalette if directcolor/truecolor.
d. Write the pixel data in packed form to the framebuffer.
Aside from the inefficiency of the method (pack, unpack, pack), drawing
the logo will become inconsistent with the behavior of the rest of the
functions, since it's the only one that gets color info differently. If
you look at color_imageblit() and slow_imageblit(), they basically use
the same code logic.
Secondly, indexing the cmap instead of the pseudo_palette means that
cfb_imageblit has to know the native framebuffer format. This was
argued before that the generic drawing functions need not know of the
format, one of the reasons we have info->pseudopalette. Actually, in
order to be really consistent, I would rather have everything refer to
the pseudopalette, regardless of the visual format. This will be better
especially for some of the corner cases, like monochrome cards with
bits_per_pixel = 8.
Thirdly, it's much simpler for drivers to draw the logo. Just get the
corrct pixel data from it's own palette. No need to construct each
pixel from the cmap. That's tedious, slow, and will contribute to code
bloat. Which is easier? Get each byte from the logo data, and use it as an
index to the pseudo_palette, or unpack the data, separate each unit to 4
color components, and construct pixel data from cmap using the 4 extracted
indices?
I agree that it would be faster in some cases to draw a packed logo
data, but if we're going to be inconsistent, let's do it all the way.
Make the logo data match the native framebuffer format. This will be
very efficient, and this is the one that I actually prefer.
Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
next prev parent reply other threads:[~2003-01-08 2:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-05 16:38 fb_imageblit() Geert Uytterhoeven
2003-01-05 18:06 ` fb_imageblit() Antonino Daplas
2003-01-05 18:59 ` fb_imageblit() Geert Uytterhoeven
2003-01-07 22:23 ` fb_imageblit() James Simmons
2003-01-08 2:41 ` Antonino Daplas [this message]
2003-01-08 15:15 ` fb_imageblit() Geert Uytterhoeven
2003-01-08 16:25 ` fb_imageblit() Antonino Daplas
2003-01-08 16:49 ` fb_imageblit() Geert Uytterhoeven
2003-01-10 18:37 ` fb_imageblit() James Simmons
2003-01-09 9:50 ` fb_imageblit() Geert Uytterhoeven
2003-01-09 11:44 ` fb_imageblit() Antonino Daplas
2003-01-10 18:47 ` fb_imageblit() James Simmons
2003-01-10 19:23 ` fb_imageblit() James Simmons
2003-01-10 19:41 ` fb_imageblit() Geert Uytterhoeven
2003-01-11 5:11 ` fb_imageblit() Antonino Daplas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1041993390.927.38.camel@localhost.localdomain \
--to=adaplas@pol.net \
--cc=geert@linux-m68k.org \
--cc=jsimmons@infradead.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).