From f8482967ae8080f49dd1bbb0b79cc65020df679f Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 4 Apr 2007 12:28:48 +0200 Subject: [PATCH] Add an EXA driver callback to determine whether a pixmap is "offscreen" in exa terms, which means accessible to the GPU. Bump exa minor. The change is backwards-compatible. --- exa/exa.c | 3 +++ exa/exa.h | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/exa/exa.c b/exa/exa.c index dd27d5e89..23fe55516 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -322,6 +322,9 @@ exaPixmapIsOffscreen(PixmapPtr p) if (p->devPrivate.ptr == NULL) return TRUE; + if (pExaScr->info->PixmapIsOffscreen) + return pExaScr->info->PixmapIsOffscreen(p); + return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - (CARD8 *) pExaScr->info->memoryBase) < pExaScr->info->memorySize); diff --git a/exa/exa.h b/exa/exa.h index bf723f723..6c39a8fdb 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -39,7 +39,7 @@ #include "fb.h" #define EXA_VERSION_MAJOR 2 -#define EXA_VERSION_MINOR 1 +#define EXA_VERSION_MINOR 2 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; @@ -636,6 +636,23 @@ typedef struct _ExaDriver { */ void (*FinishAccess)(PixmapPtr pPix, int index); + /** + * PixmapIsOffscreen() is an optional driver replacement to + * exaPixmapIsOffscreen(). Set to NULL if you want the standard behaviour + * of exaPixmapIsOffscreen(). + * + * @param pPix the pixmap + * @return TRUE if the given drawable is in framebuffer memory. + * + * exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen + * memory, meaning that acceleration could probably be done to it, and that it + * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it + * with the CPU. + * + * + */ + Bool (*PixmapIsOffscreen)(PixmapPtr pPix); + /** @name PrepareAccess() and FinishAccess() indices * @{ */