From 55c5c6953a3a661758a42b147f9542950a62fc4d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 24 Aug 2005 22:43:27 +0000 Subject: Bugzilla #4090: Introduce getters for pixmap pitch and offset, to simplify/clarify it for driver writers who probably don't want to know what pPixmap->devPrivate.ptr or pPixmap->devKind mean. Converts the sis driver to use them, and bumps the EXA module minor version. --- exa/exa.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'exa/exa.c') diff --git a/exa/exa.c b/exa/exa.c index 4d25d5a92..77d97dd96 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -58,6 +58,26 @@ int exaPixmapPrivateIndex; #define EXA_PIXMAP_SCORE_PINNED 1000 #define EXA_PIXMAP_SCORE_INIT 1001 +/* Returns the offset (in bytes) within the framebuffer of the beginning of the + * given pixmap. May need to be extended in the future if we grow support for + * having multiple card-accessible areas at different offsets. + */ +unsigned long +exaGetPixmapOffset(PixmapPtr pPix) +{ + ExaScreenPriv (pPix->drawable.pScreen); + + return ((unsigned long)pPix->devPrivate.ptr - + (unsigned long)pExaScr->info->card.memoryBase); +} + +/* Returns the pitch in bytes of the given pixmap. */ +unsigned long +exaGetPixmapPitch(PixmapPtr pPix) +{ + return pPix->devKind; +} + void exaDrawableDirty (DrawablePtr pDrawable) { -- cgit v1.2.3