diff options
author | marha <marha@users.sourceforge.net> | 2009-10-21 21:22:47 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-21 21:22:47 +0000 |
commit | e141b55eccf3c69d8ced513992e21463d37dbb03 (patch) | |
tree | eaeeeda04d5b6ce82d43d04466164b44a74d0951 /xorg-server/exa | |
parent | d0fe50e45b3a640afa51eb8f45cf7c3a0df0740b (diff) | |
parent | 1f876171067c04fc21fccd5a3051f982fd85c0f0 (diff) | |
download | vcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.tar.gz vcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.tar.bz2 vcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.zip |
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/exa')
-rw-r--r-- | xorg-server/exa/Makefile.in | 15 | ||||
-rw-r--r-- | xorg-server/exa/exa.c | 14 | ||||
-rw-r--r-- | xorg-server/exa/exa_glyphs.c | 89 | ||||
-rw-r--r-- | xorg-server/exa/exa_migration_mixed.c | 20 | ||||
-rw-r--r-- | xorg-server/exa/exa_mixed.c | 3 | ||||
-rw-r--r-- | xorg-server/exa/exa_priv.h | 1 |
6 files changed, 84 insertions, 58 deletions
diff --git a/xorg-server/exa/Makefile.in b/xorg-server/exa/Makefile.in index bc0a6c903..ac8351121 100644 --- a/xorg-server/exa/Makefile.in +++ b/xorg-server/exa/Makefile.in @@ -43,7 +43,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -123,7 +123,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ @@ -148,7 +147,6 @@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -172,6 +170,7 @@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOLT_BASH = @DOLT_BASH@ +DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -189,8 +188,6 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ @@ -236,7 +233,6 @@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ -MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ @@ -262,6 +258,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -271,7 +268,6 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ -Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -288,7 +284,6 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ WINDRES = @WINDRES@ @@ -330,8 +325,6 @@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ -XSDL_INCS = @XSDL_INCS@ -XSDL_LIBS = @XSDL_LIBS@ XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ @@ -374,6 +367,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -405,7 +399,6 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ -shavedir = @shavedir@ srcdir = @srcdir@ symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ diff --git a/xorg-server/exa/exa.c b/xorg-server/exa/exa.c index e264d440c..46e91820b 100644 --- a/xorg-server/exa/exa.c +++ b/xorg-server/exa/exa.c @@ -774,10 +774,18 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, ScreenPtr pScreen = screenInfo.screens[screenNum]; ExaScreenPriv(pScreen); + /* Move any deferred results from a software fallback to the driver pixmap */ + if (pExaScr->deferred_mixed_pixmap) + exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); + unwrap(pExaScr, pScreen, BlockHandler); (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); + /* The rest only applies to classic EXA */ + if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) + return; + /* Try and keep the offscreen memory area tidy every now and then (at most * once per second) when the server has been idle for at least 100ms. */ @@ -991,10 +999,12 @@ exaDriverInit (ScreenPtr pScreen, * Replace various fb screen functions */ if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) && - !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) { + (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) || + (pExaScr->info->flags & EXA_MIXED_PIXMAPS))) wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); + if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) && + !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); - } wrap(pExaScr, pScreen, CreateGC, exaCreateGC); wrap(pExaScr, pScreen, CloseScreen, exaCloseScreen); wrap(pExaScr, pScreen, GetImage, exaGetImage); diff --git a/xorg-server/exa/exa_glyphs.c b/xorg-server/exa/exa_glyphs.c index bf097c32f..5a370047e 100644 --- a/xorg-server/exa/exa_glyphs.c +++ b/xorg-server/exa/exa_glyphs.c @@ -62,15 +62,10 @@ */ #define CACHE_PICTURE_WIDTH 1024 -/* Maximum number of glyphs we buffer on the stack before flushing - * rendering to the mask or destination surface. - */ -#define GLYPH_BUFFER_SIZE 256 - typedef struct { PicturePtr mask; - ExaCompositeRectRec rects[GLYPH_BUFFER_SIZE]; int count; + ExaCompositeRectRec rects[0]; } ExaGlyphBuffer, *ExaGlyphBufferPtr; typedef enum { @@ -364,7 +359,8 @@ exaGlyphCacheHashRemove(ExaGlyphCachePtr cache, static void exaGlyphCacheUploadGlyph(ScreenPtr pScreen, ExaGlyphCachePtr cache, - int pos, + int x, + int y, GlyphPtr pGlyph) { ExaScreenPriv(pScreen); @@ -399,10 +395,10 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen, if (!exaPixmapIsOffscreen(pCachePixmap)) goto composite; - /* CACHE_{X,Y} are in pixmap coordinates, no need for cache{X,Y}off */ + /* x,y are in pixmap coordinates, no need for cache{X,Y}off */ if (pExaScr->info->UploadToScreen(pCachePixmap, - CACHE_X(pos), - CACHE_Y(pos), + x, + y, pGlyph->info.width, pGlyph->info.height, (char *)pExaPixmap->sys_ptr, @@ -416,18 +412,18 @@ composite: cache->picture, 0, 0, 0, 0, - CACHE_X(pos), - CACHE_Y(pos), + x, + y, pGlyph->info.width, pGlyph->info.height); damage: /* The cache pixmap isn't a window, so no need to offset coordinates. */ exaPixmapDirty (pCachePixmap, - CACHE_X(pos), - CACHE_Y(pos), - CACHE_X(pos) + cache->glyphWidth, - CACHE_Y(pos) + cache->glyphHeight); + x, + y, + x + cache->glyphWidth, + y + cache->glyphHeight); } static ExaGlyphCacheResult @@ -446,6 +442,7 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, { ExaCompositeRectPtr rect; int pos; + int x, y; if (buffer->mask && buffer->mask != cache->picture) return ExaGlyphNeedFlush; @@ -462,10 +459,14 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, pos = exaGlyphCacheHashLookup(cache, pGlyph); if (pos != -1) { DBG_GLYPH_CACHE((" found existing glyph at %d\n", pos)); + x = CACHE_X(pos); + y = CACHE_Y(pos); } else { if (cache->glyphCount < cache->size) { /* Space remaining; we fill from the start */ pos = cache->glyphCount; + x = CACHE_X(pos); + y = CACHE_Y(pos); cache->glyphCount++; DBG_GLYPH_CACHE((" storing glyph in free space at %d\n", pos)); @@ -477,14 +478,12 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, * the cache */ pos = cache->evictionPosition; + x = CACHE_X(pos); + y = CACHE_Y(pos); DBG_GLYPH_CACHE((" evicting glyph at %d\n", pos)); if (buffer->count) { - int x, y; int i; - x = CACHE_X(pos); - y = CACHE_Y(pos); - for (i = 0; i < buffer->count; i++) { if (pSrc ? (buffer->rects[i].xMask == x && buffer->rects[i].yMask == y) : @@ -503,7 +502,7 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, cache->evictionPosition = rand() % cache->size; } - exaGlyphCacheUploadGlyph(pScreen, cache, pos, pGlyph); + exaGlyphCacheUploadGlyph(pScreen, cache, x, y, pGlyph); } buffer->mask = cache->picture; @@ -514,13 +513,13 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, { rect->xSrc = xSrc; rect->ySrc = ySrc; - rect->xMask = CACHE_X(pos); - rect->yMask = CACHE_Y(pos); + rect->xMask = x; + rect->yMask = y; } else { - rect->xSrc = CACHE_X(pos); - rect->ySrc = CACHE_Y(pos); + rect->xSrc = x; + rect->ySrc = y; rect->xMask = 0; rect->yMask = 0; } @@ -553,16 +552,13 @@ exaBufferGlyph(ScreenPtr pScreen, INT16 yDst) { ExaScreenPriv(pScreen); - unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format; + PicturePtr mask = GlyphPicture(pGlyph)[pScreen->myNum]; + unsigned int format = mask->format; int width = pGlyph->info.width; int height = pGlyph->info.height; ExaCompositeRectPtr rect; - PicturePtr mask; int i; - if (buffer->count == GLYPH_BUFFER_SIZE) - return ExaGlyphNeedFlush; - if (PICT_FORMAT_BPP(format) == 1) format = PICT_a8; @@ -593,7 +589,6 @@ exaBufferGlyph(ScreenPtr pScreen, /* Couldn't find the glyph in the cache, use the glyph picture directly */ - mask = GlyphPicture(pGlyph)[pScreen->myNum]; if (buffer->mask && buffer->mask != mask) return ExaGlyphNeedFlush; @@ -707,12 +702,18 @@ exaGlyphs (CARD8 op, int width = 0, height = 0; int x, y; int first_xOff = list->xOff, first_yOff = list->yOff; - int n; + int i, n; GlyphPtr glyph; int error; BoxRec extents = {0, 0, 0, 0}; CARD32 component_alpha; - ExaGlyphBuffer buffer; + ExaGlyphBufferPtr buffer; + + for (i = 0, n = 0; i < nlist; i++) + n += list[i].len; + buffer = alloca(sizeof(ExaGlyphBuffer) + n * sizeof(ExaCompositeRectRec)); + if (!buffer) + return; if (maskFormat) { @@ -792,8 +793,8 @@ exaGlyphs (CARD8 op, x = 0; y = 0; } - buffer.count = 0; - buffer.mask = NULL; + buffer->count = 0; + buffer->mask = NULL; while (nlist--) { x += list->xOff; @@ -808,23 +809,23 @@ exaGlyphs (CARD8 op, /* pGlyph->info.{x,y} compensate for empty space in the glyph. */ if (maskFormat) { - if (exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, + if (exaBufferGlyph(pScreen, buffer, glyph, NULL, pMask, 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { - exaGlyphsToMask(pMask, &buffer); - exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, + exaGlyphsToMask(pMask, buffer); + exaBufferGlyph(pScreen, buffer, glyph, NULL, pMask, 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y); } } else { - if (exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, + if (exaBufferGlyph(pScreen, buffer, glyph, pSrc, pDst, xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { - exaGlyphsToDst(pSrc, pDst, &buffer); - exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, + exaGlyphsToDst(pSrc, pDst, buffer); + exaBufferGlyph(pScreen, buffer, glyph, pSrc, pDst, xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, 0, 0, x - glyph->info.x, y - glyph->info.y); } @@ -837,11 +838,11 @@ exaGlyphs (CARD8 op, list++; } - if (buffer.count) { + if (buffer->count) { if (maskFormat) - exaGlyphsToMask(pMask, &buffer); + exaGlyphsToMask(pMask, buffer); else - exaGlyphsToDst(pSrc, pDst, &buffer); + exaGlyphsToDst(pSrc, pDst, buffer); } if (maskFormat) diff --git a/xorg-server/exa/exa_migration_mixed.c b/xorg-server/exa/exa_migration_mixed.c index f42c9c233..6065d7577 100644 --- a/xorg-server/exa/exa_migration_mixed.c +++ b/xorg-server/exa/exa_migration_mixed.c @@ -99,8 +99,13 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) exaCreateDriverPixmap_mixed(pPixmap); if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) { + ExaScreenPriv(pPixmap->drawable.pScreen); + pPixmap->devKind = pExaPixmap->fb_pitch; exaCopyDirtyToFb(pixmaps + i); + + if (pExaScr->deferred_mixed_pixmap == pPixmap) + pExaScr->deferred_mixed_pixmap = NULL; } pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap); @@ -197,6 +202,9 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) /* Move back results of software rendering on system memory copy of mixed driver * pixmap (see exaPrepareAccessReg_mixed). + * + * Defer moving the destination back into the driver pixmap, to try and save + * overhead on multiple consequent software fallbacks. */ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index) { @@ -204,6 +212,16 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index) if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) { DamageRegionProcessPending(&pPixmap->drawable); - exaMoveInPixmap_mixed(pPixmap); + + if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) { + ExaScreenPriv(pPixmap->drawable.pScreen); + + if (pExaScr->deferred_mixed_pixmap && + pExaScr->deferred_mixed_pixmap != pPixmap) + exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); + pExaScr->deferred_mixed_pixmap = pPixmap; + pPixmap->devKind = pExaPixmap->fb_pitch; + } else + exaMoveInPixmap_mixed(pPixmap); } } diff --git a/xorg-server/exa/exa_mixed.c b/xorg-server/exa/exa_mixed.c index 167ffa9d5..bc393c772 100644 --- a/xorg-server/exa/exa_mixed.c +++ b/xorg-server/exa/exa_mixed.c @@ -192,6 +192,9 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap) { ExaPixmapPriv (pPixmap); + if (pExaScr->deferred_mixed_pixmap == pPixmap) + pExaScr->deferred_mixed_pixmap = NULL; + if (pExaPixmap->driverPriv) pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv); pExaPixmap->driverPriv = NULL; diff --git a/xorg-server/exa/exa_priv.h b/xorg-server/exa/exa_priv.h index 1aec8e966..5b056dab9 100644 --- a/xorg-server/exa/exa_priv.h +++ b/xorg-server/exa/exa_priv.h @@ -188,6 +188,7 @@ typedef struct { unsigned numOffscreenAvailable; CARD32 lastDefragment; CARD32 nextDefragment; + PixmapPtr deferred_mixed_pixmap; /* Reference counting for accessed pixmaps */ struct { |