mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andy Yan" <andyshrk@163.com>
To: "Heiko Stübner" <heiko@sntech.de>
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:Re: [PATCH] drm/rockchip: vop2: Add mode valid callback for crtc
Date: Sat, 17 Jan 2026 10:09:55 +0800 (CST)	[thread overview]
Message-ID: <5e931108.71d.19bc9b75cdf.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <6509513.iIbC2pHGDl@diego>


Hello Heiko,

在 2026-01-17 00:49:23,"Heiko Stübner" <heiko@sntech.de> 写道:
>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] ....
>


Sorry, I forgot that this patch had already been sent out once before

>> 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 :-)

Done in V2


>
>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,
>> 
>
>
>
>

      reply	other threads:[~2026-01-17  2:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  0:59 Andy Yan
2026-01-16 16:49 ` Heiko Stübner
2026-01-17  2:09   ` Andy Yan [this message]

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=5e931108.71d.19bc9b75cdf.Coremail.andyshrk@163.com \
    --to=andyshrk@163.com \
    --cc=airlied@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --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

all inboxes | Powered by JetHome®