public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
From: Johan Jonker <jbx6244@gmail.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com,
	maarten.lankhorst@linux.intel.com, tzimmermann@suse.de,
	airlied@gmail.com, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
Date: Tue, 19 Dec 2023 16:40:12 +0100	[thread overview]
Message-ID: <4aeef6df-2616-0741-00a3-6e45ec63f920@gmail.com> (raw)
In-Reply-To: <evaq3yfbqf4gchsps2qoojemtii7tmcss24aruiuze5kkzlnhy@mih7rky7viqz>



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/

+	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
+		return MODE_BAD_HVALUE;
+
+	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
+		return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

	.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I submitted:
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+					 uint32_t maxX, uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2023-12-19 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 15:47 [PATCH v2 0/2] Rockchip rk3066_hdmi update Johan Jonker
2023-12-18 15:48 ` [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer Johan Jonker
2023-12-19 12:53   ` Maxime Ripard
2023-12-18 15:49 ` [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook Johan Jonker
2023-12-19 12:55   ` Maxime Ripard
2023-12-19 15:40     ` Johan Jonker [this message]
2023-12-21  9:07       ` Maxime Ripard

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=4aeef6df-2616-0741-00a3-6e45ec63f920@gmail.com \
    --to=jbx6244@gmail.com \
    --cc=airlied@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=daniel@ffwll.ch \
    --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=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