drm/amdgpu: Add num_banks and num_ranks to gfx config structure
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / amdgpu / gfx_v7_0.c
index 8f20a5dd44fe71a77f374894c61b99073d248505..172905dadf9a42b663208639882ea0b8f19d8764 100644 (file)
@@ -4338,6 +4338,11 @@ static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev)
        adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
        mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
 
+       adev->gfx.config.num_banks = REG_GET_FIELD(mc_arb_ramcfg,
+                               MC_ARB_RAMCFG, NOOFBANK);
+       adev->gfx.config.num_ranks = REG_GET_FIELD(mc_arb_ramcfg,
+                               MC_ARB_RAMCFG, NOOFRANKS);
+
        adev->gfx.config.num_tile_pipes = adev->gfx.config.max_tile_pipes;
        adev->gfx.config.mem_max_burst_length_bytes = 256;
        if (adev->flags & AMD_IS_APU) {