All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Subject: [PATCH 19/35] drm/i915: Don't modeset with old mode when set_crtc fails
Date: Tue, 21 Apr 2015 17:13:08 +0300	[thread overview]
Message-ID: <1429625604-22252-20-git-send-email-ander.conselvan.de.oliveira@intel.com> (raw)
In-Reply-To: <1429625604-22252-1-git-send-email-ander.conselvan.de.oliveira@intel.com>

The modeset code is now properly divided in two phases, so that it only
changes hardware state if it succeeds, so there's no ill-effect that
needs to be undone on failure anymore.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 48 ------------------------------------
 1 file changed, 48 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 083cf23..902870a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12699,33 +12699,9 @@ intel_modeset_stage_output_state(struct drm_device *dev,
 	return 0;
 }
 
-static void disable_crtc_nofb(struct intel_crtc *crtc)
-{
-	struct drm_device *dev = crtc->base.dev;
-	struct intel_encoder *encoder;
-	struct intel_connector *connector;
-
-	DRM_DEBUG_KMS("Trying to restore without FB -> disabling pipe %c\n",
-		      pipe_name(crtc->pipe));
-
-	for_each_intel_connector(dev, connector) {
-		if (connector->new_encoder &&
-		    connector->new_encoder->new_crtc == crtc)
-			connector->new_encoder = NULL;
-	}
-
-	for_each_intel_encoder(dev, encoder) {
-		if (encoder->new_crtc == crtc)
-			encoder->new_crtc = NULL;
-	}
-
-	crtc->new_enabled = false;
-}
-
 static int intel_crtc_set_config(struct drm_mode_set *set)
 {
 	struct drm_device *dev;
-	struct drm_mode_set save_set;
 	struct drm_atomic_state *state = NULL;
 	struct intel_set_config *config;
 	struct intel_crtc_state *pipe_config;
@@ -12758,12 +12734,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
 	if (ret)
 		goto out_config;
 
-	save_set.crtc = set->crtc;
-	save_set.mode = &set->crtc->mode;
-	save_set.x = set->crtc->x;
-	save_set.y = set->crtc->y;
-	save_set.fb = set->crtc->primary->fb;
-
 	state = drm_atomic_state_alloc(dev);
 	if (!state) {
 		ret = -ENOMEM;
@@ -12847,24 +12817,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
 			      set->crtc->base.id, ret);
 fail:
 		intel_set_config_restore_state(dev, config);
-
-		drm_atomic_state_clear(state);
-
-		/*
-		 * HACK: if the pipe was on, but we didn't have a framebuffer,
-		 * force the pipe off to avoid oopsing in the modeset code
-		 * due to fb==NULL. This should only happen during boot since
-		 * we don't yet reconstruct the FB from the hardware state.
-		 */
-		if (to_intel_crtc(save_set.crtc)->new_enabled && !save_set.fb)
-			disable_crtc_nofb(to_intel_crtc(save_set.crtc));
-
-		/* Try to restore the config */
-		if (config->mode_changed &&
-		    intel_set_mode(save_set.crtc, save_set.mode,
-				   save_set.x, save_set.y, save_set.fb,
-				   state))
-			DRM_ERROR("failed to restore config after modeset failure\n");
 	}
 
 out_config:
-- 
2.1.0

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

  parent reply	other threads:[~2015-04-21 14:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 14:12 [PATCH 00/35] Make legacy modeset a lot more atomic-like Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 01/35] drm/i915: Remove implicitly disabling primary plane for now Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 02/35] drm/i915: Add a way to disable planes without updating state Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 03/35] drm/i915: Use the disable callback for disabling planes Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 04/35] drm/i915: get rid of primary_enabled and use atomic state Ander Conselvan de Oliveira
2015-05-07  7:43   ` Daniel Vetter
2015-04-21 14:12 ` [PATCH 05/35] drm/i915: Move intel_(pre_disable/post_enable)_primary to intel_display.c, and use it there Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 06/35] drm/i915: Rename intel_crtc_dpms_overlay Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 07/35] drm/i915: Move toggling planes out of crtc enable/disable Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 08/35] drm/i915: Don't check for NULL before freeing state Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 09/35] drm/i915: Call drm helpers when duplicating crtc and plane states Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 10/35] drm/i915: Use for_each_connector_in_state helper macro Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 11/35] drm/i915: Extract mode_changed computation out of stage_output_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 12/35] drm/i915: Add crtc states before calling compute_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 13/35] drm/i915: Don't pretend we can calculate multiple pipe_configs Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 14/35] drm/i915: Calculate a new pipe_config based on new enabled state Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 15/35] drm/i915: Remove all *_pipes flags from modeset Ander Conselvan de Oliveira
2015-05-28 16:35   ` Chris Wilson
2015-05-29 11:28     ` [PATCH] drm/i915: Silence compiler warning Ander Conselvan de Oliveira
2015-05-29 17:06       ` Daniel Vetter
2015-04-21 14:13 ` [PATCH 16/35] drm/i915: Remove saved_mode from __intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 17/35] drm/i915: Move compute part of __intel_set_mode() to separate function Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 18/35] drm/i915: Simplify error handling in __intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` Ander Conselvan de Oliveira [this message]
2015-04-21 14:13 ` [PATCH 20/35] drm/i915: Add primary plane to atomic state in legacy modeset Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 21/35] drm/i915: Delete fb, x and y parameters from mode set functions Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 22/35] drm/i915: Don't use struct intel_set_config *_changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 23/35] drm/i915: Don't use staged config to calculate mode_changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 24/35] drm/i915: Unify modeset and flip paths of intel_crtc_set_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 25/35] drm/i915: Simplify intel_set_config_compute_mode_changes() a bit Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 26/35] drm/i915: Stage new modeset state straight into atomic state Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 27/35] drm/i915: Remove save/restore logic from intel_crtc_set_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 28/35] drm/i915: Update crtc state active flag based on DPMS Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 29/35] drm/atomic: Make mode_fixup() optional for check_modeset() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 30/35] drm/i915: Use atomic helpers for computing changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 31/35] drm/i915: Take ownership of atomic state on success in intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 32/35] drm/i915: Preserve shared DPLL information in new pipe_config Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 33/35] drm/i915: Don't use plane update helper in legacy mode set Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 34/35] drm/i915: Swap atomic state in legacy modeset Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 35/35] drm/i915: Get rid of intel_crtc_set_state() Ander Conselvan de Oliveira
2015-04-21 15:21 ` [PATCH 00/35] Make legacy modeset a lot more atomic-like Maarten Lankhorst
2015-05-07  8:16   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429625604-22252-20-git-send-email-ander.conselvan.de.oliveira@intel.com \
    --to=ander.conselvan.de.oliveira@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.