Commit 9e7b414e authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: init rdev->num_crtc at asic init

Replace hardcoded numbers with rdev->num_crtc.
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 06abdb0e
...@@ -700,6 +700,16 @@ int radeon_asic_init(struct radeon_device *rdev) ...@@ -700,6 +700,16 @@ int radeon_asic_init(struct radeon_device *rdev)
rdev->asic->set_memory_clock = NULL; rdev->asic->set_memory_clock = NULL;
} }
/* set the number of crtcs */
if (rdev->flags & RADEON_SINGLE_CRTC)
rdev->num_crtc = 1;
else {
if (ASIC_IS_DCE4(rdev))
rdev->num_crtc = 6;
else
rdev->num_crtc = 2;
}
return 0; return 0;
} }
......
...@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev) ...@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
radeon_combios_check_hardcoded_edid(rdev); radeon_combios_check_hardcoded_edid(rdev);
} }
if (rdev->flags & RADEON_SINGLE_CRTC)
rdev->num_crtc = 1;
else {
if (ASIC_IS_DCE4(rdev))
rdev->num_crtc = 6;
else
rdev->num_crtc = 2;
}
/* allocate crtcs */ /* allocate crtcs */
for (i = 0; i < rdev->num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
radeon_crtc_init(rdev->ddev, i); radeon_crtc_init(rdev->ddev, i);
......
...@@ -67,9 +67,10 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) ...@@ -67,9 +67,10 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
/* Disable *all* interrupts */ /* Disable *all* interrupts */
rdev->irq.sw_int = false; rdev->irq.sw_int = false;
for (i = 0; i < 2; i++) { for (i = 0; i < rdev->num_crtc; i++)
rdev->irq.crtc_vblank_int[i] = false; rdev->irq.crtc_vblank_int[i] = false;
} for (i = 0; i < 6; i++)
rdev->irq.hpd[i] = false;
radeon_irq_set(rdev); radeon_irq_set(rdev);
/* Clear bits */ /* Clear bits */
radeon_irq_process(rdev); radeon_irq_process(rdev);
...@@ -95,22 +96,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) ...@@ -95,22 +96,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
} }
/* Disable *all* interrupts */ /* Disable *all* interrupts */
rdev->irq.sw_int = false; rdev->irq.sw_int = false;
for (i = 0; i < 2; i++) { for (i = 0; i < rdev->num_crtc; i++)
rdev->irq.crtc_vblank_int[i] = false; rdev->irq.crtc_vblank_int[i] = false;
for (i = 0; i < 6; i++)
rdev->irq.hpd[i] = false; rdev->irq.hpd[i] = false;
}
radeon_irq_set(rdev); radeon_irq_set(rdev);
} }
int radeon_irq_kms_init(struct radeon_device *rdev) int radeon_irq_kms_init(struct radeon_device *rdev)
{ {
int r = 0; int r = 0;
int num_crtc = 2;
if (rdev->flags & RADEON_SINGLE_CRTC)
num_crtc = 1;
spin_lock_init(&rdev->irq.sw_lock); spin_lock_init(&rdev->irq.sw_lock);
r = drm_vblank_init(rdev->ddev, num_crtc); r = drm_vblank_init(rdev->ddev, rdev->num_crtc);
if (r) { if (r) {
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment