From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>, stable@vger.kernel.org
Subject: [PATCH 8/8] drm/i915/psr: Don't clip plane state destination rectangle
Date: Tue, 29 Sep 2026 12:44:34 +0300 [thread overview]
Message-ID: <20260929094434.77129-9-jouni.hogander@intel.com> (raw)
In-Reply-To: <20260929094434.77129-1-jouni.hogander@intel.com>
clip_area_update() uses drm_rect_intersect which modifies passed r1
rectangle. Early transport alignment passes the cursor uapi.dst rectangle
to clip_area_update, so the cursor uapi.dst is unintentionally modified by
drm_rect_intersect.
Fix this by using local copy in clip_area_update(). Also make the damage
and the display area const.
Fixes: 1bff93b8bc27 ("drm/i915/psr: Extend SU area to cover cursor fully if needed")
Cc: <stable@vger.kernel.org> # v6.9+
Assisted-by: GitHub-Copilot:claude-opus-5
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
drivers/gpu/drm/i915/display/intel_psr.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index d8fefb13c2790..99603a486c278 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2709,23 +2709,25 @@ static u32 psr2_pipe_srcsz_early_tpt_calc(struct intel_crtc_state *crtc_state,
}
static void clip_area_update(struct drm_rect *overlap_damage_area,
- struct drm_rect *damage_area,
- struct drm_rect *display_area)
+ const struct drm_rect *damage_area,
+ const struct drm_rect *display_area)
{
- if (!drm_rect_intersect(damage_area, display_area))
+ struct drm_rect inter = *damage_area;
+
+ if (!drm_rect_intersect(&inter, display_area))
return;
if (overlap_damage_area->y1 == -1) {
- overlap_damage_area->y1 = damage_area->y1;
- overlap_damage_area->y2 = damage_area->y2;
+ overlap_damage_area->y1 = inter.y1;
+ overlap_damage_area->y2 = inter.y2;
return;
}
- if (damage_area->y1 < overlap_damage_area->y1)
- overlap_damage_area->y1 = damage_area->y1;
+ if (inter.y1 < overlap_damage_area->y1)
+ overlap_damage_area->y1 = inter.y1;
- if (damage_area->y2 > overlap_damage_area->y2)
- overlap_damage_area->y2 = damage_area->y2;
+ if (inter.y2 > overlap_damage_area->y2)
+ overlap_damage_area->y2 = inter.y2;
}
static bool intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
--
2.43.0
next prev parent reply other threads:[~2026-09-29 9:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 9:44 [PATCH 0/8] Selective fetch calculation fixes Jouni Högander
2026-09-29 9:44 ` [PATCH 1/8] drm/i915/psr: Clear selective fetch area when duplicating plane state Jouni Högander
2026-09-29 9:44 ` [PATCH 2/8] drm/i915/display: Add enabled pipe planes into state for selective fetch Jouni Högander
2026-09-29 9:44 ` [PATCH 3/8] drm/i915/psr: Disable linked plane sel fetch as well Jouni Högander
2026-09-29 9:44 ` [PATCH 4/8] drm/i915/psr: Fix SFF and CFF CTL register bit definitions Jouni Högander
2026-09-29 9:44 ` [PATCH 5/8] drm/i915/psr: Skip sel fetch support check for invisible planes Jouni Högander
2026-09-29 9:44 ` [PATCH 6/8] drm/i915/psr: Don't write 0 size area into plane sel fetch area registers Jouni Högander
2026-09-29 9:44 ` [PATCH 7/8] drm/i915/psr: Remove drm_info_once on failed selective fetch area Jouni Högander
2026-09-29 9:44 ` Jouni Högander [this message]
2026-09-29 9:53 ` ✓ CI.KUnit: success for Selective fetch calculation fixes Patchwork
2026-09-29 10:39 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-29 12:11 ` ✗ 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=20260929094434.77129-9-jouni.hogander@intel.com \
--to=jouni.hogander@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox