[PATCH 2/3] drm/amdgpu/gfx9: cache RB harvest registers

Alex Deucher alexdeucher at gmail.com
Fri Mar 24 19:13:17 UTC 2017


So we don't have to look this up via MMIO when users request
the value via ioctl.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 6fc4b29..fa3e579 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1237,6 +1237,11 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev)
 			data = gfx_v9_0_get_rb_active_bitmap(adev);
 			active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) *
 					       rb_bitmap_width_per_sh);
+			/* cache the values for userspace */
+			adev->gfx.config.rb_config[i][j].rb_backend_disable =
+				RREG32(SOC15_REG_OFFSET(GC, 0, mmCC_RB_BACKEND_DISABLE));
+			adev->gfx.config.rb_config[i][j].user_rb_backend_disable =
+				RREG32(SOC15_REG_OFFSET(GC, 0, mmGC_USER_RB_BACKEND_DISABLE));
 		}
 	}
 	gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
-- 
2.5.5



More information about the amd-gfx mailing list