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.
This commit is contained in:
Eric Anholt 2005-08-24 22:43:27 +00:00
parent 079ad773e0
commit 55c5c6953a
8 changed files with 130 additions and 2 deletions

View File

@ -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)
{

View File

@ -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, \

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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, \

View File

@ -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)
{

View File

@ -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)
{