From 7d00a8b70dd7787ba3387033353ad213db5122a3 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 22 Aug 2011 13:54:19 -0400 Subject: [PATCH] drm/radeon/kms: add some additional cayman blit state Add some missing state to keep the 3D engine blitting properly after state changes from the 3D driver in some cases. May fix: https://bugs.freedesktop.org/show_bug.cgi?id=40221 Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/cayman_blit_shaders.c | 5 +++-- drivers/gpu/drm/radeon/evergreen_blit_kms.c | 16 ++++++++++++++++ drivers/gpu/drm/radeon/evergreend.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/cayman_blit_shaders.c b/drivers/gpu/drm/radeon/cayman_blit_shaders.c index 7b4eeb7..dd133e3 100644 --- a/drivers/gpu/drm/radeon/cayman_blit_shaders.c +++ b/drivers/gpu/drm/radeon/cayman_blit_shaders.c @@ -195,8 +195,9 @@ const u32 cayman_default_state[] = 0x00000000, /* SQ_PGM_START_FS */ 0x00000000, - 0xc0016900, - 0x0000023b, + 0xc0026900, + 0x0000023a, + 0x00000000, /* SQ_LDS_ALLOC */ 0x00000000, /* SQ_LDS_ALLOC_PS */ 0xc0066900, diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index bb8979a..b712fbc 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c @@ -550,6 +550,22 @@ set_default_state(struct radeon_device *rdev) radeon_ring_write(rdev, sq_stack_resource_mgmt_1); radeon_ring_write(rdev, sq_stack_resource_mgmt_2); radeon_ring_write(rdev, sq_stack_resource_mgmt_3); + } else { + /* enable dyn gprs */ + radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 1)); + radeon_ring_write(rdev, (SQ_DYN_GPR_CNTL_PS_FLUSH_REQ - PACKET3_SET_CONFIG_REG_START) >> 2); + radeon_ring_write(rdev, DYN_GPR_ENABLE); + + /* SQ config */ + radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 2)); + radeon_ring_write(rdev, (SQ_CONFIG - PACKET3_SET_CONFIG_REG_START) >> 2); + radeon_ring_write(rdev, EXPORT_SRC_C); + radeon_ring_write(rdev, NUM_CLAUSE_TEMP_GPRS(4)); + + radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 2)); + radeon_ring_write(rdev, (0x8C10 - PACKET3_SET_CONFIG_REG_START) >> 2); + radeon_ring_write(rdev, 0); /* SQ_GLOBAL_GPR_RESOURCE_MGMT_1 */ + radeon_ring_write(rdev, 0); /* SQ_GLOBAL_GPR_RESOURCE_MGMT_2 */ } /* CONTEXT_CONTROL */ diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 7363d9d..4d402e1 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h @@ -337,6 +337,7 @@ #define NUM_HS_STACK_ENTRIES(x) ((x) << 0) #define NUM_LS_STACK_ENTRIES(x) ((x) << 16) #define SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 0x8D8C +#define DYN_GPR_ENABLE (1 << 8) #define SQ_LDS_RESOURCE_MGMT 0x8E2C #define SQ_MS_FIFO_SIZES 0x8CF0 -- 1.7.1.1