All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/i915: Enable fastset by default, except on initial modeset
Date: Mon, 17 Dec 2018 15:23:15 +0100	[thread overview]
Message-ID: <20181217142315.4267-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20181217142315.4267-1-hdegoede@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

We may not be perfect at reading out the initial mode, but when the mode
is sanitized by our first modeset we know for sure the state is compatible,
so we can compare with intel_pipe_config_compare.

Changes in v2 (Hans de Goede):
-When checking if we need to reset the mode (initial modeset), check
 I915_MODE_FLAG_INHERITED is set in private_flags instead of
 private_flags != 0

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c2980643a1a5..071954d255c6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12501,6 +12501,22 @@ static int calc_watermark_data(struct drm_atomic_state *state)
 	return 0;
 }
 
+static bool can_fastset(struct drm_i915_private *dev_priv,
+			struct intel_crtc_state *old_crtc_state,
+			struct intel_crtc_state *new_crtc_state)
+{
+	bool reset_mode =
+		(old_crtc_state->base.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
+		!(new_crtc_state->base.mode.private_flags & I915_MODE_FLAG_INHERITED);
+
+	/* Without fastboot, we always want to modeset the initial mode. */
+	if (reset_mode && !i915_modparams.fastboot)
+		return false;
+
+	return intel_pipe_config_compare(dev_priv, old_crtc_state,
+					 new_crtc_state, true);
+}
+
 /**
  * intel_atomic_check - validate state object
  * @dev: drm device
@@ -12531,6 +12547,8 @@ static int intel_atomic_check(struct drm_device *dev,
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, crtc_state, i) {
 		struct intel_crtc_state *pipe_config =
 			to_intel_crtc_state(crtc_state);
+		struct intel_crtc_state *old_intel_crtc_state =
+			to_intel_crtc_state(old_crtc_state);
 
 		if (!needs_modeset(crtc_state))
 			continue;
@@ -12547,10 +12565,7 @@ static int intel_atomic_check(struct drm_device *dev,
 			return ret;
 		}
 
-		if (i915_modparams.fastboot &&
-		    intel_pipe_config_compare(dev_priv,
-					to_intel_crtc_state(old_crtc_state),
-					pipe_config, true)) {
+		if (can_fastset(dev_priv, old_intel_crtc_state, pipe_config)) {
 			crtc_state->mode_changed = false;
 			pipe_config->update_pipe = true;
 		}
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-12-17 14:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 14:23 [PATCH 0/1] drm/i915: Enable fastset by default, except on initial modeset Hans de Goede
2018-12-17 14:23 ` Hans de Goede [this message]
2018-12-17 14:29   ` [PATCH] " Daniel Vetter
2018-12-17 14:34     ` Hans de Goede
2018-12-17 14:38 ` [PATCH 0/1] " Ville Syrjälä
2018-12-17 14:58   ` Hans de Goede
2018-12-17 15:22 ` ✓ Fi.CI.BAT: success for drm/i915: Enable fastset by default, except on initial modeset (rev2) Patchwork
2018-12-17 17:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-12-17 18:43 ` [PATCH 0/1] drm/i915: Enable fastset by default, except on initial modeset Rodrigo Vivi
2018-12-18 16:07   ` Hans de Goede
2018-12-18 18:21     ` Rodrigo Vivi
  -- strict thread matches above, loose matches on Subject: below --
2018-05-16 10:38 [PATCH] " Maarten Lankhorst

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=20181217142315.4267-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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.