aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-12-04 16:56:37 -0500
committerDave Airlie <airlied@redhat.com>2009-12-07 19:48:22 -0500
commitd4877cf2293f5463f531769fd12300cb3417c778 (patch)
treeee9533aaf9fac0bbec859cf5d888fa73a71875bd /drivers/gpu/drm/radeon/r600.c
parent429770b3e39999c4d025fbcb9959502adc3989d8 (diff)
drm/radeon/kms: enable hpd support
This enabled interrupt driven hpd support for all radeon chips. Assuming the hpd pin is wired up correctly, the driver will generate uevents on digital monitor connect and disconnect and retrain DP monitors automatically. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index c11715fb29c7..250ec3fe1a16 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2674,6 +2674,7 @@ int r600_irq_process(struct radeon_device *rdev)
2674 u32 last_entry = rdev->ih.ring_size - 16; 2674 u32 last_entry = rdev->ih.ring_size - 16;
2675 u32 ring_index, disp_int, disp_int_cont, disp_int_cont2; 2675 u32 ring_index, disp_int, disp_int_cont, disp_int_cont2;
2676 unsigned long flags; 2676 unsigned long flags;
2677 bool queue_hotplug = false;
2677 2678
2678 DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); 2679 DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr);
2679 2680
@@ -2745,37 +2746,43 @@ restart_ih:
2745 case 0: 2746 case 0:
2746 if (disp_int & DC_HPD1_INTERRUPT) { 2747 if (disp_int & DC_HPD1_INTERRUPT) {
2747 disp_int &= ~DC_HPD1_INTERRUPT; 2748 disp_int &= ~DC_HPD1_INTERRUPT;
2748 DRM_INFO("IH: HPD1\n"); 2749 queue_hotplug = true;
2750 DRM_DEBUG("IH: HPD1\n");
2749 } 2751 }
2750 break; 2752 break;
2751 case 1: 2753 case 1:
2752 if (disp_int & DC_HPD2_INTERRUPT) { 2754 if (disp_int & DC_HPD2_INTERRUPT) {
2753 disp_int &= ~DC_HPD2_INTERRUPT; 2755 disp_int &= ~DC_HPD2_INTERRUPT;
2754 DRM_INFO("IH: HPD2\n"); 2756 queue_hotplug = true;
2757 DRM_DEBUG("IH: HPD2\n");
2755 } 2758 }
2756 break; 2759 break;
2757 case 4: 2760 case 4:
2758 if (disp_int_cont & DC_HPD3_INTERRUPT) { 2761 if (disp_int_cont & DC_HPD3_INTERRUPT) {
2759 disp_int_cont &= ~DC_HPD3_INTERRUPT; 2762 disp_int_cont &= ~DC_HPD3_INTERRUPT;
2760 DRM_INFO("IH: HPD3\n"); 2763 queue_hotplug = true;
2764 DRM_DEBUG("IH: HPD3\n");
2761 } 2765 }
2762 break; 2766 break;
2763 case 5: 2767 case 5:
2764 if (disp_int_cont & DC_HPD4_INTERRUPT) { 2768 if (disp_int_cont & DC_HPD4_INTERRUPT) {
2765 disp_int_cont &= ~DC_HPD4_INTERRUPT; 2769 disp_int_cont &= ~DC_HPD4_INTERRUPT;
2766 DRM_INFO("IH: HPD4\n"); 2770 queue_hotplug = true;
2771 DRM_DEBUG("IH: HPD4\n");
2767 } 2772 }
2768 break; 2773 break;
2769 case 10: 2774 case 10:
2770 if (disp_int_cont2 & DC_HPD5_INTERRUPT) { 2775 if (disp_int_cont2 & DC_HPD5_INTERRUPT) {
2771 disp_int_cont &= ~DC_HPD5_INTERRUPT; 2776 disp_int_cont &= ~DC_HPD5_INTERRUPT;
2772 DRM_INFO("IH: HPD5\n"); 2777 queue_hotplug = true;
2778 DRM_DEBUG("IH: HPD5\n");
2773 } 2779 }
2774 break; 2780 break;
2775 case 12: 2781 case 12:
2776 if (disp_int_cont2 & DC_HPD6_INTERRUPT) { 2782 if (disp_int_cont2 & DC_HPD6_INTERRUPT) {
2777 disp_int_cont &= ~DC_HPD6_INTERRUPT; 2783 disp_int_cont &= ~DC_HPD6_INTERRUPT;
2778 DRM_INFO("IH: HPD6\n"); 2784 queue_hotplug = true;
2785 DRM_DEBUG("IH: HPD6\n");
2779 } 2786 }
2780 break; 2787 break;
2781 default: 2788 default:
@@ -2807,6 +2814,8 @@ restart_ih:
2807 wptr = r600_get_ih_wptr(rdev); 2814 wptr = r600_get_ih_wptr(rdev);
2808 if (wptr != rdev->ih.wptr) 2815 if (wptr != rdev->ih.wptr)
2809 goto restart_ih; 2816 goto restart_ih;
2817 if (queue_hotplug)
2818 queue_work(rdev->wq, &rdev->hotplug_work);
2810 rdev->ih.rptr = rptr; 2819 rdev->ih.rptr = rptr;
2811 WREG32(IH_RB_RPTR, rdev->ih.rptr); 2820 WREG32(IH_RB_RPTR, rdev->ih.rptr);
2812 spin_unlock_irqrestore(&rdev->ih.lock, flags); 2821 spin_unlock_irqrestore(&rdev->ih.lock, flags);