From d47dd091874634b1b527a4e70a132b71948a6f8c Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 21 Nov 2011 17:05:32 -0500 Subject: [PATCH] drm/radeon/kms: properly set up backend map for Barts LE May fix: https://bugs.freedesktop.org/show_bug.cgi?id=39282 Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/evergreen.c | 54 ++++++++++++++++++++++++++++++++++-- 1 files changed, 51 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 7a98c66..bcd1c86 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -1825,8 +1825,14 @@ static void evergreen_gpu_init(struct radeon_device *rdev) 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; - rdev->config.evergreen.max_backends = 4 * rdev->config.evergreen.num_ses; + if (rdev->pdev->device == 0x673e) { + /* BARTS LE */ + rdev->config.evergreen.max_simds = 5; + rdev->config.evergreen.max_backends = 2 * rdev->config.evergreen.num_ses; + } else { + rdev->config.evergreen.max_simds = 7; + rdev->config.evergreen.max_backends = 4 * rdev->config.evergreen.num_ses; + } rdev->config.evergreen.max_gprs = 256; rdev->config.evergreen.max_threads = 248; rdev->config.evergreen.max_gs_threads = 32; @@ -1908,7 +1914,8 @@ static void evergreen_gpu_init(struct radeon_device *rdev) INACTIVE_SIMDS((EVERGREEN_MAX_SIMDS_MASK << rdev->config.evergreen.max_simds) & EVERGREEN_MAX_SIMDS_MASK); - cc_rb_backend_disable = + cc_rb_backend_disable = RREG32(CC_RB_BACKEND_DISABLE); + cc_rb_backend_disable |= BACKEND_DISABLE((EVERGREEN_MAX_BACKENDS_MASK << rdev->config.evergreen.max_backends) & EVERGREEN_MAX_BACKENDS_MASK); @@ -2026,6 +2033,46 @@ static void evergreen_gpu_init(struct radeon_device *rdev) EVERGREEN_MAX_BACKENDS_MASK)); break; } + } else if (rdev->pdev->device == 0x673e) { + switch ((RREG32(CC_RB_BACKEND_DISABLE) & 0x00ff0000) >> 16) { + case 0x00: + gb_backend_map = 0x76543210; + break; + case 0x55: + gb_backend_map = 0x77553311; + break; + case 0x56: + gb_backend_map = 0x77553300; + break; + case 0x59: + gb_backend_map = 0x77552211; + break; + case 0x66: + gb_backend_map = 0x77443300; + break; + case 0x99: + gb_backend_map = 0x66552211; + break; + case 0x5a: + gb_backend_map = 0x77552200; + break; + case 0xaa: + gb_backend_map = 0x66442200; + break; + case 0x95: + gb_backend_map = 0x66553311; + 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: @@ -2044,6 +2091,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) ((EVERGREEN_MAX_BACKENDS_MASK << rdev->config.evergreen.max_backends) & EVERGREEN_MAX_BACKENDS_MASK)); + break; } } -- 1.7.3.4