]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Use real number of CRTCs and HPDs in set_irq_funcs
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 24 Oct 2017 09:13:34 +0000 (11:13 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Dec 2017 21:41:40 +0000 (16:41 -0500)
Corresponding to the previous non-DC change.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c

index 72a08776a6a66e130f7276766ebe564ae843b1b5..f46cef9bde68e9c3abd595741f8d6c0d471c53cb 100644 (file)
@@ -1590,7 +1590,6 @@ static int dm_early_init(void *handle)
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
        adev->ddev->driver->driver_features |= DRIVER_ATOMIC;
-       amdgpu_dm_set_irq_funcs(adev);
 
        switch (adev->asic_type) {
        case CHIP_BONAIRE:
@@ -1664,6 +1663,8 @@ static int dm_early_init(void *handle)
                return -EINVAL;
        }
 
+       amdgpu_dm_set_irq_funcs(adev);
+
        if (adev->mode_info.funcs == NULL)
                adev->mode_info.funcs = &dm_display_funcs;
 
index ca5d0d1581dc7586c6d50de57aa61d3364a6bf56..1874b6cee6afa1dd81aeb0177c605c69c1b68e65 100644 (file)
@@ -683,13 +683,16 @@ static const struct amdgpu_irq_src_funcs dm_hpd_irq_funcs = {
 
 void amdgpu_dm_set_irq_funcs(struct amdgpu_device *adev)
 {
-       adev->crtc_irq.num_types = AMDGPU_CRTC_IRQ_LAST;
+       if (adev->mode_info.num_crtc > 0)
+               adev->crtc_irq.num_types = AMDGPU_CRTC_IRQ_VLINE1 + adev->mode_info.num_crtc;
+       else
+               adev->crtc_irq.num_types = 0;
        adev->crtc_irq.funcs = &dm_crtc_irq_funcs;
 
-       adev->pageflip_irq.num_types = AMDGPU_PAGEFLIP_IRQ_LAST;
+       adev->pageflip_irq.num_types = adev->mode_info.num_crtc;
        adev->pageflip_irq.funcs = &dm_pageflip_irq_funcs;
 
-       adev->hpd_irq.num_types = AMDGPU_HPD_LAST;
+       adev->hpd_irq.num_types = adev->mode_info.num_hpd;
        adev->hpd_irq.funcs = &dm_hpd_irq_funcs;
 }