From: "Heiko Stübner" <heiko@sntech.de>
To: Andy Yan <andyshrk@163.com>
Cc: hjc@rock-chips.com, mripard@kernel.org,
maarten.lankhorst@linux.intel.com, tzimmermann@suse.de,
airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH] drm/rockchip: vop2: Add mode valid callback for crtc
Date: Fri, 16 Jan 2026 17:49:23 +0100 [thread overview]
Message-ID: <6509513.iIbC2pHGDl@diego> (raw)
In-Reply-To: <20260116005953.286225-1-andyshrk@163.com>
Hi Andy,
Am Freitag, 16. Januar 2026, 01:59:49 Mitteleuropäische Normalzeit schrieb Andy Yan:
> From: Andy Yan <andy.yan@rock-chips.com>
when resending an unmodified patch, please mark the subject as
[PATCH RESEND] ....
> Filter the mode that can't output by the crtc.
In commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities") which introduced the similar check on VOP(1), we
had additional information, in that the VOP1 hardware does not have
an output height limit. Is the same true for VOP2 ?
Because then I'd like to extend the commit description to something like:
======= 8< =======
The different VOP variants support different maximum resolutions. Reject
resolutions that are not supported by a specific variant.
Only the output width is checked because the hardware itself does not
have a hard output height limit.
======= 8< =======
Because when someone sees the code later they might ask why the height
is not checked, so having that in the commit description allows us all to
remember why the check is this specific way :-)
Thanks
Heiko
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index 498df0ce4680..74fba29bfff3 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1439,6 +1439,17 @@ static void vop2_crtc_disable_vblank(struct drm_crtc *crtc)
> vop2_crtc_disable_irq(vp, VP_INT_FS_FIELD);
> }
>
> +static enum drm_mode_status vop2_crtc_mode_valid(struct drm_crtc *crtc,
> + const struct drm_display_mode *mode)
> +{
> + struct vop2_video_port *vp = to_vop2_video_port(crtc);
> +
> + if (mode->hdisplay > vp->data->max_output.width)
> + return MODE_BAD_HVALUE;
> +
> + return MODE_OK;
> +}
> +
> static bool vop2_crtc_mode_fixup(struct drm_crtc *crtc,
> const struct drm_display_mode *mode,
> struct drm_display_mode *adj_mode)
> @@ -1884,6 +1895,7 @@ static void vop2_crtc_atomic_flush(struct drm_crtc *crtc,
>
> static const struct drm_crtc_helper_funcs vop2_crtc_helper_funcs = {
> .mode_fixup = vop2_crtc_mode_fixup,
> + .mode_valid = vop2_crtc_mode_valid,
> .atomic_check = vop2_crtc_atomic_check,
> .atomic_begin = vop2_crtc_atomic_begin,
> .atomic_flush = vop2_crtc_atomic_flush,
>
next prev parent reply other threads:[~2026-01-16 16:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 0:59 [PATCH] drm/rockchip: vop2: Add mode valid callback for crtc Andy Yan
2026-01-16 16:49 ` Heiko Stübner [this message]
2026-01-17 2:09 ` Andy Yan
-- strict thread matches above, loose matches on Subject: below --
2026-01-09 0:58 Andy Yan
2026-01-20 11:03 ` Daniel Stone
2026-01-20 11:24 ` Daniel Stone
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=6509513.iIbC2pHGDl@diego \
--to=heiko@sntech.de \
--cc=airlied@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=andyshrk@163.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hjc@rock-chips.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=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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