From 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 24 Feb 2009 09:22:09 +0100 Subject: EXA: Handle separate alpha maps properly in Composite fallback. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . As this can't work without new EXA_PREPARE_AUX* indices, this requires a major version bump, so we can also drop the UploadToScratch driver hook and ExaOffscreenSwap*(). So this also fixes http://bugs.freedesktop.org/show_bug.cgi?id=20213 . Moreover, introduce EXA_DRIVER_KNOWN_MAJOR to break compilation of drivers which may not be able to handle EXA_PREPARE_AUX*, giving instructions how to make them build again in the #error message. Signed-off-by: Michel Dänzer --- exa/exa.h | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-) (limited to 'exa/exa.h') diff --git a/exa/exa.h b/exa/exa.h index 21a0f1abf..b80d0d4a2 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -38,8 +38,17 @@ #include "picturestr.h" #include "fb.h" -#define EXA_VERSION_MAJOR 2 -#define EXA_VERSION_MINOR 4 +/* If the driver can't seem to handle this major version, abort compilation with + * instructions how to fix it. + */ +#if !defined(EXA_DRIVER_KNOWN_MAJOR) || EXA_DRIVER_KNOWN_MAJOR < 3 +#error Make sure this EXA driver either does not have Prepare/FinishAccess \ + hooks or that they can handle EXA_PREPARE_AUX*, and \ + #define EXA_DRIVER_KNOWN_MAJOR 3 before including exa.h +#endif + +#define EXA_VERSION_MAJOR 3 +#define EXA_VERSION_MINOR 0 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; @@ -498,32 +507,6 @@ typedef struct _ExaDriver { char *src, int src_pitch); - /** - * UploadToScratch() is used to upload a pixmap to a scratch area for - * acceleration. - * - * @param pSrc source pixmap in host memory - * @param pDst fake, scratch pixmap to be set up in offscreen memory. - * - * The UploadToScratch() call was added to support Xati before Xati had - * support for hostdata uploads and before exaGlyphs() was written. It - * behaves incorrectly (uses an invalid pixmap as pDst), - * and UploadToScreen() should be implemented instead. - * - * Drivers implementing UploadToScratch() had to set up space (likely in a - * statically allocated area) in offscreen memory, copy pSrc to that - * scratch area, and adust pDst->devKind for the pitch and - * pDst->devPrivate.ptr for the pointer to that scratch area. The driver - * was responsible for syncing (as it was implemented using memcpy() in - * Xati), and only the data from the last UploadToScratch() was guaranteed - * to be valid at any given time. - * - * UploadToScratch() should not be implemented by drivers, and will likely - * be removed in a future version of EXA. - */ - Bool (*UploadToScratch) (PixmapPtr pSrc, - PixmapPtr pDst); - /** * DownloadFromScreen() loads a rectangle of data from pSrc into dst * @@ -672,6 +655,13 @@ typedef struct _ExaDriver { * from. */ #define EXA_PREPARE_MASK 2 + /** + * EXA_PREPARE_AUX* are additional indices for other purposes, e.g. + * separate alpha maps with Composite operations. + */ + #define EXA_PREPARE_AUX0 3 + #define EXA_PREPARE_AUX1 4 + #define EXA_PREPARE_AUX2 5 /** @} */ /** -- cgit v1.2.3