xf86-video-intel: 2 commits - src/i965_render.c uxa/uxa-render.c

Chris Wilson ickle at kemper.freedesktop.org
Tue May 11 05:09:43 PDT 2010


 src/i965_render.c |   20 ++++++++--
 uxa/uxa-render.c  |  106 +++++++++++++++++++++++++++++-------------------------
 2 files changed, 73 insertions(+), 53 deletions(-)

New commits:
commit f1048e14d5ef34970cb717e2a37d1c6bb4ea3a34
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue May 11 11:39:46 2010 +0100

    i965: Add texformats mapping for additional pixman formats
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index c38bbfc..7355ed1 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -108,13 +108,19 @@ static struct blendinfo i965_blend_op[] = {
  * 1.7.2
  */
 static struct formatinfo i965_tex_formats[] = {
+	{PICT_a8, BRW_SURFACEFORMAT_A8_UNORM},
 	{PICT_a8r8g8b8, BRW_SURFACEFORMAT_B8G8R8A8_UNORM},
 	{PICT_x8r8g8b8, BRW_SURFACEFORMAT_B8G8R8X8_UNORM},
 	{PICT_a8b8g8r8, BRW_SURFACEFORMAT_R8G8B8A8_UNORM},
 	{PICT_x8b8g8r8, BRW_SURFACEFORMAT_R8G8B8X8_UNORM},
+	{PICT_r8g8b8, BRW_SURFACEFORMAT_R8G8B8_UNORM},
 	{PICT_r5g6b5, BRW_SURFACEFORMAT_B5G6R5_UNORM},
 	{PICT_a1r5g5b5, BRW_SURFACEFORMAT_B5G5R5A1_UNORM},
-	{PICT_a8, BRW_SURFACEFORMAT_A8_UNORM},
+	{PICT_a2r10g10b10, BRW_SURFACEFORMAT_B10G10R10A2_UNORM},
+	{PICT_x2r10g10b10, BRW_SURFACEFORMAT_B10G10R10X2_UNORM},
+	{PICT_a2b10g10r10, BRW_SURFACEFORMAT_R10G10B10A2_UNORM},
+	{PICT_x2r10g10b10, BRW_SURFACEFORMAT_B10G10R10X2_UNORM},
+	{PICT_a4r4g4b4, BRW_SURFACEFORMAT_B4G4R4A4_UNORM},
 };
 
 static void i965_get_blend_cntl(int op, PicturePtr mask, uint32_t dst_format,
@@ -158,15 +164,21 @@ static Bool i965_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 	case PICT_x8r8g8b8:
 		*dst_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
 		break;
+	case PICT_a8b8g8r8:
+	case PICT_x8b8g8r8:
+		*dst_format = BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
+		break;
+	case PICT_a2r10g10b10:
+	case PICT_x2r10g10b10:
+		*dst_format = BRW_SURFACEFORMAT_B10G10R10A2_UNORM;
+		break;
 	case PICT_r5g6b5:
 		*dst_format = BRW_SURFACEFORMAT_B5G6R5_UNORM;
 		break;
+	case PICT_x1r5g5b5:
 	case PICT_a1r5g5b5:
 		*dst_format = BRW_SURFACEFORMAT_B5G5R5A1_UNORM;
 		break;
-	case PICT_x1r5g5b5:
-		*dst_format = BRW_SURFACEFORMAT_B5G5R5X1_UNORM;
-		break;
 	case PICT_a8:
 		*dst_format = BRW_SURFACEFORMAT_A8_UNORM;
 		break;
commit a35afd4a2df8bab543700d874274228eddccae5b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue May 11 11:26:33 2010 +0100

    uxa: Recheck texture after acquiring pattern.
    
    As the first step to handling unsupported texture formats, double check
    that the converted pattern can be used as a texture by the card.
    
    Fixes: rendercheck -t repeat
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index e0581b0..2086ae5 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -605,16 +605,13 @@ transform_is_integer_translation(PictTransformPtr t, int *tx, int *ty)
 static PicturePtr
 uxa_render_picture(ScreenPtr screen,
 		   PicturePtr src,
+		   pixman_format_code_t format,
 		   INT16 x, INT16 y,
 		   CARD16 width, CARD16 height)
 {
 	PicturePtr picture;
-	pixman_format_code_t format;
 	int ret = 0;
 
-	format = src->format |
-		(BitsPerPixel(src->pDrawable->depth) << 24);
-
 	picture = uxa_picture_for_pixman_format(screen, format, width, height);
 	if (!picture)
 		return 0;
@@ -653,7 +650,10 @@ uxa_acquire_drawable(ScreenPtr pScreen,
 	depth = pSrc->pDrawable->depth;
 	if (depth == 1 || !transform_is_integer_translation(pSrc->transform, &tx, &ty)) {
 		/* XXX extract the sample extents and do the transformation on the GPU */
-		pDst = uxa_render_picture(pScreen, pSrc, x, y, width, height);
+		pDst = uxa_render_picture(pScreen, pSrc,
+					  pSrc->format | (BitsPerPixel(pSrc->pDrawable->depth) << 24),
+					  x, y, width, height);
+
 		goto done;
 	} else {
 		if (width == pSrc->pDrawable->width && height == pSrc->pDrawable->depth) {
@@ -698,67 +698,75 @@ done:
 }
 
 static PicturePtr
-uxa_acquire_source(ScreenPtr pScreen,
-		   PicturePtr pPict,
-		   INT16 x, INT16 y,
-		   CARD16 width, CARD16 height,
-		   INT16 * out_x, INT16 * out_y)
+uxa_acquire_picture(ScreenPtr screen,
+		    PicturePtr src,
+		    pixman_format_code_t format,
+		    INT16 x, INT16 y,
+		    CARD16 width, CARD16 height,
+		    INT16 * out_x, INT16 * out_y)
 {
-	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
+	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
 	if (uxa_screen->info->check_composite_texture &&
-	    uxa_screen->info->check_composite_texture(pScreen, pPict)) {
-		if (pPict->pDrawable) {
-			*out_x = x + pPict->pDrawable->x;
-			*out_y = y + pPict->pDrawable->y;
+	    uxa_screen->info->check_composite_texture(screen, src)) {
+		if (src->pDrawable) {
+			*out_x = x + src->pDrawable->x;
+			*out_y = y + src->pDrawable->y;
 		} else {
 			*out_x = x;
 			*out_y = y;
 		}
-		return pPict;
+		return src;
 	}
 
-	if (pPict->pDrawable)
-		return uxa_acquire_drawable(pScreen, pPict,
-					    x, y, width, height,
-					    out_x, out_y);
+	if (src->pDrawable) {
+		PicturePtr dst;
+
+		dst = uxa_acquire_drawable(screen, src,
+					   x, y, width, height,
+					   out_x, out_y);
+		if (uxa_screen->info->check_composite_texture &&
+		    !uxa_screen->info->check_composite_texture(screen, dst)) {
+			if (dst != src)
+				FreePicture(dst, 0);
+			return 0;
+		}
+
+		return dst;
+	}
+
+	*out_x = x;
+	*out_y = y;
+	return uxa_acquire_pattern(screen, src,
+				   format, x, y, width, height);
+}
 
-	*out_x = 0;
-	*out_y = 0;
-	return uxa_acquire_pattern(pScreen, pPict,
-				   PICT_a8r8g8b8, x, y, width, height);
+static PicturePtr
+uxa_acquire_source(ScreenPtr screen,
+		   PicturePtr pict,
+		   INT16 x, INT16 y,
+		   CARD16 width, CARD16 height,
+		   INT16 * out_x, INT16 * out_y)
+{
+	return uxa_acquire_picture (screen, pict,
+				    PICT_a8r8g8b8,
+				    x, y,
+				    width, height,
+				    out_x, out_y);
 }
 
 static PicturePtr
-uxa_acquire_mask(ScreenPtr pScreen,
-		 PicturePtr pPict,
+uxa_acquire_mask(ScreenPtr screen,
+		 PicturePtr pict,
 		 INT16 x, INT16 y,
 		 INT16 width, INT16 height,
 		 INT16 * out_x, INT16 * out_y)
 {
-	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
-
-	if (uxa_screen->info->check_composite_texture &&
-	    uxa_screen->info->check_composite_texture(pScreen, pPict)) {
-		if (pPict->pDrawable) {
-			*out_x = x + pPict->pDrawable->x;
-			*out_y = y + pPict->pDrawable->y;
-		} else {
-			*out_x = x;
-			*out_y = y;
-		}
-		return pPict;
-	}
-
-	if (pPict->pDrawable)
-		return uxa_acquire_drawable(pScreen, pPict,
-					    x, y, width, height,
-					    out_x, out_y);
-
-	*out_x = 0;
-	*out_y = 0;
-	return uxa_acquire_pattern(pScreen, pPict,
-				   PICT_a8, x, y, width, height);
+	return uxa_acquire_picture (screen, pict,
+				    PICT_a8,
+				    x, y,
+				    width, height,
+				    out_x, out_y);
 }
 
 static int


More information about the xorg-commit mailing list