From fcc2fdfb479becd58703654d78b67f2c3120d3d3 Mon Sep 17 00:00:00 2001 From: Hu Tiger Chen Date: Tue, 31 Jan 2012 00:17:20 +0200 Subject: [PATCH] Fix intermittent hotplug lost issue because of page flip. 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 Signed-off-by: Kirill A. Shutemov --- drivers/staging/mrst/drv/psb_page_flip.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mrst/drv/psb_page_flip.c b/drivers/staging/mrst/drv/psb_page_flip.c index 1548a02..3df0436 100644 --- a/drivers/staging/mrst/drv/psb_page_flip.c +++ b/drivers/staging/mrst/drv/psb_page_flip.c @@ -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; -- 2.7.4