Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <e94_msu@elixir.e.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Fri, 21 Aug 1998 13:59:18 +0200

Re: Can I do that ?

> Then I did understand, and it  will be slow.  Or  the API is much more
> clever than I thought.
> 
> For instance, let's say that I want to send a 8bpp picture to my 24bpp
> screen on a matrox millenium II.  You seem to mean that I have to:
> 
> 1- Send it (I did not found the  appropriate function) to a palemu:kgi
> visual
>
> 2- bitblt it to the my previously open visual associated to the screen

No.
Using what is currently in the libggi API you would open a memory
visual and read the picture into that visual.
Then you would use ggiCrossBlit() to blit the picture to the visual
representing the Matrox card. It is then up to the Matrox-specific
driver-libs to accelerate the ggiCrossBlit() function in all possible
ways.

> But  the matrox ILOAD operation  is  able to combine  the blitting and
> table lookup in  hardware.  How can the userspace  part of the  matrox
> driver shortcut this two-step operation?

This depends on what the prerequisites for ILOAD are. Does the picture
need to be in the gfx-boards memory, or should it be in main-memory?
How do you tell the matrox hardware what the lookup table should look
like?

Even if the picture are in main memory you need to request the space
for it by calling the KGI driver. This is because DMA access to
user-space allocated memory would cause severe security holes in
Linux as it's currently implemented. There has been talk about adding
support for requesting DMA regions from the kernel, but I don't know
if anything has been done yet.

Anyway, requesting such space is not within the scope of the libggi
API, as we want to keep it lightweight. Requesting off-screen
buffers (except for extra frames for double/tripple buffering)
will be handled by a libggi extension.

Basicly this extension would contain generic functions to request
offscreen space for images, and functions to do different things
with these buffers, for example blit them to the screen with and without
color conversion. The Matrox-specific driver libraries would then implement
this so that the color-converting blit is accelerated using the ILOAD
operation.

> Same goes for transparent operations.

Transperancy is also out of the scope of libggi. libggi2d is the
extension library that handles transparency and other advanced 2D
features.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |      E-Mail: e94_msu@e.kth.se


Index: [thread] [date] [subject] [author]