diff mbox

[2/2] drm/fb_helper: move deferred fb checking into restore mode

Message ID 1416971843-2122-2-git-send-email-airlied@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Airlie Nov. 26, 2014, 3:17 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

On MST systems the monitors don't appear when we set the fb up,
but plymouth opens the drm device and holds it open while they
come up, when plymouth finishes and lastclose gets called we
don't do the delayed fb probe, so the monitor never appears on the
console.

Fix this by moving the delayed checking into the mode restore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Daniel Vetter Nov. 26, 2014, 7:39 a.m. UTC | #1
On Wed, Nov 26, 2014 at 01:17:23PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> On MST systems the monitors don't appear when we set the fb up,
> but plymouth opens the drm device and holds it open while they
> come up, when plymouth finishes and lastclose gets called we
> don't do the delayed fb probe, so the monitor never appears on the
> console.
> 
> Fix this by moving the delayed checking into the mode restore.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index c7f2778..8ba36cf 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -350,6 +350,11 @@ bool drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
>  	drm_modeset_lock_all(dev);
>  	ret = restore_fbdev_mode(fb_helper);
>  	drm_modeset_unlock_all(dev);
> +
> +	if (fb_helper->delayed_hotplug) {
> +		fb_helper->delayed_hotplug = false;
> +		drm_fb_helper_hotplug_event(fb_helper);

Preexisting bug but ->delayed_hotplug is protected in the hotplug handler
by mode_config.mutex. But fixing that will get annoying so not sure if
it's worth it. Just wrapping the access with the lock shouldn't hurt
though I think.
-Daniel

> +	}
>  	return ret;
>  }
>  EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode_unlocked);
> @@ -888,10 +893,6 @@ int drm_fb_helper_set_par(struct fb_info *info)
>  
>  	drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
>  
> -	if (fb_helper->delayed_hotplug) {
> -		fb_helper->delayed_hotplug = false;
> -		drm_fb_helper_hotplug_event(fb_helper);
> -	}
>  	return 0;
>  }
>  EXPORT_SYMBOL(drm_fb_helper_set_par);
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Shuang He Nov. 26, 2014, 5:37 p.m. UTC | #2
Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                                  366/366              366/366
ILK                 -2              371/371              369/371
SNB                                  450/450              450/450
IVB                                  498/498              498/498
BYT                                  289/289              289/289
HSW                 -1              564/564              563/564
BDW                                  417/417              417/417
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
 ILK  igt_gem_reset_stats_close-pending-fork-render      TIMEOUT(22, M37M26)PASS(1, M26)      TIMEOUT(1, M37)
 ILK  igt_kms_flip_vblank-vs-hang      TIMEOUT(21, M37M26)PASS(1, M26)      TIMEOUT(1, M37)
*HSW  igt_kms_fence_pin_leak      PASS(6, M20M19)      DMESG_WARN(1, M19)
Note: You need to pay more attention to line start with '*'
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index c7f2778..8ba36cf 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -350,6 +350,11 @@  bool drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
 	drm_modeset_lock_all(dev);
 	ret = restore_fbdev_mode(fb_helper);
 	drm_modeset_unlock_all(dev);
+
+	if (fb_helper->delayed_hotplug) {
+		fb_helper->delayed_hotplug = false;
+		drm_fb_helper_hotplug_event(fb_helper);
+	}
 	return ret;
 }
 EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode_unlocked);
@@ -888,10 +893,6 @@  int drm_fb_helper_set_par(struct fb_info *info)
 
 	drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
 
-	if (fb_helper->delayed_hotplug) {
-		fb_helper->delayed_hotplug = false;
-		drm_fb_helper_hotplug_event(fb_helper);
-	}
 	return 0;
 }
 EXPORT_SYMBOL(drm_fb_helper_set_par);