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

Re: DirectBuffer extension requests?!(!) (was Re: LibGGI3D RFC)

> > 	First, let's define our terminology.  A DirectBuffer is a memory
> > buffer which is specified to be located on a particular type of storage
> > (video RAM right now) and/or has a hardware-specific internal
> > layout/structure, and/or needs specialized handling methods.  Am I in the
> > ballpark?
> 
> This sounds right.   (there's a really good doc on this written somewhere)
> 
> TODO:  (guessing)
> 	KGI memory management?
> 	(this should be duable userspace inside KGI target, just need to
> 	 keep track of what's been used where)
> 
> AFAIK the rest of directbuffer is already operational.  actually the KGI
> (and kgicon) driver needs a buncha work here.

Well, if we want extension libraries to be able to add DirectBuffers
we need to update the targets so that they only free the buffers
that they have allocated - not all buffers, but this shouldn't be
much work.

Also you need to design the structures that describes your new
buffers, so we can add entries for them in this enum: (from ggi.h)
typedef enum {
        blPixelLinearBuffer,
        blBitPlanarBuffer,
        blInterleavedPlanarBuffer,
        blExtended,

        blLastBufferLayout
} ggi_bufferlayout;

Other than that there shouldn't be any more work to do 
in the core libggi.

Btw, currently we have this code in struct ggi_directbuffer:
        /* The actual buffer info. Depends on layout. */
        union {
                ggi_pixellinearbuffer plb;
                ggi_bitplanarbuffer bplan;
                ggi_interleavedplanarbuffer iplan;

                void *extended;
        } buffer;
This means that we can never add new buffer types who's size
is greater than the biggest struct in this union (unless they
use the extended entry, but this requires the app to cast the
pointer to the correct type, which is not a good solution for
common buffer types)

This gives us two options; either we add a char dummy_pad[xxx], 
where xxx is some sufficiently large number, or we make it a
union of pointers. What do you think? Andrew?

//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]