[Mesa-dev] [PATCH 1/2] r600g: fall back to blitter for compressed textures

alexdeucher at gmail.com alexdeucher at gmail.com
Fri Mar 15 12:27:26 PDT 2013


From: Alex Deucher <alexander.deucher at amd.com>

The hw can only access compressed textures as tiled not
linear so we need to do format tricks to handle them
properly.  The blitter code already handles this so
just fallback to the blitter for compressed textures.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=60802

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 src/gallium/drivers/r600/evergreen_state.c |    9 +++++++++
 src/gallium/drivers/r600/r600_state.c      |    9 +++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 2bdefb0..4387c86 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -3674,6 +3674,15 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
 		return FALSE;
 	}
 
+	/* HW can only handle tiled compressed textures.
+	 * Need to do format tricks in blitter code to handle them
+	 * properly so bail here and let the blitter code handle it.
+	 */
+	if (src_mode != dst_mode) {
+		if (util_format_is_compressed(src->format))
+			return FALSE;
+	}
+
 	if (src_mode == dst_mode) {
 		uint64_t dst_offset, src_offset;
 		/* simple dma blit would do NOTE code here assume :
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 846c159..8929d6e 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -3113,6 +3113,15 @@ boolean r600_dma_blit(struct pipe_context *ctx,
 		return FALSE;
 	}
 
+	/* HW can only handle tiled compressed textures.
+	 * Need to do format tricks in blitter code to handle them
+	 * properly so bail here and let the blitter code handle it.
+	 */
+	if (src_mode != dst_mode) {
+		if (util_format_is_compressed(src->format))
+			return FALSE;
+	}
+
 	if (src_mode == dst_mode) {
 		uint64_t dst_offset, src_offset, size;
 
-- 
1.7.7.5



More information about the mesa-dev mailing list