From: zhigang.gong@linux.intel.com Subject: [PATCH 3/4] uxa/glamor: Let glamor do the GC validation. Date: Tue, 27 Dec 2011 17:09:17 +0800 Message-ID: <1324976958-31411-4-git-send-email-zhigang.gong@linux.intel.com> References: <1324976958-31411-1-git-send-email-zhigang.gong@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id E22089E814 for ; Tue, 27 Dec 2011 01:23:44 -0800 (PST) In-Reply-To: <1324976958-31411-1-git-send-email-zhigang.gong@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: chris@chris-wilson.co.uk Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Zhigang Gong If we are using GLAMOR, then a tile pixmap or stipple pixmap may be pure glamor pixmap and thus UXA doesn't know how to render to them, we should let glamor to do the validation. Signed-off-by: Zhigang Gong --- uxa/uxa-glamor.h | 1 + uxa/uxa.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/uxa/uxa-glamor.h b/uxa/uxa-glamor.h index 71a9c29..2b4b452 100644 --- a/uxa/uxa-glamor.h +++ b/uxa/uxa-glamor.h @@ -51,6 +51,7 @@ #define glamor_trapezoids_nf(...) FALSE #define glamor_triangles_nf(...) FALSE #define glamor_add_traps_nf(...) FALSE +#define glamor_create_gc(...) FALSE #endif #endif /* UXA_GLAMOR_H */ diff --git a/uxa/uxa.c b/uxa/uxa.c index 5b3d709..56bc233 100644 --- a/uxa/uxa.c +++ b/uxa/uxa.c @@ -38,6 +38,7 @@ #include #include "dixfontstr.h" #include "uxa.h" +#include "uxa-glamor.h" #if HAS_DEVPRIVATEKEYREC DevPrivateKeyRec uxa_screen_index; @@ -183,11 +184,21 @@ void uxa_finish_access(DrawablePtr pDrawable, uxa_access_t access) static void uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { + uxa_screen_t *uxa_screen = uxa_get_screen(pGC->pScreen); /* fbValidateGC will do direct access to pixmaps if the tiling has * changed. * Preempt fbValidateGC by doing its work and masking the change out, so * that we can do the Prepare/finish_access. */ + + /* If we are using GLAMOR, then the tile or stipple pixmap + * may be pure GLAMOR pixmap, then we should let the glamor + * to do the validation. + */ + if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + glamor_validate_gc(pGC, changes, pDrawable); + goto set_ops; + } #ifdef FB_24_32BIT if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) { (*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC)); @@ -256,6 +267,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) fbValidateGC(pGC, changes, pDrawable); } +set_ops: pGC->ops = (GCOps *) & uxa_ops; } -- 1.7.4.4