diff options
author | Oak Zeng <ozeng@amd.com> | 2018-11-30 10:33:02 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-30 12:01:04 -0500 |
commit | 88dc26e46beb964d8c4d80f7eb33bef51fc70c9a (patch) | |
tree | 9108986ee2263f72b8089c788201326425c2e8c0 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 082f0f21f71c522491a0cac4895b32bbab1b1006 (diff) |
drm/amdgpu: Fix num_doorbell calculation issue
When paging queue is enabled, it use the second page of doorbell.
The AMDGPU_DOORBELL64_MAX_ASSIGNMENT definition assumes all the
kernel doorbells are in the first page. So with paging queue enabled,
the total kernel doorbell range should be original num_doorbell plus
one page (0x400 in dword), not *2.
Signed-off-by: Oak Zeng <ozeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8eaa40eb1c4a..c75badfa5c4c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -539,10 +539,13 @@ static int amdgpu_device_doorbell_init(struct amdgpu_device *adev) | |||
539 | return -EINVAL; | 539 | return -EINVAL; |
540 | 540 | ||
541 | /* For Vega, reserve and map two pages on doorbell BAR since SDMA | 541 | /* For Vega, reserve and map two pages on doorbell BAR since SDMA |
542 | * paging queue doorbell use the second page | 542 | * paging queue doorbell use the second page. The |
543 | * AMDGPU_DOORBELL64_MAX_ASSIGNMENT definition assumes all the | ||
544 | * doorbells are in the first page. So with paging queue enabled, | ||
545 | * the max num_doorbells should + 1 page (0x400 in dword) | ||
543 | */ | 546 | */ |
544 | if (adev->asic_type >= CHIP_VEGA10) | 547 | if (adev->asic_type >= CHIP_VEGA10) |
545 | adev->doorbell.num_doorbells *= 2; | 548 | adev->doorbell.num_doorbells += 0x400; |
546 | 549 | ||
547 | adev->doorbell.ptr = ioremap(adev->doorbell.base, | 550 | adev->doorbell.ptr = ioremap(adev->doorbell.base, |
548 | adev->doorbell.num_doorbells * | 551 | adev->doorbell.num_doorbells * |