diff options
author | Oak Zeng <ozeng@amd.com> | 2018-11-19 15:36:09 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-28 15:55:32 -0500 |
commit | 6585661ddd6a0a47c4d2a70e1441031c294e6de2 (patch) | |
tree | 2dce75606eddfef210b76dd65271c7928d601fe1 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | c93aa77586c2ffe328cca32b40fc988bde8318b2 (diff) |
drm/amdgpu: Call doorbell index init on device initialization
Also call functioin amdgpu_device_doorbell_init after
amdgpu_device_ip_early_init because the former depends
on the later to set up asic-specific init_doorbell_index
function
Signed-off-by: Oak Zeng <ozeng@amd.com>
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@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 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index cb06e6883fad..a8b1c9c04326 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -513,6 +513,8 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev) | |||
513 | */ | 513 | */ |
514 | static int amdgpu_device_doorbell_init(struct amdgpu_device *adev) | 514 | static int amdgpu_device_doorbell_init(struct amdgpu_device *adev) |
515 | { | 515 | { |
516 | amdgpu_asic_init_doorbell_index(adev); | ||
517 | |||
516 | /* No doorbell on SI hardware generation */ | 518 | /* No doorbell on SI hardware generation */ |
517 | if (adev->asic_type < CHIP_BONAIRE) { | 519 | if (adev->asic_type < CHIP_BONAIRE) { |
518 | adev->doorbell.base = 0; | 520 | adev->doorbell.base = 0; |
@@ -2464,9 +2466,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, | |||
2464 | DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base); | 2466 | DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base); |
2465 | DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size); | 2467 | DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size); |
2466 | 2468 | ||
2467 | /* doorbell bar mapping */ | ||
2468 | amdgpu_device_doorbell_init(adev); | ||
2469 | |||
2470 | /* io port mapping */ | 2469 | /* io port mapping */ |
2471 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | 2470 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { |
2472 | if (pci_resource_flags(adev->pdev, i) & IORESOURCE_IO) { | 2471 | if (pci_resource_flags(adev->pdev, i) & IORESOURCE_IO) { |
@@ -2485,6 +2484,9 @@ int amdgpu_device_init(struct amdgpu_device *adev, | |||
2485 | if (r) | 2484 | if (r) |
2486 | return r; | 2485 | return r; |
2487 | 2486 | ||
2487 | /* doorbell bar mapping and doorbell index init*/ | ||
2488 | amdgpu_device_doorbell_init(adev); | ||
2489 | |||
2488 | /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */ | 2490 | /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */ |
2489 | /* this will fail for cards that aren't VGA class devices, just | 2491 | /* this will fail for cards that aren't VGA class devices, just |
2490 | * ignore it */ | 2492 | * ignore it */ |