Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nemesa Garg <nemesa.garg@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ville.syrjala@intel.com, uma.shankar@intel.com,
	Nemesa Garg <nemesa.garg@intel.com>
Subject: [PATCH 1/5] drm/i915/display: Move casf_compute_config
Date: Tue,  9 Dec 2025 11:55:23 +0530	[thread overview]
Message-ID: <20251209062527.620382-2-nemesa.garg@intel.com> (raw)
In-Reply-To: <20251209062527.620382-1-nemesa.garg@intel.com>

Prefill calculations are getting screwed up as casf_compute
is getting called in later stage. So move casf_compute_config
to crtc_compute_config and check if there is a change in the
sharpness strength, if so set the flag uapi.mode_changed
so that everytime when strength changes casf_compute_config
can be called and new strength value gets updated.

Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
 drivers/gpu/drm/i915/display/intel_casf.c    | 14 ++++++++++++++
 drivers/gpu/drm/i915/display/intel_casf.h    |  3 +++
 drivers/gpu/drm/i915/display/intel_display.c | 10 ++++++----
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 95339b496f24..6e45ff7d5ff7 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -288,3 +288,17 @@ void intel_casf_disable(const struct intel_crtc_state *crtc_state)
 	intel_de_write(display, SHARPNESS_CTL(crtc->pipe), 0);
 	intel_de_write(display, SKL_PS_WIN_SZ(crtc->pipe, 1), 0);
 }
+
+void intel_casf_check(struct intel_atomic_state *state)
+{
+	int i;
+	struct intel_crtc_state *old_crtc_state, *new_crtc_state;
+	struct intel_crtc *crtc;
+
+	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
+					    new_crtc_state, i) {
+		if (new_crtc_state->uapi.sharpness_strength !=
+		    old_crtc_state->uapi.sharpness_strength)
+			new_crtc_state->uapi.mode_changed = true;
+	}
+}
diff --git a/drivers/gpu/drm/i915/display/intel_casf.h b/drivers/gpu/drm/i915/display/intel_casf.h
index b3fb0bcb3f5b..2eec90d9d4c4 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.h
+++ b/drivers/gpu/drm/i915/display/intel_casf.h
@@ -9,6 +9,8 @@
 #include <linux/types.h>
 
 struct intel_crtc_state;
+struct intel_atomic_state;
+struct intel_crtc;
 
 int intel_casf_compute_config(struct intel_crtc_state *crtc_state);
 void intel_casf_update_strength(struct intel_crtc_state *new_crtc_state);
@@ -17,5 +19,6 @@ void intel_casf_enable(struct intel_crtc_state *crtc_state);
 void intel_casf_disable(const struct intel_crtc_state *crtc_state);
 void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state);
 bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state);
+void intel_casf_check(struct intel_atomic_state *state);
 
 #endif /* __INTEL_CASF_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 9c6d3ecdb589..882ea286fc9c 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2494,6 +2494,10 @@ static int intel_crtc_compute_config(struct intel_atomic_state *state,
 
 	intel_vrr_compute_guardband(crtc_state);
 
+	ret = intel_casf_compute_config(crtc_state);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
@@ -4286,10 +4290,6 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
 		return ret;
 	}
 
-	ret = intel_casf_compute_config(crtc_state);
-	if (ret)
-		return ret;
-
 	if (DISPLAY_VER(display) >= 9) {
 		if (intel_crtc_needs_modeset(crtc_state) ||
 		    intel_crtc_needs_fastset(crtc_state) ||
@@ -6435,6 +6435,8 @@ int intel_atomic_check(struct drm_device *dev,
 
 	intel_vrr_check_modeset(state);
 
+	intel_casf_check(state);
+
 	ret = drm_atomic_helper_check_modeset(dev, &state->base);
 	if (ret)
 		goto fail;
-- 
2.25.1


  reply	other threads:[~2025-12-09  6:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09  6:25 [PATCH 0/5] Make casf updates atomic and dsb ready Nemesa Garg
2025-12-09  6:25 ` Nemesa Garg [this message]
2025-12-12 15:51   ` [PATCH 1/5] drm/i915/display: Move casf_compute_config Ville Syrjälä
2025-12-09  6:25 ` [PATCH 2/5] drm/i915/display: Add intel_dsb param to CASF helpers Nemesa Garg
2025-12-09  6:25 ` [PATCH 3/5] drm/i915/display: Pass dsb_commit " Nemesa Garg
2025-12-12 16:34   ` Ville Syrjälä
2025-12-16 14:59     ` Garg, Nemesa
2025-12-17  3:10       ` Garg, Nemesa
2025-12-09  6:25 ` [PATCH 4/5] drm/i915/display: Add intel_casf_arm() to enable casf Nemesa Garg
2025-12-09  6:25 ` [PATCH 5/5] drm/i915/display: Introduce skl_pipe_scaler_setup() Nemesa Garg
2025-12-09  6:36 ` ✓ CI.KUnit: success for Make casf updates atomic and dsb ready Patchwork
2025-12-09  7:10 ` ✓ Xe.CI.BAT: " Patchwork
2025-12-09 13:31 ` ✗ Xe.CI.Full: failure " 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=20251209062527.620382-2-nemesa.garg@intel.com \
    --to=nemesa.garg@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox