Who can explain the diff between Xserver-1.6.4 version and >1.7 version about the ExaGetPixmapAddress?

Maarten Maathuis madman2003 at gmail.com
Wed Jun 9 02:31:41 PDT 2010


On Wed, Jun 9, 2010 at 3:49 AM, Cui, Hunk <Hunk.Cui at amd.com> wrote:
> Hi, all,
>
>         About the exaGetPixmapOffset function in exa.c, please see below,
>
> In Xserver 1.6.4 version, describe as:
>
> static _X_INLINE void*
>
> ExaGetPixmapAddress(PixmapPtr p)
>
> {
>
>     ExaPixmapPriv(p);
>
>     if (pExaPixmap->offscreen && pExaPixmap->fb_ptr)
>
>         return pExaPixmap->fb_ptr;
>
>     else
>
>         return pExaPixmap->sys_ptr;
>
> }
>
> /**
>
>  * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer
> of
>
>  * the beginning of the given pixmap.
>
>  *
>
>  * Note that drivers are free to, and often do, munge this offset as
> necessary
>
>  * for handing to the hardware -- for example, translating it into a
> different
>
>  * aperture.  This function may need to be extended in the future if we grow
>
>  * support for having multiple card-accessible offscreen, such as an AGP
> memory
>
>  * pool alongside the framebuffer pool.
>
>  */
>
> unsigned long
>
> exaGetPixmapOffset(PixmapPtr pPix)
>
> {
>
>     ExaScreenPriv (pPix->drawable.pScreen);
>
>     return ((unsigned long)ExaGetPixmapAddress(pPix) -
>
>             (unsigned long)pExaScr->info->memoryBase);
>
> }
>
> In > Xserver 1.7 version, describe as:
>
> /**
>
>  * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer
> of
>
>  * the beginning of the given pixmap.
>
>  *
>
>  * Note that drivers are free to, and often do, munge this offset as
> necessary
>
>  * for handing to the hardware -- for example, translating it into a
> different
>
>  * aperture.  This function may need to be extended in the future if we grow
>
>  * support for having multiple card-accessible offscreen, such as an AGP
> memory
>
>  * pool alongside the framebuffer pool.
>
>  */
>
> unsigned long
>
> exaGetPixmapOffset(PixmapPtr pPix)
>
> {
>
>     ExaScreenPriv (pPix->drawable.pScreen);
>
>     ExaPixmapPriv (pPix);
>
>     return (CARD8 *)pExaPixmap->fb_ptr - pExaScr->info->memoryBase;
>
> }
>
> Who can explain the change? Why del the the part of sys_ptr in > 1.7
> version?

GetPixmapOffset is meant to get the offset of gpu accessable pixmaps,
they should have a fb_ptr since they are in offscreen memory. Getting
an offset relative to the offscreen memory base for memory that isn't
even in the offscreen pool is crazy.

>
> Thanks,
>
> Hunk Cui
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>



-- 
Life spent, a precious moment, in the wink of an eye we live and we die.


More information about the xorg-devel mailing list