[Intel-gfx] [PATCH 2/2] uxa: Tell the driver when we're just going to immediately map the pixmap.

Eric Anholt eric at anholt.net
Fri Jul 10 09:07:48 CEST 2009


This lets the driver allocate a nice idle buffer object instead of a
busy one, reducing runtime of firefox-20090601 on my G45 from 50.7 (+/- .41%)
to 48.4 (+/- 1.1%).
---
 src/i830_uxa.c   |    5 ++++-
 uxa/uxa-render.c |    3 ++-
 uxa/uxa.h        |   10 ++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index f423805..7ec8333 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -645,7 +645,10 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
 	    return NullPixmap;
 	}
 
-	bo = drm_intel_bo_alloc_for_render(i830->bufmgr, "pixmap", size, 0);
+	if (usage == UXA_CREATE_PIXMAP_FOR_MAP)
+	    bo = drm_intel_bo_alloc(i830->bufmgr, "pixmap", size, 0);
+	else
+	    bo = drm_intel_bo_alloc_for_render(i830->bufmgr, "pixmap", size, 0);
 	if (!bo) {
 	    fbDestroyPixmap (pixmap);
 	    return NullPixmap;
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 02373b0..13128ed 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -822,7 +822,8 @@ uxa_create_alpha_picture (ScreenPtr     pScreen,
     }
 
     pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
-					pPictFormat->depth, 0);
+					pPictFormat->depth,
+					UXA_CREATE_PIXMAP_FOR_MAP);
     if (!pPixmap)
 	return 0;
     pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
diff --git a/uxa/uxa.h b/uxa/uxa.h
index 8f6f896..d5f5b9c 100644
--- a/uxa/uxa.h
+++ b/uxa/uxa.h
@@ -505,6 +505,16 @@ typedef struct _UxaDriver {
 
 /** @} */
 
+/** @name UXA CreatePixmap hint flags
+ * @{
+ */
+/**
+ * Flag to hint that the first operation on the pixmap will be a
+ * prepare_access.
+ */
+#define UXA_CREATE_PIXMAP_FOR_MAP	0x20000000
+/** @} */
+
 uxa_driver_t *
 uxa_driver_alloc(void);
 
-- 
1.6.3.3




More information about the Intel-gfx mailing list