Fix intermittent hotplug lost issue because of page flip.
authorHu Tiger Chen <hu.tiger.chen@intel.com>
Mon, 30 Jan 2012 22:17:20 +0000 (00:17 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:29:39 +0000 (12:29 +0300)
Since the DRM page flip mechanism keeps updatign the crtc->fb member
with the current fb to be flipped, this gets out-of-sync with the
psb_fb_helper->fb member. In the event of a HDMI hotplug, this mismatch
causes the HDMI hotplug event to be deferred and never handled. Ensure
that we are keeping both the members in sync always during flip.

Signed-off-by: Arun Kannan <arun.kannan@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_page_flip.c

index 1548a02..3df0436 100644 (file)
@@ -219,6 +219,8 @@ psb_intel_crtc_page_flip(struct drm_crtc *crtc,
        PVRSRV_KERNEL_MEM_INFO *new_fb_mem_info, *current_fb_mem_info;
        struct pending_flip *new_pending_flip;
        struct psb_fpriv *priv;
+       struct drm_device *dev = crtc->dev;
+       struct psb_fbdev *fbdev = NULL;
        unsigned long flags;
        struct pvr_trcmd_flpreq *fltrace;
 
@@ -244,6 +246,14 @@ psb_intel_crtc_page_flip(struct drm_crtc *crtc,
 
        current_fb_mem_info = get_fb_meminfo(crtc->fb);
 
+       /* In page flip, change the psb_fb_helper.fb to the swapped fb.*/
+       if (dev->dev_private)
+               fbdev = ((struct drm_psb_private *)dev->dev_private)->fbdev;
+       if (fbdev)
+               fbdev->psb_fb_helper.fb = fb;
+       else
+               printk(KERN_ALERT "%s cannot find the fb\n", __func__);
+
        crtc->fb = fb;
 
        new_pending_flip->old_mem_info = current_fb_mem_info;