aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-03-02 16:06:51 -0500
committerDave Airlie <airlied@redhat.com>2010-03-14 20:23:22 -0400
commit839461d3b0e3082eb382f17a3e3899372f28649a (patch)
treee34106e15420df1ef6c726e35783ae0d562fcb66 /drivers/gpu/drm/radeon
parent65388342d66a63a29c76058e94a00d7bc0c6423b (diff)
drm/radeon/kms: switch to condition waiting for reclocking
We tried to implement interruptible waiting with timeout (it was broken anyway) which was not a good idea as explained by Andrew. It's possible to avoid using additional variable but actually it inroduces using more complex in-kernel tools. So simply add one variable for condition. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/r100.c2
-rw-r--r--drivers/gpu/drm/radeon/r600.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c8
-rw-r--r--drivers/gpu/drm/radeon/rs600.c2
5 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 91eb762eb3f..73f9a79ed64 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -312,10 +312,12 @@ int r100_irq_process(struct radeon_device *rdev)
312 /* Vertical blank interrupts */ 312 /* Vertical blank interrupts */
313 if (status & RADEON_CRTC_VBLANK_STAT) { 313 if (status & RADEON_CRTC_VBLANK_STAT) {
314 drm_handle_vblank(rdev->ddev, 0); 314 drm_handle_vblank(rdev->ddev, 0);
315 rdev->pm.vblank_sync = true;
315 wake_up(&rdev->irq.vblank_queue); 316 wake_up(&rdev->irq.vblank_queue);
316 } 317 }
317 if (status & RADEON_CRTC2_VBLANK_STAT) { 318 if (status & RADEON_CRTC2_VBLANK_STAT) {
318 drm_handle_vblank(rdev->ddev, 1); 319 drm_handle_vblank(rdev->ddev, 1);
320 rdev->pm.vblank_sync = true;
319 wake_up(&rdev->irq.vblank_queue); 321 wake_up(&rdev->irq.vblank_queue);
320 } 322 }
321 if (status & RADEON_FP_DETECT_STAT) { 323 if (status & RADEON_FP_DETECT_STAT) {
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index c5229019729..5b56a1b3902 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2765,6 +2765,7 @@ restart_ih:
2765 case 0: /* D1 vblank */ 2765 case 0: /* D1 vblank */
2766 if (disp_int & LB_D1_VBLANK_INTERRUPT) { 2766 if (disp_int & LB_D1_VBLANK_INTERRUPT) {
2767 drm_handle_vblank(rdev->ddev, 0); 2767 drm_handle_vblank(rdev->ddev, 0);
2768 rdev->pm.vblank_sync = true;
2768 wake_up(&rdev->irq.vblank_queue); 2769 wake_up(&rdev->irq.vblank_queue);
2769 disp_int &= ~LB_D1_VBLANK_INTERRUPT; 2770 disp_int &= ~LB_D1_VBLANK_INTERRUPT;
2770 DRM_DEBUG("IH: D1 vblank\n"); 2771 DRM_DEBUG("IH: D1 vblank\n");
@@ -2786,6 +2787,7 @@ restart_ih:
2786 case 0: /* D2 vblank */ 2787 case 0: /* D2 vblank */
2787 if (disp_int & LB_D2_VBLANK_INTERRUPT) { 2788 if (disp_int & LB_D2_VBLANK_INTERRUPT) {
2788 drm_handle_vblank(rdev->ddev, 1); 2789 drm_handle_vblank(rdev->ddev, 1);
2790 rdev->pm.vblank_sync = true;
2789 wake_up(&rdev->irq.vblank_queue); 2791 wake_up(&rdev->irq.vblank_queue);
2790 disp_int &= ~LB_D2_VBLANK_INTERRUPT; 2792 disp_int &= ~LB_D2_VBLANK_INTERRUPT;
2791 DRM_DEBUG("IH: D2 vblank\n"); 2793 DRM_DEBUG("IH: D2 vblank\n");
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index ba93e5a20b2..b54d4f36c4d 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -687,6 +687,7 @@ struct radeon_pm {
687 bool downclocked; 687 bool downclocked;
688 int active_crtcs; 688 int active_crtcs;
689 int req_vblank; 689 int req_vblank;
690 bool vblank_sync;
690 fixed20_12 max_bandwidth; 691 fixed20_12 max_bandwidth;
691 fixed20_12 igp_sideport_mclk; 692 fixed20_12 igp_sideport_mclk;
692 fixed20_12 igp_system_mclk; 693 fixed20_12 igp_system_mclk;
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index d4d1c39a0e9..d800b86af4d 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -353,10 +353,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
353 rdev->pm.req_vblank |= (1 << 1); 353 rdev->pm.req_vblank |= (1 << 1);
354 drm_vblank_get(rdev->ddev, 1); 354 drm_vblank_get(rdev->ddev, 1);
355 } 355 }
356 if (rdev->pm.active_crtcs) 356 if (rdev->pm.active_crtcs) {
357 wait_event_interruptible_timeout( 357 rdev->pm.vblank_sync = false;
358 rdev->irq.vblank_queue, 0, 358 wait_event_timeout(
359 rdev->irq.vblank_queue, rdev->pm.vblank_sync,
359 msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT)); 360 msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT));
361 }
360 if (rdev->pm.req_vblank & (1 << 0)) { 362 if (rdev->pm.req_vblank & (1 << 0)) {
361 rdev->pm.req_vblank &= ~(1 << 0); 363 rdev->pm.req_vblank &= ~(1 << 0);
362 drm_vblank_put(rdev->ddev, 0); 364 drm_vblank_put(rdev->ddev, 0);
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 47f046b78c6..ac7c27adfb7 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -392,10 +392,12 @@ int rs600_irq_process(struct radeon_device *rdev)
392 /* Vertical blank interrupts */ 392 /* Vertical blank interrupts */
393 if (G_007EDC_LB_D1_VBLANK_INTERRUPT(r500_disp_int)) { 393 if (G_007EDC_LB_D1_VBLANK_INTERRUPT(r500_disp_int)) {
394 drm_handle_vblank(rdev->ddev, 0); 394 drm_handle_vblank(rdev->ddev, 0);
395 rdev->pm.vblank_sync = true;
395 wake_up(&rdev->irq.vblank_queue); 396 wake_up(&rdev->irq.vblank_queue);
396 } 397 }
397 if (G_007EDC_LB_D2_VBLANK_INTERRUPT(r500_disp_int)) { 398 if (G_007EDC_LB_D2_VBLANK_INTERRUPT(r500_disp_int)) {
398 drm_handle_vblank(rdev->ddev, 1); 399 drm_handle_vblank(rdev->ddev, 1);
400 rdev->pm.vblank_sync = true;
399 wake_up(&rdev->irq.vblank_queue); 401 wake_up(&rdev->irq.vblank_queue);
400 } 402 }
401 if (G_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT(r500_disp_int)) { 403 if (G_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT(r500_disp_int)) {