Re: [PATCH 6/8] drm/amdgpu: Call doorbell index init on device initialization

2018-11-27 Thread Alex Deucher
On Mon, Nov 26, 2018 at 12:29 PM Oak Zeng  wrote:
>
> 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
>
> Change-Id: I2f004bbbe2565035460686f4fc16e86b77a2a9b5
> Signed-off-by: Oak Zeng 
> Suggested-by: Felix Kuehling 
> Suggested-by: Alex Deucher 

Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +---
>  1 file 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 cb06e68..a8b1c9c 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)
>   */
>  static int amdgpu_device_doorbell_init(struct amdgpu_device *adev)
>  {
> +   amdgpu_asic_init_doorbell_index(adev);
> +
> /* No doorbell on SI hardware generation */
> if (adev->asic_type < CHIP_BONAIRE) {
> adev->doorbell.base = 0;
> @@ -2464,9 +2466,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
> DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
>
> -   /* doorbell bar mapping */
> -   amdgpu_device_doorbell_init(adev);
> -
> /* io port mapping */
> for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
> if (pci_resource_flags(adev->pdev, i) & IORESOURCE_IO) {
> @@ -2485,6 +2484,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> if (r)
> return r;
>
> +   /* doorbell bar mapping and doorbell index init*/
> +   amdgpu_device_doorbell_init(adev);
> +
> /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
> /* this will fail for cards that aren't VGA class devices, just
>  * ignore it */
> --
> 2.7.4
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 6/8] drm/amdgpu: Call doorbell index init on device initialization

2018-11-26 Thread Oak Zeng
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

Change-Id: I2f004bbbe2565035460686f4fc16e86b77a2a9b5
Signed-off-by: Oak Zeng 
Suggested-by: Felix Kuehling 
Suggested-by: Alex Deucher 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +---
 1 file 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 cb06e68..a8b1c9c 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)
  */
 static int amdgpu_device_doorbell_init(struct amdgpu_device *adev)
 {
+   amdgpu_asic_init_doorbell_index(adev);
+
/* No doorbell on SI hardware generation */
if (adev->asic_type < CHIP_BONAIRE) {
adev->doorbell.base = 0;
@@ -2464,9 +2466,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
 
-   /* doorbell bar mapping */
-   amdgpu_device_doorbell_init(adev);
-
/* io port mapping */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
if (pci_resource_flags(adev->pdev, i) & IORESOURCE_IO) {
@@ -2485,6 +2484,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
if (r)
return r;
 
+   /* doorbell bar mapping and doorbell index init*/
+   amdgpu_device_doorbell_init(adev);
+
/* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
/* this will fail for cards that aren't VGA class devices, just
 * ignore it */
-- 
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx