From: Tom St Denis Date: Thu, 3 Dec 2015 17:23:28 +0000 (-0500) Subject: amdgpu/gfxv8: Remove magic numbers from function gfx_v8_0_tiling_mode_table_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb64526f5a5a382df7018a3e69061b9e3f20e32d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git amdgpu/gfxv8: Remove magic numbers from function gfx_v8_0_tiling_mode_table_init() Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 33e3c0d63c66..29e02e0fa3d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c @@ -1640,8 +1640,8 @@ static int gfx_v8_0_sw_fini(void *handle) static void gfx_v8_0_tiling_mode_table_init(struct amdgpu_device *adev) { uint32_t *modearray, *mod2array; - const u32 num_tile_mode_states = 32; - const u32 num_secondary_tile_mode_states = 16; + const u32 num_tile_mode_states = ARRAY_SIZE(adev->gfx.config.tile_mode_array); + const u32 num_secondary_tile_mode_states = ARRAY_SIZE(adev->gfx.config.macrotile_mode_array); u32 reg_offset; modearray = adev->gfx.config.tile_mode_array;