From d2245386eed200e77a8c84bdda36ab29e39fd593 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sun, 29 Apr 2007 23:48:31 +0200 Subject: EXA: GetImage improvements. Only migrate when appropriate. In particular, don't migrate to offscreen in the no-fallback case as copying from system memory should usually be as fast if not faster than DownloadFromScreen, in particular if the bits need to be uploaded to offscreen first. --- exa/exa_accel.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'exa') diff --git a/exa/exa_accel.c b/exa/exa_accel.c index dd02fef63..6a0fbb70f 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1330,27 +1330,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, int xoff, yoff; Bool ok; - if (pExaScr->swappedOut || pExaScr->info->DownloadFromScreen == NULL) - goto fallback; + if (pExaScr->info->DownloadFromScreen == NULL) + goto migrate_and_fallback; /* Only cover the ZPixmap, solid copy case. */ if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask)) - goto fallback; + goto migrate_and_fallback; /* Only try to handle the 8bpp and up cases, since we don't want to think * about <8bpp. */ if (pDrawable->bitsPerPixel < 8) + goto migrate_and_fallback; + + if (pExaScr->swappedOut) goto fallback; - /* Migrate, but assume that we could accelerate the download. It is up to - * the migration scheme to ensure that this case doesn't result in bad - * moving of pixmaps. - */ - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, TRUE); pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); if (pPix == NULL) goto fallback; @@ -1365,12 +1360,12 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, return; } -fallback: +migrate_and_fallback: pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); exaDoMigration (pixmaps, 1, FALSE); - +fallback: ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d); } -- cgit v1.2.3