amdgpu/gfxv8: Remove magic numbers from function gfx_v8_0_tiling_mode_table_init()
authorTom St Denis <tom.stdenis@amd.com>
Thu, 3 Dec 2015 17:23:28 +0000 (12:23 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Dec 2015 16:26:52 +0000 (11:26 -0500)
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

index 33e3c0d63c66004218e4c0ce7651c9c785495f12..29e02e0fa3d4704c2be400f357b9a4a7b95621b3 100644 (file)
@@ -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;