[Mesa-dev] [PATCH 3/3] r600g: Add support for PIPE_BIND_CURSOR

Benjamin Franzke benjaminfranzke at googlemail.com
Fri May 13 04:13:29 PDT 2011


---
If these checks are not sufficent see this as feature request. :)

---
 src/gallium/drivers/r600/r600_texture.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 7ffea69..2cf75be 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -86,7 +86,8 @@ unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
 
 static unsigned r600_get_block_alignment(struct pipe_screen *screen,
 					 enum pipe_format format,
-					 unsigned array_mode)
+					 unsigned array_mode,
+					 unsigned bind)
 {
 	struct r600_screen* rscreen = (struct r600_screen *)screen;
 	unsigned pixsize = util_format_get_blocksize(format);
@@ -107,7 +108,10 @@ static unsigned r600_get_block_alignment(struct pipe_screen *screen,
 		break;
 	case V_038000_ARRAY_LINEAR_GENERAL:
 	default:
-		p_align = rscreen->tiling_info->group_bytes / pixsize;
+		if (bind & PIPE_BIND_CURSOR)
+			p_align = 64;
+		else
+			p_align = rscreen->tiling_info->group_bytes / pixsize;
 		break;
 	}
 	return p_align;
@@ -141,7 +145,7 @@ static unsigned r600_get_base_alignment(struct pipe_screen *screen,
 {
 	struct r600_screen* rscreen = (struct r600_screen *)screen;
 	unsigned pixsize = util_format_get_blocksize(format);
-	int p_align = r600_get_block_alignment(screen, format, array_mode);
+	int p_align = r600_get_block_alignment(screen, format, array_mode, 0);
 	int h_align = r600_get_height_alignment(screen, array_mode);
 	int b_align;
 
@@ -184,7 +188,8 @@ static unsigned r600_texture_get_nblocksx(struct pipe_screen *screen,
 	nblocksx = util_format_get_nblocksx(ptex->format, width);
 
 	block_align = r600_get_block_alignment(screen, ptex->format,
-					      rtex->array_mode[level]);
+					       rtex->array_mode[level],
+					       ptex->bind);
 	nblocksx = align(nblocksx, block_align);
 	return nblocksx;
 }
@@ -222,7 +227,7 @@ static void r600_texture_set_array_mode(struct pipe_screen *screen,
 		unsigned w, h, tile_height, tile_width;
 
 		tile_height = r600_get_height_alignment(screen, array_mode);
-		tile_width = r600_get_block_alignment(screen, ptex->format, array_mode);
+		tile_width = r600_get_block_alignment(screen, ptex->format, array_mode, ptex->bind);
 
 		w = mip_minify(ptex->width0, level);
 		h = mip_minify(ptex->height0, level);
@@ -416,7 +421,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
 
 	if (force_tiling && permit_hardware_blit(screen, templ)) {
 		if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
-		    !(templ->bind & PIPE_BIND_SCANOUT)) {
+		    !(templ->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_CURSOR))) {
 			array_mode = V_038000_ARRAY_2D_TILED_THIN1;
 		}
 	}
-- 
1.7.3.4



More information about the mesa-dev mailing list