[PATCH 4/7] drm/i915: Use a custom restore_fbdev_mode hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrj?l? <ville.syrjala at linux.intel.com>

Disable sprite planes and cursors when restoring the fbdev mode.
This is actually only needed in case the modeset gets optimized into a
set_base, but that's a fairly important case these days.

Should makes oopses more readable if they're not covered by spriteas and
cursors.

Signed-off-by: Ville Syrj?l? <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_fb.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 57a082c..a9e9fc0 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -183,11 +183,26 @@ out:
 	return ret;
 }
 
+static bool intel_fb_restore_fbdev_mode(struct drm_fb_helper *helper)
+{
+	struct drm_device *dev = helper->dev;
+	bool ret;
+
+	ret = drm_fb_helper_restore_fbdev_mode(helper);
+	if (ret)
+		DRM_DEBUG("failed to restore crtc mode\n");
+
+	/* in case we ended up doing just set_base above */
+	intel_disable_cursors_and_sprites(dev);
+
+	return ret;
+}
+
 static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
 	.gamma_set = intel_crtc_fb_gamma_set,
 	.gamma_get = intel_crtc_fb_gamma_get,
 	.fb_probe = intelfb_create,
-	.restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
+	.restore_fbdev_mode = intel_fb_restore_fbdev_mode,
 };
 
 static void intel_fbdev_destroy(struct drm_device *dev,
@@ -279,7 +294,6 @@ void intel_fb_output_poll_changed(struct drm_device *dev)
 
 void intel_fb_restore_mode(struct drm_device *dev)
 {
-	int ret;
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
 	if (INTEL_INFO(dev)->num_pipes == 0)
@@ -287,12 +301,7 @@ void intel_fb_restore_mode(struct drm_device *dev)
 
 	drm_modeset_lock_all(dev);
 
-	ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
-	if (ret)
-		DRM_DEBUG("failed to restore crtc mode\n");
-
-	/* in case we ended up doing just set_base above */
-	intel_disable_cursors_and_sprites(dev);
+	intel_fb_restore_fbdev_mode(&dev_priv->fbdev->helper);
 
 	drm_modeset_unlock_all(dev);
 }
-- 
1.8.1.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux