r600g: fix tex tile_type offset for cayman
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 10 Feb 2012 15:49:13 +0000 (10:49 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 10 Feb 2012 16:31:23 +0000 (11:31 -0500)
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Note: this is a candidate for the stable branches.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/evergreend.h

index dd67e4bf1d80542b1f5fb10db272837d38acd731..56a497b081bde9f8229dc5eda714658b14523430 100644 (file)
@@ -1190,8 +1190,11 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
 
        rstate->val[0] = (S_030000_DIM(r600_tex_dim(texture->target)) |
                          S_030000_PITCH((pitch / 8) - 1) |
-                         S_030000_NON_DISP_TILING_ORDER(tile_type) |
                          S_030000_TEX_WIDTH(width - 1));
+       if (rscreen->chip_class == CAYMAN)
+               rstate->val[0] |= CM_S_030000_NON_DISP_TILING_ORDER(tile_type);
+       else
+               rstate->val[0] |= S_030000_NON_DISP_TILING_ORDER(tile_type);
        rstate->val[1] = (S_030004_TEX_HEIGHT(height - 1) |
                          S_030004_TEX_DEPTH(depth - 1) |
                          S_030004_ARRAY_MODE(array_mode));
index 1d870760f619d71c706db3f31c4d786b08814552..d1dbd843a280e97acf699723931aeea1099eb280 100644 (file)
 #define   S_030000_NON_DISP_TILING_ORDER(x)            (((x) & 0x1) << 5)
 #define   G_030000_NON_DISP_TILING_ORDER(x)            (((x) >> 5) & 0x1)
 #define   C_030000_NON_DISP_TILING_ORDER               0xFFFFFFDF
+#define   CM_S_030000_NON_DISP_TILING_ORDER(x)         (((x) & 0x3) << 4)
+#define   CM_G_030000_NON_DISP_TILING_ORDER(x)         (((x) >> 4) & 0x3)
+#define   CM_C_030000_NON_DISP_TILING_ORDER            0xFFFFFFCF
 #define   S_030000_PITCH(x)                            (((x) & 0xFFF) << 6)
 #define   G_030000_PITCH(x)                            (((x) >> 6) & 0xFFF)
 #define   C_030000_PITCH                               0xFFFC003F