On Saturday 26 May 2001 18:11, ralf willenbacher wrote:
> Steven Newbury wrote:
> > On Friday 25 May 2001 01:22, ralf willenbacher wrote:
> > > thanks for trying it out.
> > > i fixed a typo (again)..
> >
> > <patch snipped>
> > In your patch you changed  'totalcard = b->size' and  'totalagp=b->size'
> > to 'totalcard += b->size' and  'totalagp += b->size' in
> > xc/lib/GL/mesa/src/drv/mga/mgatexmem.c.  This change stopped things
> > working quite right.
>
> i use the total size to figure out where to kick a texture out.
> without the right numbers it could end up returning 0 and that would be
> bad
> since my g200 has no space on the card at all.
>
>   It starts up fine but seems to only have a couple of Mb of
>
> > texture space available - while I have 44Mb allocated giving 32Mb for
> > textures.
>
> it only uploads into card space, this is slower then into agp space.
>
> > The XF86Config option AGPSize still does not take effect,
>
> i have
> Section "Device"
>     Identifier  "g200"
>     Driver      "mga"
>     Option "AGPSize" "32"
> EndSection
> and get
> (II) MGA(0): [agp] 32768 kB allocated with handle 0xd1041000

I am really quite confused about this.  I have it set the same as you expect 
for 44 instead of 32.  I have added an extra message to report the size of 
the AGPSize setting during startup - but it reports 0Mb?!?

(**) MGA(0): Option "AGPMode" "2"    
(**) MGA(0): Option "AGPSize" "44"
(II) Loading sub module "mga_hal"
(II) LoadModule: "mga_hal"
(II) Loading /usr/X11R6/lib/modules/drivers/mga_hal_drv.o
(II) Module mga_hal: vendor="The XFree86 Project"
        compiled for 4.0.99.900, module version = 1.0.0
        ABI class: XFree86 Video Driver, version 0.4
(II) MGA(0): Matrox HAL module used                 
(--) MGA(0): Chipset: "mgag400"
(**) MGA(0): Allocating 0Mb for AGP memory
(**) MGA(0): Using AGP 2x mode

It all seems correct in mga_driver.c, but for some reason it doesn't seem to 
be setting pMga->agpSize from AGPSize
>
> im currently running with this pice of code..
>
> static int mgaChooseTexHeap( mgaContextPtr mmesa, mgaTextureObjectPtr t
> )
> {
>    int freeagp, freecard;
>    int fitincard, fitinagp;
>    int totalcard, totalagp;
>    TMemBlock *b;
>
>    totalcard = totalagp = fitincard = fitinagp = freeagp = freecard = 0;
>
>    b = mmesa->texHeap[0];
>    while(b)
>    {
>      totalcard += b->size;
>      if(b->free)
>      {
>        if(t->totalSize <= b->size)fitincard = 1;
>      }
>      b = b->next;
>    }
>
>    b = mmesa->texHeap[1];
>    while(b)
>    {
>      totalagp += b->size;
>      if(b->free)
>      {
>        if(t->totalSize <= b->size)fitinagp = 1;
>      }
>      b = b->next;
>    }
>
>    if(fitincard)return 0;
>    if(fitinagp)return 1;
>
>    if(totalcard && totalagp)
>    {
>      int ages;
>      int ratio = (totalcard > totalagp) ? totalcard / totalagp :
> totalagp / totalcard;
>      ages = mmesa->sarea->texAge[0] + mmesa->sarea->texAge[1];
>      if( (ages % ratio) == 0)
>      {
>         fprintf(stderr,"goes into heap %d\n", totalcard > totalagp ? 1 :
> 0);
>         return totalcard > totalagp ? 1 : 0;
>      }
>      else
>      {
>         fprintf(stderr,"goes into heap %d\n", totalcard > totalagp ? 0 :
> 1);
>         return totalcard > totalagp ? 0 : 1;
>      }
>    }
>
>    fprintf(stderr, "goes into heap %d\n", totalagp ? 1 : 0);
>    if(totalagp) return 1;
>    return 0;
> }
>

Yes, that works.

The code from the end of that function in the patch you posted ended:
if(totalcard >= t->totalSize)return 0;
if(totalagp >= t->totalSize)return 1;

This didn't work, I guess it was always returning 0 in my case?
> using the sarea ages is really wishfull thinking but it should work to
> select the smaller memory space from time to time.

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to