Doing it earlier hits a WARN_ON_ONCE in amdgpu_bo_gpu_offset.
Fixes: "drm/amdgpu: remove gart.table_addr"
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
static int gmc_v6_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 field;
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
WREG32(mmMC_VM_MX_L1_TLB_CNTL,
(0xA << 7) |
*/
static int gmc_v7_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 tmp, field;
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL);
tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1);
*/
static int gmc_v8_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 tmp, field;
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL);
tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1);