MUST REVERT: Fix the video slowness issue when unplug HDMI.
authorHu Tiger Chen <hu.tiger.chen@intel.com>
Wed, 29 Feb 2012 14:18:28 +0000 (06:18 -0800)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:19 +0000 (12:30 +0300)
This is caused by the pending flips left in psb_intel_crtc.
After HDMI unplug, vblank interrupt will never be triggered,
where actually pending flips are handled. The solution is to
handle the HDMI pending flips in vblank handler of local display.

ISSUE: ANDROID-1463

Signed-off-by: Mohan Kandra <mohan.b.kandra@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_page_flip.c

index 80b5304..a05b840 100644 (file)
@@ -344,8 +344,8 @@ void psb_page_flip_crtc_fini(struct psb_intel_crtc *psb_intel_crtc)
        drm_flip_helper_fini(&psb_intel_crtc->flip_helper);
 }
 
-void
-psb_intel_crtc_process_vblank(struct drm_crtc *crtc)
+static void
+psb_intel_crtc_process_vblank_real(struct drm_crtc *crtc)
 {
        struct drm_psb_private *dev_priv = crtc->dev->dev_private;
        struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
@@ -365,6 +365,40 @@ psb_intel_crtc_process_vblank(struct drm_crtc *crtc)
        drm_flip_helper_vblank(&psb_intel_crtc->flip_helper);
 }
 
+void
+psb_intel_crtc_process_vblank(struct drm_crtc *crtc)
+{
+       struct drm_psb_private *dev_priv = crtc->dev->dev_private;
+       struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
+       int pipe = psb_intel_crtc->pipe;
+       struct drm_connector *connector;
+       struct drm_crtc *hdmicrtc = NULL;
+
+       psb_intel_crtc_process_vblank_real(crtc);
+
+       /* This following is to handle HDMI pending flips if unplug the cable
+        * After HDMI is unpluged, there is no vblank interrupt anymore.
+        * But there may be some pending flips exists in psb_intel_crtc.
+        * We need complet the pending flips.
+        * This can be REVERTED, if the pending flip issue fixed.
+        */
+       if (pipe != 0)
+               return;
+
+       hdmicrtc = dev_priv->pipe_to_crtc_mapping[1];
+       if (!hdmicrtc)
+               return;
+
+       list_for_each_entry(connector,
+                       &crtc->dev->mode_config.connector_list, head) {
+               if (connector->connector_type == DRM_MODE_CONNECTOR_DVID &&
+                       connector->status == connector_status_disconnected) {
+                       psb_intel_crtc_process_vblank_real(hdmicrtc);
+                       break;
+               }
+       }
+}
+
 static void
 sync_callback(struct pvr_pending_sync *pending_sync, bool from_misr)
 {