[Mesa-dev] [PATCH 1/2] radeonsi: add 2d tiling support for texture v2

j.glisse at gmail.com j.glisse at gmail.com
Fri Apr 5 14:36:54 PDT 2013


From: Jerome Glisse <jglisse at redhat.com>

v2: Remove left over code

Signed-off-by: Jerome Glisse <jglisse at redhat.com>
---
 src/gallium/drivers/radeonsi/r600_texture.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/r600_texture.c b/src/gallium/drivers/radeonsi/r600_texture.c
index 1b8382f..8992f9a 100644
--- a/src/gallium/drivers/radeonsi/r600_texture.c
+++ b/src/gallium/drivers/radeonsi/r600_texture.c
@@ -47,7 +47,6 @@ static void r600_copy_to_staging_texture(struct pipe_context *ctx, struct r600_t
 				&transfer->box);
 }
 
-
 /* Copy from a transfer's staging texture to a full GPU one. */
 static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer)
 {
@@ -152,12 +151,12 @@ static int r600_init_surface(struct r600_screen *rscreen,
 
 	if (!is_flushed_depth && is_depth) {
 		surface->flags |= RADEON_SURF_ZBUFFER;
-
 		if (is_stencil) {
 			surface->flags |= RADEON_SURF_SBUFFER |
 				RADEON_SURF_HAS_SBUFFER_MIPTREE;
 		}
 	}
+	surface->flags |= RADEON_SURF_HAS_TILE_MODE_INDEX;
 	return 0;
 }
 
@@ -530,7 +529,11 @@ struct pipe_resource *si_texture_create(struct pipe_screen *screen,
 
 	if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
 	    !(templ->bind & PIPE_BIND_SCANOUT)) {
-		array_mode = V_009910_ARRAY_1D_TILED_THIN1;
+		if (util_format_is_compressed(templ->format)) {
+			array_mode = V_009910_ARRAY_1D_TILED_THIN1;
+		} else {
+			array_mode = V_009910_ARRAY_2D_TILED_THIN1;
+		}
 	}
 
 	r = r600_init_surface(rscreen, &surface, templ, array_mode,
@@ -620,6 +623,8 @@ struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
 	if (r) {
 		return NULL;
 	}
+	/* always set the scanout flags */
+	surface.flags |= RADEON_SURF_SCANOUT;
 	return (struct pipe_resource *)r600_texture_create_object(screen, templ, array_mode,
 								  stride, 0, buf, FALSE, &surface);
 }
-- 
1.8.1.4



More information about the mesa-dev mailing list