On Wed, Jun 9, 2010 at 3:49 AM, Cui, Hunk <[email protected]> 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 > > _______________________________________________ > [email protected]: 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. _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
