diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-03-16 17:08:06 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-03-30 19:54:07 -0400 |
commit | 9e7b414edbf5e037c1462bbd8676465ed2ae0ac3 (patch) | |
tree | c843d452a884f3af803794dd4c85581ebd90e6df /drivers/gpu/drm | |
parent | 06abdb0ec6b91f634631404012c4d646389e9e0b (diff) |
drm/radeon/kms: init rdev->num_crtc at asic init
Replace hardcoded numbers with rdev->num_crtc.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_irq_kms.c | 14 |
3 files changed, 16 insertions, 17 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 6d2a5457c2c8..dd23dcfbde17 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -700,6 +700,16 @@ int radeon_asic_init(struct radeon_device *rdev) | |||
700 | rdev->asic->set_memory_clock = NULL; | 700 | rdev->asic->set_memory_clock = NULL; |
701 | } | 701 | } |
702 | 702 | ||
703 | /* set the number of crtcs */ | ||
704 | if (rdev->flags & RADEON_SINGLE_CRTC) | ||
705 | rdev->num_crtc = 1; | ||
706 | else { | ||
707 | if (ASIC_IS_DCE4(rdev)) | ||
708 | rdev->num_crtc = 6; | ||
709 | else | ||
710 | rdev->num_crtc = 2; | ||
711 | } | ||
712 | |||
703 | return 0; | 713 | return 0; |
704 | } | 714 | } |
705 | 715 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index ff5f09953c0a..d65931d2e77a 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev) | |||
1003 | radeon_combios_check_hardcoded_edid(rdev); | 1003 | radeon_combios_check_hardcoded_edid(rdev); |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | if (rdev->flags & RADEON_SINGLE_CRTC) | ||
1007 | rdev->num_crtc = 1; | ||
1008 | else { | ||
1009 | if (ASIC_IS_DCE4(rdev)) | ||
1010 | rdev->num_crtc = 6; | ||
1011 | else | ||
1012 | rdev->num_crtc = 2; | ||
1013 | } | ||
1014 | |||
1015 | /* allocate crtcs */ | 1006 | /* allocate crtcs */ |
1016 | for (i = 0; i < rdev->num_crtc; i++) { | 1007 | for (i = 0; i < rdev->num_crtc; i++) { |
1017 | radeon_crtc_init(rdev->ddev, i); | 1008 | radeon_crtc_init(rdev->ddev, i); |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 3cfd60fd0083..68519b406ca6 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
@@ -67,9 +67,10 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) | |||
67 | 67 | ||
68 | /* Disable *all* interrupts */ | 68 | /* Disable *all* interrupts */ |
69 | rdev->irq.sw_int = false; | 69 | rdev->irq.sw_int = false; |
70 | for (i = 0; i < 2; i++) { | 70 | for (i = 0; i < rdev->num_crtc; i++) |
71 | rdev->irq.crtc_vblank_int[i] = false; | 71 | rdev->irq.crtc_vblank_int[i] = false; |
72 | } | 72 | for (i = 0; i < 6; i++) |
73 | rdev->irq.hpd[i] = false; | ||
73 | radeon_irq_set(rdev); | 74 | radeon_irq_set(rdev); |
74 | /* Clear bits */ | 75 | /* Clear bits */ |
75 | radeon_irq_process(rdev); | 76 | radeon_irq_process(rdev); |
@@ -95,22 +96,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) | |||
95 | } | 96 | } |
96 | /* Disable *all* interrupts */ | 97 | /* Disable *all* interrupts */ |
97 | rdev->irq.sw_int = false; | 98 | rdev->irq.sw_int = false; |
98 | for (i = 0; i < 2; i++) { | 99 | for (i = 0; i < rdev->num_crtc; i++) |
99 | rdev->irq.crtc_vblank_int[i] = false; | 100 | rdev->irq.crtc_vblank_int[i] = false; |
101 | for (i = 0; i < 6; i++) | ||
100 | rdev->irq.hpd[i] = false; | 102 | rdev->irq.hpd[i] = false; |
101 | } | ||
102 | radeon_irq_set(rdev); | 103 | radeon_irq_set(rdev); |
103 | } | 104 | } |
104 | 105 | ||
105 | int radeon_irq_kms_init(struct radeon_device *rdev) | 106 | int radeon_irq_kms_init(struct radeon_device *rdev) |
106 | { | 107 | { |
107 | int r = 0; | 108 | int r = 0; |
108 | int num_crtc = 2; | ||
109 | 109 | ||
110 | if (rdev->flags & RADEON_SINGLE_CRTC) | ||
111 | num_crtc = 1; | ||
112 | spin_lock_init(&rdev->irq.sw_lock); | 110 | spin_lock_init(&rdev->irq.sw_lock); |
113 | r = drm_vblank_init(rdev->ddev, num_crtc); | 111 | r = drm_vblank_init(rdev->ddev, rdev->num_crtc); |
114 | if (r) { | 112 | if (r) { |
115 | return r; | 113 | return r; |
116 | } | 114 | } |