drm/amdgpu: Call pageflip irq funtion when receiced vsync interrupt.
authorEmily Deng <Emily.Deng@amd.com>
Mon, 8 Aug 2016 03:36:07 +0000 (11:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Aug 2016 18:11:48 +0000 (14:11 -0400)
For virtual display feature, as there is no dce engine, so no pageflip irq
generated. So directly call pageflip irq funtion when received vysn interrupt.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/dce_virtual.c

index ace52a342e644d47df8a3d2531ff667ff25fd341..1c16983ec8b63fd972c90936d1da13c6ebfab53b 100644 (file)
@@ -36,6 +36,9 @@
 
 static void dce_virtual_set_display_funcs(struct amdgpu_device *adev);
 static void dce_virtual_set_irq_funcs(struct amdgpu_device *adev);
+static int dce_virtual_pageflip_irq(struct amdgpu_device *adev,
+                                 struct amdgpu_irq_src *source,
+                                 struct amdgpu_iv_entry *entry);
 
 /**
  * dce_virtual_vblank_wait - vblank wait asic callback.
@@ -650,6 +653,7 @@ static enum hrtimer_restart dce_virtual_vblank_timer_handle(struct hrtimer *vbla
        unsigned crtc = 0;
        adev->ddev->vblank[0].count++;
        drm_handle_vblank(adev->ddev, crtc);
+       dce_virtual_pageflip_irq(adev, NULL, NULL);
        hrtimer_start(vblank_timer, ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD), HRTIMER_MODE_REL);
        return HRTIMER_NORESTART;
 }
@@ -706,8 +710,8 @@ static void dce_virtual_crtc_vblank_int_ack(struct amdgpu_device *adev,
 }
 
 static int dce_virtual_crtc_irq(struct amdgpu_device *adev,
-                             struct amdgpu_irq_src *source,
-                             struct amdgpu_iv_entry *entry)
+                             struct amdgpu_irq_src *source,
+                             struct amdgpu_iv_entry *entry)
 {
        unsigned crtc = 0;
        unsigned irq_type = AMDGPU_CRTC_IRQ_VBLANK1;
@@ -718,7 +722,7 @@ static int dce_virtual_crtc_irq(struct amdgpu_device *adev,
        if (amdgpu_irq_enabled(adev, source, irq_type)) {
                drm_handle_vblank(adev->ddev, crtc);
        }
-
+       dce_virtual_pageflip_irq(adev, NULL, NULL);
        DRM_DEBUG("IH: D%d vblank\n", crtc + 1);
        return 0;
 }