drm/amdgpu: don't create ih ring 1 and ring 2 for APU
authorHawking Zhang <Hawking.Zhang@amd.com>
Sat, 12 Dec 2020 15:04:08 +0000 (23:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Dec 2020 20:06:22 +0000 (15:06 -0500)
APUs don't support ih ring 1 and ring 2.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vega10_ih.c

index 44021ef..b1d9442 100644 (file)
@@ -489,20 +489,21 @@ static int vega10_ih_sw_init(void *handle)
        adev->irq.ih.use_doorbell = true;
        adev->irq.ih.doorbell_index = adev->doorbell_index.ih << 1;
 
-       r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);
-       if (r)
-               return r;
-
-       adev->irq.ih1.use_doorbell = true;
-       adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;
+       if (!(adev->flags & AMD_IS_APU)) {
+               r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);
+               if (r)
+                       return r;
 
-       r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
-       if (r)
-               return r;
+               adev->irq.ih1.use_doorbell = true;
+               adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;
 
-       adev->irq.ih2.use_doorbell = true;
-       adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
+               r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
+               if (r)
+                       return r;
 
+               adev->irq.ih2.use_doorbell = true;
+               adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
+       }
        /* initialize ih control registers offset */
        vega10_ih_init_register_offset(adev);