[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPj87rO45oAihxRhshwvP=9N6oDtd+yRN-R4M3=TsFYmwjr1cA@mail.gmail.com>
Date: Mon, 15 Dec 2025 17:57:07 +0000
From: Daniel Stone <daniel@...ishbar.org>
To: David Laight <david.laight.linux@...il.com>
Cc: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>, Sandy Huang <hjc@...k-chips.com>,
Heiko Stübner <heiko@...ech.de>,
Andy Yan <andy.yan@...k-chips.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Chaoyi Chen <chaoyi.chen@...k-chips.com>, dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-rockchip@...ts.infradead.org,
linux-kernel@...r.kernel.org, Daniel Stone <daniels@...labora.com>, kernel@...labora.com
Subject: Re: [PATCH v4 2/8] drm/rockchip: vop2: Switch impossible pos
conditional to WARN_ON
Hi,
On Thu, 11 Dec 2025 at 22:41, David Laight <david.laight.linux@...il.com> wrote:
> On Thu, 11 Dec 2025 21:40:32 +0100
> Nicolas Frattaroli <nicolas.frattaroli@...labora.com> wrote:
> > - 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);
>
> You need to do something when the tests fail.
> Carrying on regardless is never right.
When we arrive at this point, because the load-bearing assumption in
the comment has not been met, our options would be:
* display random incorrect content, and hope that we aren't reading
out of bounds from a buffer that's too small
* turn the display off
* there is no third option
Which are you suggesting?
Cheers,
Daniel
Powered by blists - more mailing lists