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 8/9] drm/i915/scaler: move CASF alloc check into intel_atomic_setup_scaler()
Date: Wed, 10 Jun 2026 01:12:16 +0200 [thread overview]
Message-ID: <20260609231217.208357-9-michal.grzelak@intel.com> (raw)
In-Reply-To: <20260609231217.208357-1-michal.grzelak@intel.com>
Move CASF allocation check into only caller of intel_allocate_scaler().
Allocate scaler as usual if CASF was not requested. Remove casf_scaler
from intel_allocate_scaler()'s argument list. Also remove intel_display
as both are no longer used.
Benefits of doing so are not clearly visible as it is a mid-step for
moving the check to the caller again.
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 | 27 ++++++++++-------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index b3c6376c8603..b40c9e500bbc 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -333,22 +333,10 @@ static bool scaler_has_casf(struct intel_display *display, int scaler_id)
}
static int intel_allocate_scaler(struct intel_crtc_scaler_state *scaler_state,
- struct intel_crtc *crtc,
- bool casf_scaler)
+ struct intel_crtc *crtc)
{
- struct intel_display *display = to_intel_display(crtc);
int scaler_id;
- if (casf_scaler) {
- if (HAS_CASF(display) && crtc->num_scalers >= 2 &&
- !scaler_state->scalers[1].in_use) {
- scaler_state->scalers[1].in_use = true;
- return 1;
- }
-
- return -1;
- }
-
for (scaler_id = 0; scaler_id < crtc->num_scalers; scaler_id++) {
if (!scaler_state->scalers[scaler_id].in_use) {
scaler_state->scalers[scaler_id].in_use = true;
@@ -409,8 +397,17 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,
int hscale = 0;
int vscale = 0;
- if (*scaler_id < 0)
- *scaler_id = intel_allocate_scaler(scaler_state, crtc, casf_scaler);
+ if (*scaler_id < 0) {
+ if (casf_scaler) {
+ if (HAS_CASF(display) && crtc->num_scalers >= 2 &&
+ !scaler_state->scalers[1].in_use) {
+ scaler_state->scalers[1].in_use = true;
+ *scaler_id = 1;
+ }
+ } else {
+ *scaler_id = intel_allocate_scaler(scaler_state, crtc);
+ }
+ }
if (drm_WARN(display->drm, *scaler_id < 0,
"Cannot find scaler for %s:%d\n", name, idx))
--
2.45.2
next prev 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 ` [PATCH v1 4/9] drm/i915/scaler: move independent CASF check Michał Grzelak
2026-06-10 14:20 ` 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 ` Michał Grzelak [this message]
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-9-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