Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp21953rdb; Thu, 21 Dec 2023 01:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2BQ8x6U4AA4dLIMcHzEOy7pvQuqmSq5NJvPX1Wc2+RlUzPH2RjLBJw61eYxr5M6r5mdMg X-Received: by 2002:a17:906:fa1b:b0:a23:6248:e987 with SMTP id lo27-20020a170906fa1b00b00a236248e987mr3110609ejb.42.1703150551288; Thu, 21 Dec 2023 01:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703150551; cv=none; d=google.com; s=arc-20160816; b=UUJQ5r0BZbWtPcsZBWdw912VCGzp13Z2amQyrgTBCdddK1rhWXNOSBGdjKWCY71Ow4 Tml4yuzicDAthp/HWLchdF7A5TKn4MeQ5oK8tL09AaZvLRlK36IdYq5azILq8zd+PtMX u63ADzo0r94Mn0+RpR6qnPM5Mpj0HoCIY1jv/tEBY5A1pFlacSlQHez87gnjjFk7Cqm8 vf3K74iOOZemWQwCOhszL44V90mCR05J6MMnT8+/Y0Nwr7NvB/hJuc84t1fW18N1rhz7 T3z3iXjFvalJ8i7oHTPsaPDFnsS6GVIevlJIF0eqx2pw+ogZuF3ASi2dEgmxNpzOFPQw Vh/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eXrUM/StRfIKFOZvvGI9aIADBVTv0EhJau0PRCf5i8I=; fh=gnxnKoqUjnmFyajegA06D+GRzVUaV5WntHK7cRtHO8Y=; b=oGIE5J2wy8thfF5f146WWURiLzG8D9pWrgmie3P0P5424nOcU3MjceT80Z9XPSIBEg iwHDZO3s7UQRTn0svYy3fMqbx6K62V8/xuZe0VsTl05J6bBOniSzxzht2DSloxP2rtaH 4uRJOqYR0RNS40xQ+bzsoQ2eH5+4sIV9lb1JHM3AJmixNVKIomXScdyX+PjIr9wKGRWv pqpL3JMs3IuhQ6KgIdCfdT2a3Q3A/VUipzVI+SDAdjKW8vOEe0qck5aRHUns1759aXVg DfvKjt5PtVB2zuzse8UYI9uj34+q+E4+OsD7RdKrhX8Gw/VRiWHpljUnnW5zOQRywobd XXdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b856BG6L; spf=pass (google.com: domain of linux-kernel+bounces-8091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f12-20020a170906560c00b00a22fb471e3asi664021ejq.1005.2023.12.21.01.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 01:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b856BG6L; spf=pass (google.com: domain of linux-kernel+bounces-8091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D3FC91F212F3 for ; Thu, 21 Dec 2023 09:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DE05481BA; Thu, 21 Dec 2023 09:07:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b856BG6L" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF2A8446A2 for ; Thu, 21 Dec 2023 09:07:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8BAAC433C8; Thu, 21 Dec 2023 09:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703149626; bh=e4HwI+rYcJHOJPcuJl4AqF12SZkaucHI/9Vovq6T6p8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b856BG6L9vLS0sdCXBgb52Gt/Pt4sqc+2n2ncutFNWVGpa3KsxOb01pBpalzXQ/1m jPzxgTVD8CtRJTrcunmi7c3f0smXiR2+O2+uEx8e4M6iLXfvbb5PeHncqjArNYmclK lEKUemErrE0JOuQv5OQ9xNHh+Qy3T9Gsy0yT1Jg3SJOZ66xqjYMUJOzWqXk8hjsdE4 p746EmlkTIaqEN54KIp2WjlFuCYvhi3LJ4ShAFuL+Qu8Jwa9OttanUZhwjCe8pY5pf Zbv4lpw8PgS2QweswLZ4Dn+i5+7Ads+HdObObzi9QCITFtlG5AZMKFw4Cv/AOaZ31I YuhgD45wOJ1Yw== Date: Thu, 21 Dec 2023 10:07:03 +0100 From: Maxime Ripard To: Johan Jonker 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 Message-ID: References: <410b116b-cb63-7ba7-3689-4f0832ab5796@gmail.com> <4aeef6df-2616-0741-00a3-6e45ec63f920@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6x4c6jydyzhxy4vm" Content-Disposition: inline In-Reply-To: <4aeef6df-2616-0741-00a3-6e45ec63f920@gmail.com> --6x4c6jydyzhxy4vm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote: >=20 >=20 > On 12/19/23 13:55, Maxime Ripard wrote: > > Hi, > >=20 > > 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 > >=20 >=20 > > 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. >=20 > Rockchip RK3066 CRTC and connector resolution max_output are equivalent. >=20 > From Rockchip PX2 TRM V1.0.pdf page 17: > - Video Encoder > Maximum frame rate is up to 30fps@1920x1080 >=20 > - Display Interface > Support LCD or TFT interfaces up to 1920x1080 >=20 > - HDMI TX Interface > HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant tra= nsmitter > Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UX= GA by LCDC0 or LCDC1 in RK PX2 My point is that there's two limits: the CRTC and HDMI controller ones. You should put the CRTC ones in the CRTC driver, and the HDMI controller ones in the HDMI controller driver. If they are equivalent, great, it's going to filter out the same things, bu= t... > Compared to the drm_helper_probe_single_connector_modes() this function a= dded an extra max_output >=20 > Checked in rockchip_drm_vop.c is: > https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pe= ngutronix.de/ >=20 > + if (vop->data->max_output.width && mode->hdisplay > vop->data->max_outp= ut.width) > + return MODE_BAD_HVALUE; > + > + if (vop->data->max_output.height && mode->vdisplay > vop->data->max_out= put.height) > + return MODE_BAD_VVALUE; >=20 > For RK3066 VOP max_output: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d= rivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506 >=20 > This patch was made with HDMI in mind. >=20 > .max_output =3D { 1920, 1080 }, >=20 > This first part was added by Heiko, but not was not part my patch that I = submitted: > - if (maxX > 1920) > - maxX =3D 1920; > - if (maxY > 1080) > - maxY =3D 1080; > - > - return drm_helper_probe_single_connector_modes(connector, maxX, maxY); > -} >=20 > Original patch: > https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6= 244@gmail.com >=20 > +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); > +} >=20 > Rockchip RK3066 CRTC and connector resolution max_output are equivalent. =2E.. a user / dev unfamiliar with the SoC won't have to go through that to figure out how it's handled, it will be obvious. Maxime --6x4c6jydyzhxy4vm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZYQANwAKCRDj7w1vZxhR xSAjAQC/cny6EDPS6Yo2LIqQuLPlGA1yohiqkZolkGVOCEB3rgEA+W93tTlZ5lV2 ZZIvJUVxNMzYtlqJpZ9Tk7HKVNiPegk= =tcho -----END PGP SIGNATURE----- --6x4c6jydyzhxy4vm--