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 13/35] drm/i915: Don't pretend we can calculate multiple pipe_configs
Date: Tue, 21 Apr 2015 17:13:02 +0300	[thread overview]
Message-ID: <1429625604-22252-14-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 code in intel_modeset_pipe_config() still needs changes before it
can calculate more than just one pipe_config, and pretending it can will
only make those changes more difficult.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e6e7c63..d1253b1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11310,33 +11310,29 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
 	crtc_state->scaler_state = scaler_state;
 }
 
-static struct intel_crtc_state *
+static int
 intel_modeset_pipe_config(struct drm_crtc *crtc,
 			  struct drm_display_mode *mode,
-			  struct drm_atomic_state *state)
+			  struct drm_atomic_state *state,
+			  struct intel_crtc_state *pipe_config)
 {
 	struct intel_encoder *encoder;
 	struct drm_connector *connector;
 	struct drm_connector_state *connector_state;
-	struct intel_crtc_state *pipe_config;
 	int base_bpp, ret = -EINVAL;
 	int i;
 	bool retry = true;
 
 	if (!check_encoder_cloning(state, to_intel_crtc(crtc))) {
 		DRM_DEBUG_KMS("rejecting invalid cloning configuration\n");
-		return ERR_PTR(-EINVAL);
+		return -EINVAL;
 	}
 
 	if (!check_digital_port_conflicts(state)) {
 		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
-		return ERR_PTR(-EINVAL);
+		return -EINVAL;
 	}
 
-	pipe_config = intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));
-	if (IS_ERR(pipe_config))
-		return pipe_config;
-
 	clear_intel_crtc_state(pipe_config);
 
 	pipe_config->base.crtc = crtc;
@@ -11433,9 +11429,9 @@ encoder_retry:
 	DRM_DEBUG_KMS("plane bpp: %i, pipe bpp: %i, dithering: %i\n",
 		      base_bpp, pipe_config->pipe_bpp, pipe_config->dither);
 
-	return pipe_config;
+	return 0;
 fail:
-	return ERR_PTR(ret);
+	return ret;
 }
 
 /* Computes which crtcs are affected and sets the relevant bits in the mask. For
@@ -12116,9 +12112,7 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
 			     unsigned *prepare_pipes,
 			     unsigned *disable_pipes)
 {
-	struct drm_device *dev = crtc->dev;
-	struct intel_crtc_state *pipe_config = NULL;
-	struct intel_crtc *intel_crtc;
+	struct intel_crtc_state *pipe_config;
 	int ret = 0;
 
 	ret = drm_atomic_add_affected_connectors(state, crtc);
@@ -12134,21 +12128,20 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
 	 * (i.e. one pipe_config for each crtc) rather than just the one
 	 * for this crtc.
 	 */
-	for_each_intel_crtc_masked(dev, *modeset_pipes, intel_crtc) {
-		/* FIXME: For now we still expect modeset_pipes has at most
-		 * one bit set. */
-		if (WARN_ON(&intel_crtc->base != crtc))
-			continue;
+	pipe_config = intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));
+	if (IS_ERR(pipe_config))
+		return pipe_config;
 
-		pipe_config = intel_modeset_pipe_config(crtc, mode, state);
-		if (IS_ERR(pipe_config))
-			return pipe_config;
+	if (!(*modeset_pipes & (1 << to_intel_crtc(crtc)->pipe)))
+		return pipe_config;
 
-		intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
-				       "[modeset]");
-	}
+	ret = intel_modeset_pipe_config(crtc, mode, state, pipe_config);
+	if (ret)
+		return ERR_PTR(ret);
+
+	intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,"[modeset]");
 
-	return intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));;
+	return pipe_config;
 }
 
 static int __intel_set_mode_setup_plls(struct drm_atomic_state *state,
-- 
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 ` Ander Conselvan de Oliveira [this message]
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 ` [PATCH 19/35] drm/i915: Don't modeset with old mode when set_crtc fails Ander Conselvan de Oliveira
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-14-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.