From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
"Sandy Huang" <hjc@rock-chips.com>,
"Heiko Stübner" <heiko@sntech.de>,
"Andy Yan" <andy.yan@rock-chips.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Daniel Stone <daniels@collabora.com>
Subject: Re: [PATCH v2 2/8] drm/rockchip: vop2: Switch impossible pos conditional to WARN_ON
Date: Tue, 20 Jan 2026 13:52:30 +0100 [thread overview]
Message-ID: <956a5ead-cc3b-41de-8431-2f03aaee3c71@suse.de> (raw)
In-Reply-To: <20251206-vop2-atomic-fixups-v2-2-7fb45bbfbebd@collabora.com>
Hi
Am 06.12.25 um 21:45 schrieb Nicolas Frattaroli:
> From: Daniel Stone <daniels@collabora.com>
>
> We already clip the plane to the display bounds in atomic_check, and
> ensure that it is sufficiently sized. Instead of trying to catch this
> and adjust for it in atomic_update, just assert that atomic_check has
> done its job.
>
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> ---
> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 29 +++++++++-------------------
> 1 file changed, 9 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index 20b49209ddcd..81b3eba07095 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1214,28 +1214,17 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
> src_w = drm_rect_width(src) >> 16;
> src_h = drm_rect_height(src) >> 16;
> dsp_w = drm_rect_width(dest);
> -
> - if (dest->x1 + dsp_w > adjusted_mode->hdisplay) {
> - drm_dbg_kms(vop2->drm,
> - "vp%d %s dest->x1[%d] + dsp_w[%d] exceed mode hdisplay[%d]\n",
> - vp->id, win->data->name, dest->x1, dsp_w, adjusted_mode->hdisplay);
> - dsp_w = adjusted_mode->hdisplay - dest->x1;
> - if (dsp_w < 4)
> - dsp_w = 4;
> - src_w = dsp_w * src_w / drm_rect_width(dest);
> - }
> -
> dsp_h = drm_rect_height(dest);
>
> - if (dest->y1 + dsp_h > adjusted_mode->vdisplay) {
> - drm_dbg_kms(vop2->drm,
> - "vp%d %s dest->y1[%d] + dsp_h[%d] exceed mode vdisplay[%d]\n",
> - vp->id, win->data->name, dest->y1, dsp_h, adjusted_mode->vdisplay);
> - dsp_h = adjusted_mode->vdisplay - dest->y1;
> - if (dsp_h < 4)
> - dsp_h = 4;
> - src_h = dsp_h * src_h / drm_rect_height(dest);
> - }
> + /* drm_atomic_helper_check_plane_state calls drm_rect_clip_scaled for
> + * us, which keeps our planes bounded within the CRTC active area
> + */
> + WARN_ON(dest->x1 + dsp_w > adjusted_mode->hdisplay);
> + WARN_ON(dest->y1 + dsp_h > adjusted_mode->vdisplay);
> + WARN_ON(dsp_w < 4);
> + WARN_ON(dsp_h < 4);
> + WARN_ON(src_w < 4);
> + WARN_ON(src_h < 4);
This should also use drm_WARN_ON(). But maybe rather leave it out
entirely? I don't remember having seen other drivers to re-test in
atomic_update.
Best regards
Thomas
>
> /*
> * This is workaround solution for IC design:
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-01-20 12:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 20:45 [PATCH v2 0/8] drm/rockchip: No more post-atomic_check fixups Nicolas Frattaroli
2025-12-06 20:45 ` [PATCH v2 1/8] drm/rockchip: vop2: Switch impossible format conditional to WARN_ON Nicolas Frattaroli
2026-01-20 12:49 ` Thomas Zimmermann
2026-01-20 12:57 ` Nicolas Frattaroli
2025-12-06 20:45 ` [PATCH v2 2/8] drm/rockchip: vop2: Switch impossible pos " Nicolas Frattaroli
2026-01-20 12:52 ` Thomas Zimmermann [this message]
2025-12-06 20:45 ` [PATCH v2 3/8] drm/rockchip: vop2: Fix Esmart test condition Nicolas Frattaroli
2026-01-20 12:58 ` Thomas Zimmermann
2025-12-06 20:45 ` [PATCH v2 4/8] drm/rockchip: vop2: Enforce scaling workaround in plane_check Nicolas Frattaroli
2025-12-06 20:45 ` [PATCH v2 5/8] drm/rockchip: vop2: Enforce AFBC source alignment " Nicolas Frattaroli
2025-12-08 2:48 ` Chaoyi Chen
2025-12-08 7:24 ` Nicolas Frattaroli
2025-12-09 10:58 ` Nicolas Frattaroli
2025-12-11 11:06 ` Chaoyi Chen
2025-12-11 14:16 ` Nicolas Frattaroli
2025-12-12 9:59 ` Chaoyi Chen
2026-01-20 12:47 ` Andy Yan
2026-01-20 10:35 ` Daniel Stone
2025-12-06 20:45 ` [PATCH v2 6/8] drm/rockchip: vop2: Enforce AFBC transform stride align " Nicolas Frattaroli
2025-12-06 20:45 ` [PATCH v2 7/8] drm/rockchip: vop2: Use drm_is_afbc helper function Nicolas Frattaroli
2025-12-06 20:45 ` [PATCH v2 8/8] drm/rockchip: vop2: Simplify format_mod_supported Nicolas Frattaroli
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=956a5ead-cc3b-41de-8431-2f03aaee3c71@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=simona@ffwll.ch \
/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
all inboxes | Powered by JetHome®