From 744aa34ca5228ea176cc56a7bdd48bbf5f29b0b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 15 Oct 2005 02:19:09 +0000 Subject: Add an additional meaning to the "dirty" flag. Now, if !dirty && !area, the pixmaps's contents are undefined, so we won't need to upload the undefined contents in MoveIn. Use the ExaCheck* for async ops as well, so that dirty is always tracked. While the performance impact for my ls -lR test was not significant (though the avoiding-upload path was being hit), it's likely to be important for the upcoming Get/PutImage acceleration from ajax. --- hw/xfree86/exa/exa_accel.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hw/xfree86/exa/exa_accel.c') diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c index 2b9dc63dd..c8e57e440 100644 --- a/hw/xfree86/exa/exa_accel.c +++ b/hw/xfree86/exa/exa_accel.c @@ -159,6 +159,10 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) pPixmap->devPrivate.ptr = dst; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pExaPixmap->area = NULL; + /* Mark it dirty now, to say that there is important data in the + * system-memory copy. + */ + pExaPixmap->dirty = TRUE; } static int @@ -238,6 +242,16 @@ exaMoveInPixmap (PixmapPtr pPixmap) return; } + /* If the "dirty" flag has never been set on the in-memory pixmap, then + * nothing has been written to it, so the contents are undefined and we can + * avoid the upload. + */ + if (!pExaPixmap->dirty) { + DBG_MIGRATE(("saved upload of %dx%d\n", pPixmap->drawable.width, + pPixmap->drawable.height)); + return; + } + pExaPixmap->dirty = FALSE; if (pExaScr->info->accel.UploadToScreen) -- cgit v1.2.3