On Thu, Oct 27, 2005 at 05:45:30PM +0200, Michel Dänzer wrote:
> On Thu, 2005-10-27 at 17:08 +0100, Andreas wrote:
> > 
> > 
> > >       * For cards that allow setting different swapping for
> > > different
> > >         ranges of the framebuffer, these wrappers set up the ranges
> > > and
> > >         swapping for the pixmaps.
> > 
> > 
> > I am interested in trying this, if I have a supported card, do you
> > know if Rage128 or Radeon 9200 support this?
> > If it is possible to set up three regions, a more sophisticated
> > surfacemanager which stores surfaces of the same depth together should
> > basically do the trick.
> 
> Radeons support 8 so-called surfaces on top of the default surface
> (anything outside of a specific surface). Not sure about Rage128.

The following pseudo code snippet I just quickly hacked together should 
sort of demonstrate how these surface registers could be used.

struct surface {
     int ref;
     int ranges;
     int bpp;
     int start;
     int end;
};

int start_cpu_access( int start, int end, int bpp )
{
     struct surface *f = NULL, *n = NULL;

     for (i = 0; i < 8; i++) {
          struct surface *r = &radeon->surfaces[i];

          if (r->ref && r->ranges == 1 && bpp == r->bpp &&
              start == r->start && end == r->end) {
               r->ref++;
               return 0;
          }
          if (!r->ref) {
               f = r;
               continue;
          }
          if (r->ref && r->ranges == 1 && bpp == r->bpp &&
              (start == r->end + 1 || r->start == end + 1)) {
               n = r;
               continue;
          }
    }
     if (n) {
          n->ref++;
          n->ranges = 2;
          n->start = min(n->start, start);
          n->end = max(n->end, end);

          program_register( n );

          return 0;
     }
     if (f) {
          f->ref = 1;
          f->ranges = 1;
          f->bpp = bpp;
          f->start = start;
          f->end = end;

          program_register( f );

          return 0;
     }

     return -1;
}

Obviously that code would need some work and it would need the a 
end_cpu_access() counterpart. After that it would be a matter of adding 
them to the graphics driver API and calling them at the proper places.


According to the specs the surfaces on a Rage128 can't do anything. No 
mention of byte swapping or untiling in the register descriptions. Also it 
only has 4 of them.

-- 
Ville Syrjälä
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to