From d3d66ec1788ef49c89a737494bca35fe51e0391a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 23 May 2012 15:08:53 -0400 Subject: [PATCH] drm/radeon: fix backend map for barts LE Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39282 Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/evergreen.c | 80 +++++++++++++++++++++++++++++++++++- 1 files changed, 79 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 58991af..71cbf6b 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -1883,7 +1883,10 @@ static void evergreen_gpu_init(struct radeon_device *rdev) rdev->config.evergreen.sc_earlyz_tile_fifo_size = 0x130; break; case CHIP_BARTS: - rdev->config.evergreen.num_ses = 2; + if (rdev->ddev->pdev->device == 0x673e) + rdev->config.evergreen.num_ses = 1; + else + rdev->config.evergreen.num_ses = 2; rdev->config.evergreen.max_pipes = 4; rdev->config.evergreen.max_tile_pipes = 8; rdev->config.evergreen.max_simds = 7; @@ -2089,6 +2092,81 @@ static void evergreen_gpu_init(struct radeon_device *rdev) EVERGREEN_MAX_BACKENDS_MASK)); break; } + } else if (rdev->ddev->pdev->device == 0x673e) { + /* barts LE */ + u32 efuse_straps_4; + u32 efuse_straps_3; + u8 efuse_box_bit_131_124; + + WREG32(RCU_IND_INDEX, 0x204); + efuse_straps_4 = RREG32(RCU_IND_DATA); + WREG32(RCU_IND_INDEX, 0x203); + efuse_straps_3 = RREG32(RCU_IND_DATA); + efuse_box_bit_131_124 = (u8)(((efuse_straps_4 & 0xf) << 4) | ((efuse_straps_3 & 0xf0000000) >> 28)); + + switch(efuse_box_bit_131_124) { + case 0x00: + gb_backend_map = 0x76543210; + break; + case 0x55: + gb_backend_map = 0x76543311; + break; + case 0x65: + gb_backend_map = 0x76543311; + break; + case 0x95: + gb_backend_map = 0x66553311; + break; + case 0xa5: + gb_backend_map = 0x66443311; + break; + case 0x56: + gb_backend_map = 0x77553300; + break; + case 0x66: + gb_backend_map = 0x77443300; + break; + case 0x96: + gb_backend_map = 0x66553300; + break; + case 0xa6: + gb_backend_map = 0x66443300; + break; + case 0x59: + gb_backend_map = 0x77552211; + break; + case 0x69: + gb_backend_map = 0x77442211; + break; + case 0x99: + gb_backend_map = 0x66552211; + break; + case 0xa9: + gb_backend_map = 0x66442211; + break; + case 0x5a: + gb_backend_map = 0x77552200; + break; + case 0x6a: + gb_backend_map = 0x77442200; + break; + case 0x9a: + gb_backend_map = 0x66552200; + break; + case 0xaa: + gb_backend_map = 0x66442200; + break; + default: + DRM_ERROR("bad backend map, using default\n"); + gb_backend_map = + evergreen_get_tile_pipe_to_backend_map(rdev, + rdev->config.evergreen.max_tile_pipes, + rdev->config.evergreen.max_backends, + ((EVERGREEN_MAX_BACKENDS_MASK << + rdev->config.evergreen.max_backends) & + EVERGREEN_MAX_BACKENDS_MASK)); + break; + } } else { switch (rdev->family) { case CHIP_CYPRESS: -- 1.7.7.5