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) { diff --git a/exa/exa.h b/exa/exa.h index f4c129756..2cf9fe44a 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -33,7 +33,7 @@ #include "picturestr.h" #define EXA_VERSION_MAJOR 0 -#define EXA_VERSION_MINOR 1 +#define EXA_VERSION_MINOR 2 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; @@ -218,7 +218,11 @@ exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, ExaOffscreenArea * exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area); +unsigned long +exaGetPixmapOffset(PixmapPtr pPix); +unsigned long +exaGetPixmapPitch(PixmapPtr pPix); #define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \ offscreen_byte_align, offscreen_pitch, flags, \ diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 4d25d5a92..77d97dd96 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.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) { diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 4d25d5a92..77d97dd96 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.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) { diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c index 4d25d5a92..77d97dd96 100644 --- a/hw/xfree86/exa/exa.c +++ b/hw/xfree86/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) { diff --git a/hw/xfree86/exa/exa.h b/hw/xfree86/exa/exa.h index f4c129756..2cf9fe44a 100644 --- a/hw/xfree86/exa/exa.h +++ b/hw/xfree86/exa/exa.h @@ -33,7 +33,7 @@ #include "picturestr.h" #define EXA_VERSION_MAJOR 0 -#define EXA_VERSION_MINOR 1 +#define EXA_VERSION_MINOR 2 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; @@ -218,7 +218,11 @@ exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, ExaOffscreenArea * exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area); +unsigned long +exaGetPixmapOffset(PixmapPtr pPix); +unsigned long +exaGetPixmapPitch(PixmapPtr pPix); #define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \ offscreen_byte_align, offscreen_pitch, flags, \ diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c index 4d25d5a92..77d97dd96 100644 --- a/hw/xfree86/exa/exa_accel.c +++ b/hw/xfree86/exa/exa_accel.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) { diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c index 4d25d5a92..77d97dd96 100644 --- a/hw/xfree86/exa/exa_migration.c +++ b/hw/xfree86/exa/exa_migration.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) {