[Intel-gfx] [PATCH] Have UXA tell us when it's rendering trapezoids so we don't use a GPU-hot BO.

Eric Anholt eric at anholt.net
Mon Apr 6 22:29:09 CEST 2009


This could avoid lock-stepping with the GPU for small trapezoids, but the tests
I have are all drowned out in the actual rasterization of traps.  If someone
else has a test that this actually helps, we could apply this code.
---
 src/i830_exa.c   |    6 +++++-
 uxa/uxa-render.c |    3 ++-
 uxa/uxa.h        |    3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/i830_exa.c b/src/i830_exa.c
index fc4e66c..a8ec539 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -972,7 +972,11 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
 	    size = i830_get_fence_size(i830, stride * h);
 	}
 
-	bo = drm_intel_bo_alloc_for_render(i830->bufmgr, "pixmap", size, 0);
+	if (usage == UXA_CREATE_PIXMAP_TRAPEZOIDS) {
+	    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 edbf0d8..8c0b589 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -820,7 +820,8 @@ uxa_create_alpha_picture (ScreenPtr     pScreen,
 
 #ifdef SERVER_1_5
     pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
-					pPictFormat->depth, 0);
+					pPictFormat->depth,
+					UXA_CREATE_PIXMAP_TRAPEZOIDS);
 #else
     pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
 					pPictFormat->depth);
diff --git a/uxa/uxa.h b/uxa/uxa.h
index 8f6f896..545045c 100644
--- a/uxa/uxa.h
+++ b/uxa/uxa.h
@@ -48,6 +48,9 @@ typedef enum {
 	UXA_ACCESS_RW
 } uxa_access_t;
 
+/* Using the hex value for 'U' as the top byte. */
+#define UXA_CREATE_PIXMAP_TRAPEZOIDS	0x55000000
+
 /**
  * The UxaDriver structure is allocated through uxa_driver_alloc(), and then
  * fllled in by drivers.
-- 
1.6.2.1




More information about the Intel-gfx mailing list