From 6b6cc4b039399c19ec0d12579ba51031ebfd695e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 21 Dec 2012 12:04:41 +0000 Subject: [PATCH] uxa: Flush around glyph updates Attempt to w/a some or other bug in the gen3 glyph drawing routines. --- src/intel_uxa.c | 7 +++++++ uxa/uxa-glyphs.c | 4 ++++ uxa/uxa-priv.h | 2 ++ uxa/uxa.c | 7 +++++++ uxa/uxa.h | 2 ++ 5 files changed, 22 insertions(+) diff --git a/src/intel_uxa.c b/src/intel_uxa.c index f5ac0a6..4937314 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -684,6 +684,11 @@ static Bool intel_uxa_pixmap_is_offscreen(PixmapPtr pixmap) return intel_pixmap_is_offscreen(pixmap); } +static void intel_uxa_flush(ScreenPtr pScreen) +{ + intel_batch_submit(xf86ScreenToScrn(pixmap->drawable.pScreen)); +} + static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access) { ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); @@ -1336,6 +1341,8 @@ Bool intel_uxa_init(ScreenPtr screen) intel->surface_used = 0; intel->surface_reloc = 0; + intel->uxa_driver->flush = intel_uxa_flush; + /* Solid fill */ intel->uxa_driver->check_solid = intel_uxa_check_solid; intel->uxa_driver->prepare_solid = intel_uxa_prepare_solid; diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index f5d4d08..fea9f80 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -246,6 +246,8 @@ uxa_glyph_cache_upload_glyph(ScreenPtr screen, PixmapPtr scratch; GCPtr gc; + uxa_flush(screen); + gc = GetScratchGC(pCachePixmap->drawable.depth, screen); if (!gc) return; @@ -303,6 +305,8 @@ uxa_glyph_cache_upload_glyph(ScreenPtr screen, screen->DestroyPixmap(scratch); FreeScratchGC(gc); + + uxa_flush(screen); } void diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h index 3f639e7..ecc1830 100644 --- a/uxa/uxa-priv.h +++ b/uxa/uxa-priv.h @@ -190,6 +190,8 @@ typedef struct { */ void exaDDXDriverInit(ScreenPtr pScreen); +void uxa_flush(ScreenPtr pScreen); + Bool uxa_prepare_access_window(WindowPtr pWin); void uxa_finish_access_window(WindowPtr pWin); diff --git a/uxa/uxa.c b/uxa/uxa.c index 2635b50..eb15d4b 100644 --- a/uxa/uxa.c +++ b/uxa/uxa.c @@ -135,6 +135,13 @@ PixmapPtr uxa_get_offscreen_pixmap(DrawablePtr drawable, int *xp, int *yp) return NULL; } +void uxa_flush(ScreenPtr pScreen) +{ + uxa_screen_t *uxa_screen = uxa_get_screen(pScreen); + if (uxa_screen->info->flush) + (*uxa_screen->info->flush) (pScreen); +} + /** * uxa_prepare_access() is UXA's wrapper for the driver's PrepareAccess() handler. * diff --git a/uxa/uxa.h b/uxa/uxa.h index b8569f0..296a535 100644 --- a/uxa/uxa.h +++ b/uxa/uxa.h @@ -75,6 +75,8 @@ typedef struct _UxaDriver { /** @name solid * @{ */ + void (*flush) (ScreenPtr pScreen); + /** * check_solid() checks whether the driver can do a solid fill to this drawable. * @param pDrawable Destination drawable -- 1.7.10.4