Commit dab5ef27 authored by changzhu's avatar changzhu Committed by Alex Deucher

drm/amdgpu: initialize vm_inv_eng0_sem for gfxhub and mmhub

SW must acquire/release one of the vm_invalidate_eng*_sem around the
invalidation req/ack. Through this way,it can avoid losing invalidate
acknowledge state across power-gating off cycle.
To use vm_invalidate_eng*_sem, it needs to initialize
vm_invalidate_eng*_sem firstly.
Signed-off-by: default avatarchangzhu <Changfeng.Zhu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c348ad46
...@@ -77,6 +77,7 @@ struct amdgpu_gmc_fault { ...@@ -77,6 +77,7 @@ struct amdgpu_gmc_fault {
struct amdgpu_vmhub { struct amdgpu_vmhub {
uint32_t ctx0_ptb_addr_lo32; uint32_t ctx0_ptb_addr_lo32;
uint32_t ctx0_ptb_addr_hi32; uint32_t ctx0_ptb_addr_hi32;
uint32_t vm_inv_eng0_sem;
uint32_t vm_inv_eng0_req; uint32_t vm_inv_eng0_req;
uint32_t vm_inv_eng0_ack; uint32_t vm_inv_eng0_ack;
uint32_t vm_context0_cntl; uint32_t vm_context0_cntl;
......
...@@ -367,6 +367,8 @@ void gfxhub_v1_0_init(struct amdgpu_device *adev) ...@@ -367,6 +367,8 @@ void gfxhub_v1_0_init(struct amdgpu_device *adev)
hub->ctx0_ptb_addr_hi32 = hub->ctx0_ptb_addr_hi32 =
SOC15_REG_OFFSET(GC, 0, SOC15_REG_OFFSET(GC, 0,
mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32); mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32);
hub->vm_inv_eng0_sem =
SOC15_REG_OFFSET(GC, 0, mmVM_INVALIDATE_ENG0_SEM);
hub->vm_inv_eng0_req = hub->vm_inv_eng0_req =
SOC15_REG_OFFSET(GC, 0, mmVM_INVALIDATE_ENG0_REQ); SOC15_REG_OFFSET(GC, 0, mmVM_INVALIDATE_ENG0_REQ);
hub->vm_inv_eng0_ack = hub->vm_inv_eng0_ack =
......
...@@ -356,6 +356,8 @@ void gfxhub_v2_0_init(struct amdgpu_device *adev) ...@@ -356,6 +356,8 @@ void gfxhub_v2_0_init(struct amdgpu_device *adev)
hub->ctx0_ptb_addr_hi32 = hub->ctx0_ptb_addr_hi32 =
SOC15_REG_OFFSET(GC, 0, SOC15_REG_OFFSET(GC, 0,
mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32); mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32);
hub->vm_inv_eng0_sem =
SOC15_REG_OFFSET(GC, 0, mmGCVM_INVALIDATE_ENG0_SEM);
hub->vm_inv_eng0_req = hub->vm_inv_eng0_req =
SOC15_REG_OFFSET(GC, 0, mmGCVM_INVALIDATE_ENG0_REQ); SOC15_REG_OFFSET(GC, 0, mmGCVM_INVALIDATE_ENG0_REQ);
hub->vm_inv_eng0_ack = hub->vm_inv_eng0_ack =
......
...@@ -416,6 +416,8 @@ void mmhub_v1_0_init(struct amdgpu_device *adev) ...@@ -416,6 +416,8 @@ void mmhub_v1_0_init(struct amdgpu_device *adev)
hub->ctx0_ptb_addr_hi32 = hub->ctx0_ptb_addr_hi32 =
SOC15_REG_OFFSET(MMHUB, 0, SOC15_REG_OFFSET(MMHUB, 0,
mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32); mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32);
hub->vm_inv_eng0_sem =
SOC15_REG_OFFSET(MMHUB, 0, mmVM_INVALIDATE_ENG0_SEM);
hub->vm_inv_eng0_req = hub->vm_inv_eng0_req =
SOC15_REG_OFFSET(MMHUB, 0, mmVM_INVALIDATE_ENG0_REQ); SOC15_REG_OFFSET(MMHUB, 0, mmVM_INVALIDATE_ENG0_REQ);
hub->vm_inv_eng0_ack = hub->vm_inv_eng0_ack =
......
...@@ -348,6 +348,8 @@ void mmhub_v2_0_init(struct amdgpu_device *adev) ...@@ -348,6 +348,8 @@ void mmhub_v2_0_init(struct amdgpu_device *adev)
hub->ctx0_ptb_addr_hi32 = hub->ctx0_ptb_addr_hi32 =
SOC15_REG_OFFSET(MMHUB, 0, SOC15_REG_OFFSET(MMHUB, 0,
mmMMVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32); mmMMVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32);
hub->vm_inv_eng0_sem =
SOC15_REG_OFFSET(MMHUB, 0, mmMMVM_INVALIDATE_ENG0_SEM);
hub->vm_inv_eng0_req = hub->vm_inv_eng0_req =
SOC15_REG_OFFSET(MMHUB, 0, mmMMVM_INVALIDATE_ENG0_REQ); SOC15_REG_OFFSET(MMHUB, 0, mmMMVM_INVALIDATE_ENG0_REQ);
hub->vm_inv_eng0_ack = hub->vm_inv_eng0_ack =
......
...@@ -505,6 +505,10 @@ void mmhub_v9_4_init(struct amdgpu_device *adev) ...@@ -505,6 +505,10 @@ void mmhub_v9_4_init(struct amdgpu_device *adev)
SOC15_REG_OFFSET(MMHUB, 0, SOC15_REG_OFFSET(MMHUB, 0,
mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32) + mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32) +
i * MMHUB_INSTANCE_REGISTER_OFFSET; i * MMHUB_INSTANCE_REGISTER_OFFSET;
hub[i]->vm_inv_eng0_sem =
SOC15_REG_OFFSET(MMHUB, 0,
mmVML2VC0_VM_INVALIDATE_ENG0_SEM) +
i * MMHUB_INSTANCE_REGISTER_OFFSET;
hub[i]->vm_inv_eng0_req = hub[i]->vm_inv_eng0_req =
SOC15_REG_OFFSET(MMHUB, 0, SOC15_REG_OFFSET(MMHUB, 0,
mmVML2VC0_VM_INVALIDATE_ENG0_REQ) + mmVML2VC0_VM_INVALIDATE_ENG0_REQ) +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment