All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, Sam Ravnborg <sam@ravnborg.org>,
	Emil Velikov <emil.l.velikov@gmail.com>
Subject: [PATCH v4 13/16] drm/i915: Replace I915_MODE_FLAG_INHERITED with a boolean
Date: Wed, 29 Apr 2020 13:39:36 +0300	[thread overview]
Message-ID: <20200429103936.11850-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20200428171940.19552-14-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

There's no reason for I915_MODE_FLAG_INHERITED to exist as a flag
anymore. Just make it a boolean.

v2: Deal with sanitize_watermarks()

CC: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c     |  2 +-
 drivers/gpu/drm/i915/display/intel_display.c    | 17 +++++++----------
 .../gpu/drm/i915/display/intel_display_types.h  |  2 +-
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 5863e339a426..2deafaa9ec74 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -249,10 +249,10 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
 	crtc_state->update_wm_post = false;
 	crtc_state->fifo_changed = false;
 	crtc_state->preload_luts = false;
+	crtc_state->inherited = false;
 	crtc_state->wm.need_postvbl_update = false;
 	crtc_state->fb_bits = 0;
 	crtc_state->update_planes = 0;
-	crtc_state->mode_flags &= ~I915_MODE_FLAG_INHERITED;
 
 	return &crtc_state->uapi;
 }
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 8a2c0686eeb2..d126c6ca1d13 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6424,8 +6424,7 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_s
 	 * We can't read out IPS on broadwell, assume the worst and
 	 * forcibly enable IPS on the first fastset.
 	 */
-	if (new_crtc_state->update_pipe &&
-	    old_crtc_state->mode_flags & I915_MODE_FLAG_INHERITED)
+	if (new_crtc_state->update_pipe && old_crtc_state->inherited)
 		return true;
 
 	return !old_crtc_state->ips_enabled;
@@ -13544,8 +13543,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
 	bool ret = true;
 	u32 bp_gamma = 0;
 	bool fixup_inherited = fastset &&
-		(current_config->mode_flags & I915_MODE_FLAG_INHERITED) &&
-		!(pipe_config->mode_flags & I915_MODE_FLAG_INHERITED);
+		current_config->inherited && !pipe_config->inherited;
 
 	if (fixup_inherited && !fastboot_enabled(dev_priv)) {
 		drm_dbg_kms(&dev_priv->drm,
@@ -14697,10 +14695,9 @@ static int intel_atomic_check(struct drm_device *dev,
 	int ret, i;
 	bool any_ms = false;
 
-	/* Catch I915_MODE_FLAG_INHERITED */
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
-		if (new_crtc_state->mode_flags != old_crtc_state->mode_flags)
+		if (new_crtc_state->inherited != old_crtc_state->inherited)
 			new_crtc_state->uapi.mode_changed = true;
 	}
 
@@ -15046,7 +15043,7 @@ static void intel_update_crtc(struct intel_atomic_state *state,
 	 * of enabling them on the CRTC's first fastset.
 	 */
 	if (new_crtc_state->update_pipe && !modeset &&
-	    old_crtc_state->mode_flags & I915_MODE_FLAG_INHERITED)
+	    old_crtc_state->inherited)
 		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
 }
 
@@ -17377,7 +17374,7 @@ static int sanitize_watermarks_add_affected(struct drm_atomic_state *state)
 			 * Preserve the inherited flag to avoid
 			 * taking the full modeset path.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 		}
 	}
 
@@ -17527,7 +17524,7 @@ static int intel_initial_commit(struct drm_device *dev)
 			 * happen only for the first real commit from userspace.
 			 * So preserve the inherited flag for the time being.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 
 			ret = drm_atomic_add_affected_planes(state, &crtc->base);
 			if (ret)
@@ -18299,7 +18296,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 			 * set a flag to indicate that a full recalculation is
 			 * needed on the next commit.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 
 			intel_crtc_compute_pixel_rate(crtc_state);
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 40c65274210b..36ef9e144bae 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -644,7 +644,6 @@ struct intel_crtc_scaler_state {
 };
 
 /* {crtc,crtc_state}->mode_flags */
-#define I915_MODE_FLAG_INHERITED (1<<0)
 /* Flag to get scanline using frame time stamps */
 #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1)
 /* Flag to use the scanline counter instead of the pixel counter */
@@ -839,6 +838,7 @@ struct intel_crtc_state {
 	bool update_wm_pre, update_wm_post; /* watermarks are updated */
 	bool fifo_changed; /* FIFO split is changed */
 	bool preload_luts;
+	bool inherited; /* state inherited from BIOS? */
 
 	/* Pipe source size (ie. panel fitter input size)
 	 * All planes will be positioned inside this space,
-- 
2.24.1

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

WARNING: multiple messages have this Message-ID (diff)
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, Sam Ravnborg <sam@ravnborg.org>
Subject: [Intel-gfx] [PATCH v4 13/16] drm/i915: Replace I915_MODE_FLAG_INHERITED with a boolean
Date: Wed, 29 Apr 2020 13:39:36 +0300	[thread overview]
Message-ID: <20200429103936.11850-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20200428171940.19552-14-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

There's no reason for I915_MODE_FLAG_INHERITED to exist as a flag
anymore. Just make it a boolean.

v2: Deal with sanitize_watermarks()

CC: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c     |  2 +-
 drivers/gpu/drm/i915/display/intel_display.c    | 17 +++++++----------
 .../gpu/drm/i915/display/intel_display_types.h  |  2 +-
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 5863e339a426..2deafaa9ec74 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -249,10 +249,10 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
 	crtc_state->update_wm_post = false;
 	crtc_state->fifo_changed = false;
 	crtc_state->preload_luts = false;
+	crtc_state->inherited = false;
 	crtc_state->wm.need_postvbl_update = false;
 	crtc_state->fb_bits = 0;
 	crtc_state->update_planes = 0;
-	crtc_state->mode_flags &= ~I915_MODE_FLAG_INHERITED;
 
 	return &crtc_state->uapi;
 }
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 8a2c0686eeb2..d126c6ca1d13 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6424,8 +6424,7 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_s
 	 * We can't read out IPS on broadwell, assume the worst and
 	 * forcibly enable IPS on the first fastset.
 	 */
-	if (new_crtc_state->update_pipe &&
-	    old_crtc_state->mode_flags & I915_MODE_FLAG_INHERITED)
+	if (new_crtc_state->update_pipe && old_crtc_state->inherited)
 		return true;
 
 	return !old_crtc_state->ips_enabled;
@@ -13544,8 +13543,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
 	bool ret = true;
 	u32 bp_gamma = 0;
 	bool fixup_inherited = fastset &&
-		(current_config->mode_flags & I915_MODE_FLAG_INHERITED) &&
-		!(pipe_config->mode_flags & I915_MODE_FLAG_INHERITED);
+		current_config->inherited && !pipe_config->inherited;
 
 	if (fixup_inherited && !fastboot_enabled(dev_priv)) {
 		drm_dbg_kms(&dev_priv->drm,
@@ -14697,10 +14695,9 @@ static int intel_atomic_check(struct drm_device *dev,
 	int ret, i;
 	bool any_ms = false;
 
-	/* Catch I915_MODE_FLAG_INHERITED */
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
-		if (new_crtc_state->mode_flags != old_crtc_state->mode_flags)
+		if (new_crtc_state->inherited != old_crtc_state->inherited)
 			new_crtc_state->uapi.mode_changed = true;
 	}
 
@@ -15046,7 +15043,7 @@ static void intel_update_crtc(struct intel_atomic_state *state,
 	 * of enabling them on the CRTC's first fastset.
 	 */
 	if (new_crtc_state->update_pipe && !modeset &&
-	    old_crtc_state->mode_flags & I915_MODE_FLAG_INHERITED)
+	    old_crtc_state->inherited)
 		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
 }
 
@@ -17377,7 +17374,7 @@ static int sanitize_watermarks_add_affected(struct drm_atomic_state *state)
 			 * Preserve the inherited flag to avoid
 			 * taking the full modeset path.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 		}
 	}
 
@@ -17527,7 +17524,7 @@ static int intel_initial_commit(struct drm_device *dev)
 			 * happen only for the first real commit from userspace.
 			 * So preserve the inherited flag for the time being.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 
 			ret = drm_atomic_add_affected_planes(state, &crtc->base);
 			if (ret)
@@ -18299,7 +18296,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 			 * set a flag to indicate that a full recalculation is
 			 * needed on the next commit.
 			 */
-			crtc_state->mode_flags |= I915_MODE_FLAG_INHERITED;
+			crtc_state->inherited = true;
 
 			intel_crtc_compute_pixel_rate(crtc_state);
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 40c65274210b..36ef9e144bae 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -644,7 +644,6 @@ struct intel_crtc_scaler_state {
 };
 
 /* {crtc,crtc_state}->mode_flags */
-#define I915_MODE_FLAG_INHERITED (1<<0)
 /* Flag to get scanline using frame time stamps */
 #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1)
 /* Flag to use the scanline counter instead of the pixel counter */
@@ -839,6 +838,7 @@ struct intel_crtc_state {
 	bool update_wm_pre, update_wm_post; /* watermarks are updated */
 	bool fifo_changed; /* FIFO split is changed */
 	bool preload_luts;
+	bool inherited; /* state inherited from BIOS? */
 
 	/* Pipe source size (ie. panel fitter input size)
 	 * All planes will be positioned inside this space,
-- 
2.24.1

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

  reply	other threads:[~2020-04-29 10:39 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 17:19 [PATCH v3 00/16] drm: Put drm_display_mode on diet Ville Syrjala
2020-04-28 17:19 ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 01/16] drm: Nuke mode->hsync Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 02/16] drm/i915: Introduce some local intel_dp variables Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 03/16] drm: Nuke mode->vrefresh Ville Syrjala
2020-04-28 17:19   ` Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19   ` Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 04/16] drm/msm/dpu: Stop copying around mode->private_flags Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19   ` Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 05/16] drm: Shrink {width,height}_mm to u16 Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 06/16] drm: Shrink mode->type to u8 Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 07/16] drm: Make mode->flags u32 Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 08/16] drm: Shrink drm_display_mode timings Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 09/16] drm: Flatten drm_mode_vrefresh() Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 10/16] drm: pahole struct drm_display_mode Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 11/16] drm/mcde: Use mode->clock instead of reverse calculating it from the vrefresh Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 12/16] drm/i915: Stop using mode->private_flags Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-29 10:39   ` [PATCH v4 " Ville Syrjala
2020-04-29 10:39     ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 13/16] drm/i915: Replace I915_MODE_FLAG_INHERITED with a boolean Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-29 10:39   ` Ville Syrjala [this message]
2020-04-29 10:39     ` [Intel-gfx] [PATCH v4 " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 14/16] drm/gma500: Stop using mode->private_flags Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 15/16] drm: Nuke mode->private_flags Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-28 17:19 ` [PATCH v3 16/16] drm: Replace mode->export_head with a boolean Ville Syrjala
2020-04-28 17:19   ` [Intel-gfx] " Ville Syrjala
2020-04-30 13:50   ` Emil Velikov
2020-04-30 13:50     ` [Intel-gfx] " Emil Velikov
2020-09-01 10:58     ` Ville Syrjälä
2020-09-01 10:58       ` [Intel-gfx] " Ville Syrjälä
2020-04-28 19:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Put drm_display_mode on diet (rev4) Patchwork
2020-04-28 20:26 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-04-29 11:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Put drm_display_mode on diet (rev6) Patchwork
2020-04-29 12:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-04-29 15:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=20200429103936.11850-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sam@ravnborg.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.