Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Grzelak" <michal.grzelak@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Michał Grzelak" <michal.grzelak@intel.com>,
	"Nemesa Garg" <nemesa.garg@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH v1 4/9] drm/i915/scaler: move independent CASF check
Date: Wed, 10 Jun 2026 01:12:12 +0200	[thread overview]
Message-ID: <20260609231217.208357-5-michal.grzelak@intel.com> (raw)
In-Reply-To: <20260609231217.208357-1-michal.grzelak@intel.com>

First clause of CASF check is independent of any loop iteration and
causes intel_allocate_scaler() to fail when satisfied. Check it before
entering the loop.

Cc: Nemesa Garg <nemesa.garg@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 drivers/gpu/drm/i915/display/skl_scaler.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index f2216a9ea3f8..59a5a3cd3e6a 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -339,12 +339,14 @@ static int intel_allocate_scaler(struct intel_crtc_scaler_state *scaler_state,
 	struct intel_display *display = to_intel_display(crtc);
 	int scaler_id;
 
+	if (casf_scaler && !HAS_CASF(display))
+		return -1;
+
 	for (scaler_id = 0; scaler_id < crtc->num_scalers; scaler_id++) {
 		if (scaler_state->scalers[scaler_id].in_use)
 			continue;
 
-		if ((casf_scaler && !HAS_CASF(display)) ||
-		    (casf_scaler && scaler_id != 1))
+		if (casf_scaler && scaler_id != 1)
 			continue;
 
 		scaler_state->scalers[scaler_id].in_use = true;
-- 
2.45.2


  parent reply	other threads:[~2026-06-09 23:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 23:12 [PATCH v1 0/9] drm/i915/scaler: allocation cleanup Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 1/9] drm/i915/scaler: remove unused plane_state argument Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 2/9] drm/i915/scaler: s/i/scaler_id/ Michał Grzelak
2026-06-15  5:14   ` Garg, Nemesa
2026-06-09 23:12 ` [PATCH v1 3/9] drm/i915/scaler: de-Morgan-ize !scaler_has_casf() Michał Grzelak
2026-06-09 23:12 ` Michał Grzelak [this message]
2026-06-10 14:20   ` [PATCH v1 4/9] drm/i915/scaler: move independent CASF check Jani Nikula
2026-06-09 23:12 ` [PATCH v1 5/9] drm/i915/scaler: check CASF before allocation's loop Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 6/9] drm/i915/scaler: inline CASF scaler allocation Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 7/9] drm/i915/scaler: linearize " Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 8/9] drm/i915/scaler: move CASF alloc check into intel_atomic_setup_scaler() Michał Grzelak
2026-06-09 23:12 ` [PATCH v1 9/9] drm/i915/scaler: move CASF alloc check into setup_crtc_scaler() Michał Grzelak
2026-06-10  5:29   ` Garg, Nemesa
2026-06-10  9:43 ` ✗ i915.CI.BAT: failure for drm/i915/scaler: allocation cleanup Patchwork
2026-06-10 12:44 ` [PATCH v1 0/9] " Ville Syrjälä
2026-06-10 22:59   ` Michał Grzelak

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=20260609231217.208357-5-michal.grzelak@intel.com \
    --to=michal.grzelak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=nemesa.garg@intel.com \
    --cc=ville.syrjala@linux.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