xf86-video-intel: src/i830_driver.c src/i830_exa.c src/i830.h uxa/uxa-glyphs.c

Keith Packard keithp at kemper.freedesktop.org
Fri Mar 13 15:03:46 PDT 2009


 src/i830.h        |    1 +
 src/i830_driver.c |    5 +++++
 src/i830_exa.c    |    5 +++++
 uxa/uxa-glyphs.c  |   36 ++++++++++--------------------------
 4 files changed, 21 insertions(+), 26 deletions(-)

New commits:
commit fe08b81d0f5d6f96e0124e6286bd24aba6e140ad
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Mar 2 07:39:41 2009 -0800

    Use CopyArea to load glyphs from per-glyph pixmap to cache pixmap
    
    With glyphs sitting in per-glyph pixmaps, there's no reason to use the CPU
    to move them to the cache pixmap, and lots of reasons to use the accelerator.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830.h b/src/i830.h
index f933917..b145edb 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -77,6 +77,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i915_drm.h"
 
 #ifdef I830_USE_EXA
+#define EXA_DRIVER_KNOWN_MAJOR 3
 #include "exa.h"
 Bool I830EXAInit(ScreenPtr pScreen);
 unsigned long long I830TexOffsetStart(PixmapPtr pPix);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index c19fcc6..f104c5f 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1939,12 +1939,17 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
       int errmaj, errmin;
 
       memset(&req, 0, sizeof(req));
+#if EXA_VERSION_MAJOR == 3
+      req.majorversion = 3;
+      req.minorversion = 0;
+#else
       req.majorversion = 2;
 #if EXA_VERSION_MINOR >= 2
       req.minorversion = 2;
 #else
       req.minorversion = 1;
 #endif
+#endif
       if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &req,
 		&errmaj, &errmin)) {
 	 LoaderErrorMsg(NULL, "exa", errmaj, errmin);
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 0a22486..18d8cde 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -675,6 +675,10 @@ I830EXAInit(ScreenPtr pScreen)
     memset(pI830->EXADriverPtr, 0, sizeof(*pI830->EXADriverPtr));
 
     pI830->bufferOffset = 0;
+#if EXA_VERSION_MAJOR > 2
+    pI830->EXADriverPtr->exa_major = 3;
+    pI830->EXADriverPtr->exa_minor = 0;
+#else
     pI830->EXADriverPtr->exa_major = 2;
     /* If compiled against EXA 2.2, require 2.2 so we can use the
      * PixmapIsOffscreen hook.
@@ -687,6 +691,7 @@ I830EXAInit(ScreenPtr pScreen)
 	       "EXA compatibility mode.  Output rotation rendering "
 	       "performance may suffer\n");
 #endif
+#endif
     if (!pI830->use_drm_mode) {
 	pI830->EXADriverPtr->memoryBase = pI830->FbBase;
 	if (pI830->exa_offscreen) {
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 5abd001..3cb03f5 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -353,9 +353,7 @@ uxa_glyph_cache_hash_remove(uxa_glyph_cache_t *cache,
 #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight)
 
 /* The most efficient thing to way to upload the glyph to the screen
- * is to use the UploadToScreen() driver hook; this allows us to
- * pipeline glyph uploads and to avoid creating offscreen pixmaps for
- * glyphs that we'll never use again.
+ * is to use CopyArea; uxa pixmaps are always offscreen.
  */
 static Bool
 uxa_glyph_cache_upload_glyph(ScreenPtr		    pScreen,
@@ -363,37 +361,23 @@ uxa_glyph_cache_upload_glyph(ScreenPtr		    pScreen,
 			     int		    pos,
 			     GlyphPtr		    pGlyph)
 {
-    uxa_screen_t    *uxa_screen = uxa_get_screen(pScreen);
     PicturePtr	    pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum];
     PixmapPtr	    pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable;
     PixmapPtr	    pCachePixmap = (PixmapPtr)cache->picture->pDrawable;
-    int		    cacheXoff, cacheYoff;
-
-    if (!uxa_screen->info->put_image || uxa_screen->swappedOut)
-	return FALSE;
-
-    /* If the glyph pixmap is already uploaded, no point in doing
-     * things this way */
-    if (uxa_pixmap_is_offscreen(pGlyphPixmap))
-	return FALSE;
+    GCPtr	    pGC;
 
     /* UploadToScreen only works if bpp match */
     if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel)
 	return FALSE;
 
-    pCachePixmap = uxa_get_offscreen_pixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff);
-    if (!pCachePixmap)
-	return FALSE;
-
-    if (!uxa_screen->info->put_image(pCachePixmap,
-				     CACHE_X(pos) + cacheXoff,
-				     CACHE_Y(pos) + cacheYoff,
-				     pGlyph->info.width,
-				     pGlyph->info.height,
-				     (char *)pGlyphPixmap->devPrivate.ptr,
-				     pGlyphPixmap->devKind))
-	return FALSE;
-
+    pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen);
+    ValidateGC(&pCachePixmap->drawable, pGC);
+    (void) uxa_copy_area (&pGlyphPixmap->drawable,
+			  &pCachePixmap->drawable,
+			  pGC,
+			  0, 0, pGlyph->info.width, pGlyph->info.height,
+			  CACHE_X(pos), CACHE_Y(pos));
+    FreeScratchGC (pGC);
     return TRUE;
 }
 


More information about the xorg-commit mailing list