[PATCH 08/11] drm/i915: Remove saved_mode from __intel_set_mode()

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

 



There's no way that function can fail after it sets crtc->mode anymore,
so there's no need to save the old mode for the failure case.
---
 drivers/gpu/drm/i915/intel_display.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a255b24..af3439a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11595,7 +11595,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct drm_display_mode *saved_mode;
 	struct drm_atomic_state *state = pipe_config->base.state;
 	struct intel_crtc_state *crtc_state_copy = NULL;
 	struct intel_crtc *intel_crtc;
@@ -11603,18 +11602,12 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 	int ret = 0;
 	int i;
 
-	saved_mode = kmalloc(sizeof(*saved_mode), GFP_KERNEL);
-	if (!saved_mode)
-		return -ENOMEM;
-
 	crtc_state_copy = kmalloc(sizeof(*crtc_state_copy), GFP_KERNEL);
 	if (!crtc_state_copy) {
 		ret = -ENOMEM;
 		goto done;
 	}
 
-	*saved_mode = crtc->mode;
-
 	/*
 	 * See if the config requires any additional preparation, e.g.
 	 * to adjust global state with pipes off.  We need to do this
@@ -11698,9 +11691,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 
 	/* FIXME: add subpixel order */
 done:
-	if (ret && crtc->state->enable)
-		crtc->mode = *saved_mode;
-
 	if (ret == 0 && pipe_config) {
 		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
@@ -11714,7 +11704,6 @@ done:
 		kfree(crtc_state_copy);
 	}
 
-	kfree(saved_mode);
 	return ret;
 }
 
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





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