summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2012-06-06 09:12:37 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-06-07 10:43:18 -0400
commitc2b77a02d4e188cfa6d1b73a721946fd9b1d3577 (patch)
tree1b5f45018b3a38415ac8eb66acc0289061bc38a5
parentba6130c2d6f4e9833f4d5b43da01673827b26bd4 (diff)
radeon: fall back to 1D tiling only with broken kernels
Certain cards report the the wrong bank setup which causes surface init to fail in the ddx and leads to no accel. If we hit an invalid tiling parameter, just set a default value and disable 2D tiling. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=43448 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--radeon/radeon_surface.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index a7b488b6..adf209d0 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -206,7 +206,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.num_pipes = 8;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.num_pipes = 8;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
switch ((tiling_config & 0x30) >> 4) {
@@ -217,7 +219,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.num_banks = 8;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.num_banks = 8;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
switch ((tiling_config & 0xc0) >> 6) {
@@ -228,7 +232,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.group_bytes = 512;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.group_bytes = 256;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
return 0;
}
@@ -458,7 +464,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.num_pipes = 8;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.num_pipes = 8;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
switch ((tiling_config & 0xf0) >> 4) {
@@ -472,7 +480,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.num_banks = 16;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.num_banks = 8;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
switch ((tiling_config & 0xf00) >> 8) {
@@ -483,7 +493,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.group_bytes = 512;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.group_bytes = 256;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
switch ((tiling_config & 0xf000) >> 12) {
@@ -497,7 +509,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man)
surf_man->hw_info.row_size = 4096;
break;
default:
- return -EINVAL;
+ surf_man->hw_info.row_size = 4096;
+ surf_man->hw_info.allow_2d = 0;
+ break;
}
return 0;
}