linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zack <plinius@comcast.net>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: fbdraw 0.1 available
Date: Sat, 11 Sep 2004 11:09:32 -0700	[thread overview]
Message-ID: <41433F5C.70603@comcast.net> (raw)
In-Reply-To: <Pine.GSO.4.58.0409111241390.17924@waterleaf.sonytel.be>

Geert Uytterhoeven wrote:
> 
>   - Is there any special reason why you implement your own fb_fill_area() and
>     fb_copy_area() (which doesn't do anything?), while fb_fillrect() and
>     fb_copyarea() already exist?

Yes, for 3 reasons:
1. I want to be able to clip graphics to a subset of the screen, so that
later the screen will be shareable between processes. In 0.1b, this
clipping works quite effectively.
2. I wanted to increase the speed. My routine's loops are slightly
unfolded to avoid branching and the performance is therefore better.
3. If I later update it for MMX or other changes, it would be
easier for me to do so if it's my code and infrastructure.

>   - Do you have compared the performance of your fbdraw compared to user space
>     mmap()ing the frame buffer and doing all drawings in user space?

Well, no. As I mentioned before the reason for putting things in the
kernel is that it ensures the code will remain small and more
carefully optimized. Most things in userspace tend to become bloated
eventually and often never get optimized.

> BTW, I'm also considering exporting fb_fillrect(), fb_copyarea(), and
> fb_imageblit() to userspace, but for a different reason.

> Right now applications need to know the exact frame buffer layout. For most
> modern PC graphics cards that's OK, since they all do cfb8/16/24/32. But older
> (usually unaccelerated) and embedded hardware may use a different layout (e.g.
> seperate buffers for even and odd display lines on some set top box hardware,
> bitplanes, ...) putting a severe burden on applications.

I agree that odd hardware is a burden, and one which fbdraw can
alleviate by hiding the complexity behind the abstraction.

Speaking of which, I wrote a set of fast 4bpp VGA routines that are
equivalent to the fbdraw routines. The latest version I wrote in
16bit x86 assembly so they are very fast. It will eventually add
these to fb.

> By letting the application draw to a fixed format cfb8 (pseudocolor) or cfb32
> (RGBA) shadow buffer and call the kernel for updating the screen, this can be
> solved in a generic way.  Currently now fb_imageblit() already has to do the
> conversion from cfb8 to native layout anyway.

But that shadow buffer is bloat, and the blit takes time.

If you want to draw an RGB image onto the screen, better to convert
it to native format and draw that quickly. If you have to draw it
again later, you'll hopefully have the native copy available.

Ciao,
Zack


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php

  reply	other threads:[~2004-09-11 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-11  2:43 fbdraw 0.1 available Zack
2004-09-11 10:53 ` Geert Uytterhoeven
2004-09-11 18:09   ` Zack [this message]
2004-09-11 19:40 ` Antonino A. Daplas
2004-09-13  0:31   ` Zack
2004-09-13 11:18     ` Geert Uytterhoeven

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=41433F5C.70603@comcast.net \
    --to=plinius@comcast.net \
    --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).