mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
drm/amdgpu: correct the vmhub reference for each XCD in gfxhub init
Correct this though the value is same across different vmhub. Signed-off-by: Le Ma <le.ma@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -42,10 +42,11 @@ static void gfxhub_v1_2_setup_vm_pt_regs(struct amdgpu_device *adev,
|
||||
uint32_t vmid,
|
||||
uint64_t page_table_base)
|
||||
{
|
||||
struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB(0)];
|
||||
struct amdgpu_vmhub *hub;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adev->gfx.num_xcd; i++) {
|
||||
hub = &adev->vmhub[AMDGPU_GFXHUB(i)];
|
||||
WREG32_SOC15_OFFSET(GC, i,
|
||||
regVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32,
|
||||
hub->ctx_addr_distance * vmid,
|
||||
@@ -291,7 +292,7 @@ static void gfxhub_v1_2_disable_identity_aperture(struct amdgpu_device *adev)
|
||||
|
||||
static void gfxhub_v1_2_setup_vmid_config(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB(0)];
|
||||
struct amdgpu_vmhub *hub;
|
||||
unsigned num_level, block_size;
|
||||
uint32_t tmp;
|
||||
int i, j;
|
||||
@@ -304,6 +305,7 @@ static void gfxhub_v1_2_setup_vmid_config(struct amdgpu_device *adev)
|
||||
block_size -= 9;
|
||||
|
||||
for (j = 0; j < adev->gfx.num_xcd; j++) {
|
||||
hub = &adev->vmhub[AMDGPU_GFXHUB(j)];
|
||||
for (i = 0; i <= 14; i++) {
|
||||
tmp = RREG32_SOC15_OFFSET(GC, j, regVM_CONTEXT1_CNTL, i);
|
||||
tmp = REG_SET_FIELD(tmp, VM_CONTEXT1_CNTL, ENABLE_CONTEXT, 1);
|
||||
@@ -359,10 +361,11 @@ static void gfxhub_v1_2_setup_vmid_config(struct amdgpu_device *adev)
|
||||
|
||||
static void gfxhub_v1_2_program_invalidation(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB(0)];
|
||||
struct amdgpu_vmhub *hub;
|
||||
unsigned i, j;
|
||||
|
||||
for (j = 0; j < adev->gfx.num_xcd; j++) {
|
||||
hub = &adev->vmhub[AMDGPU_GFXHUB(j)];
|
||||
for (i = 0 ; i < 18; ++i) {
|
||||
WREG32_SOC15_OFFSET(GC, j, regVM_INVALIDATE_ENG0_ADDR_RANGE_LO32,
|
||||
i * hub->eng_addr_distance, 0xffffffff);
|
||||
@@ -408,11 +411,12 @@ static int gfxhub_v1_2_gart_enable(struct amdgpu_device *adev)
|
||||
|
||||
static void gfxhub_v1_2_gart_disable(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB(0)];
|
||||
struct amdgpu_vmhub *hub;
|
||||
u32 tmp;
|
||||
u32 i, j;
|
||||
|
||||
for (j = 0; j < adev->gfx.num_xcd; j++) {
|
||||
hub = &adev->vmhub[AMDGPU_GFXHUB(j)];
|
||||
/* Disable all tables */
|
||||
for (i = 0; i < 16; i++)
|
||||
WREG32_SOC15_OFFSET(GC, j, regVM_CONTEXT0_CNTL,
|
||||
|
||||
Reference in New Issue
Block a user