r600g: align the tiling modes with what the DDX and kernel expects.
authorDave Airlie <airlied@redhat.com>
Tue, 1 Feb 2011 04:22:08 +0000 (14:22 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Feb 2011 04:23:35 +0000 (14:23 +1000)
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/winsys/r600/drm/r600_bo.c

index 6a3737f0a4a8c6030784a5de0f58d76478622d3a..edd774e0e0052758a2a623a13230ddb6074b570c 100644 (file)
@@ -95,11 +95,10 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon,
        radeon_bo_get_tiling_flags(radeon, rbo, &bo->tiling_flags, &bo->kernel_pitch);
        if (array_mode) {
                if (bo->tiling_flags) {
-                       if (bo->tiling_flags & RADEON_TILING_MICRO)
-                               *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
-                       if ((bo->tiling_flags & (RADEON_TILING_MICRO | RADEON_TILING_MACRO)) ==
-                           (RADEON_TILING_MICRO | RADEON_TILING_MACRO))
+                       if (bo->tiling_flags & RADEON_TILING_MACRO)
                                *array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
+                       else if (bo->tiling_flags & RADEON_TILING_MICRO)
+                               *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
                } else {
                        *array_mode = 0;
                }