From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6EEEC5AE4A for ; Thu, 16 Nov 2023 07:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mhBfmMkv2sEWsaEcxk5zkmS+P9m56gGIXUaSOYWLJ6A=; b=qYp/8Y0U5xV5C4 58h/xlm2vMf2OZaS/7pBmcTLiAizN3MNGOkbVRNjX7V56BG1GGfs7/l8wNdL1N60CWRyHpLb8iQMZ Lux4hSmKsCgJd+WPV7h/dHnr9SowE0mxcpgBuRPKQ+/5h1uX1GcVk/ZAcaw9Glnz0ZRQiJ1CxSzru qfQirTYh+gxyUIHI3ZbvteXITGbVAdhlrzQbLzSHVEvKOi7az1r0NyqCQjEUKd/tyORsQh3US7aF+ tx5chD23tCvvqhIorCYotEu9ZxqobjW+LTMW9Xfsk70HglGbahGu5Ba5iCr9stVnUyyY7vhx9vamC GLuiokwS1bqbnu/sQ3vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3X8r-002neI-35; Thu, 16 Nov 2023 07:50:25 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3X8o-002ndU-2r for linux-rockchip@lists.infradead.org; Thu, 16 Nov 2023 07:50:24 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3X8l-0007e8-Pq; Thu, 16 Nov 2023 08:50:19 +0100 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3X8h-009P0C-AH; Thu, 16 Nov 2023 08:50:15 +0100 Received: from sha by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1r3X8h-002J9d-7Q; Thu, 16 Nov 2023 08:50:15 +0100 Date: Thu, 16 Nov 2023 08:50:15 +0100 From: Sascha Hauer To: Andy Yan Cc: Andy Yan , heiko@sntech.de, hjc@rock-chips.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, kever.yang@rock-chips.com, chris.obbard@collabora.com Subject: Re: [PATCH 09/11] drm/rockchip: vop2: Add support for rk3588 Message-ID: <20231116075015.GG3359458@pengutronix.de> References: <20231114112534.1770731-1-andyshrk@163.com> <20231114112855.1771372-1-andyshrk@163.com> <20231115090823.GY3359458@pengutronix.de> <229557d7-beec-44e0-9ee6-4a962b33ec79@rock-chips.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <229557d7-beec-44e0-9ee6-4a962b33ec79@rock-chips.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_235022_941800_A82CE09E X-CRM114-Status: GOOD ( 32.73 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Thu, Nov 16, 2023 at 03:24:54PM +0800, Andy Yan wrote: > > case ROCKCHIP_VOP2_EP_HDMI0: > > case ROCKCHIP_VOP2_EP_HDMI1: > > ... > > } > > = > > would look a bit better overall. > > = > > > + /* > > > + * K =3D 2: dclk_core =3D if_pixclk_rate > if_dclk_rate > > > + * K =3D 1: dclk_core =3D hdmie_edp_dclk > if_pixclk_rate > > > + */ > > > + if (output_mode =3D=3D ROCKCHIP_OUT_MODE_YUV420) { > > > + dclk_rate =3D dclk_rate >> 1; > > > + K =3D 2; > > > + } > > > + > > > + if_pixclk_rate =3D (dclk_core_rate << 1) / K; > > > + if_dclk_rate =3D dclk_core_rate / K; > > > + > > > + *if_pixclk_div =3D dclk_rate / if_pixclk_rate; > > > + *if_dclk_div =3D dclk_rate / if_dclk_rate; > > Not sure if this will change with future extensions, but currently > > *if_pixclk_div will always be 2 and *if_dclk_div will alway be 4, > > so maybe better write it like this > = > = > Yes, the calculation of *if_pixclk_div is always 2 and *if_dclk_div is al= ways 4, > = > I think calculation formula can give us a clear explanation why is 2 or 4. > = > considering the great power of rk3588, i think it can calculate it very e= asy. Sure it can. My concern is not the CPU time it takes to do that equation, but more the readability of the code. For me as a reader it might be more easily acceptable that both dividers have fixed values than it is to understand the equation. Your mileage may vary, I won't insist on this. > = > > = > > = > > > + *dclk_core_div =3D dclk_rate / dclk_core_rate; > > *dclk_core_div is calculated the same way for all cases. You could pull > > this out of the if/else. > Okay, will do. > > = > > > + } else if (vop2_output_if_is_edp(id)) { > > > + /* edp_pixclk =3D edp_dclk > dclk_core */ > > > + if_pixclk_rate =3D v_pixclk / K; > > > + if_dclk_rate =3D v_pixclk / K; > > if_dclk_rate is unused here. > = > = > It will be removed in next version. > = > > = > > > + dclk_rate =3D if_pixclk_rate * K; > > > + *dclk_core_div =3D dclk_rate / dclk_core_rate; > > > + *if_pixclk_div =3D dclk_rate / if_pixclk_rate; > > > + *if_dclk_div =3D *if_pixclk_div; > > Both *if_pixclk_div and *if_dclk_div will always be 1. > = > Actually,=A0 they will be the value of K here,=A0 if it work at split mod= e(two > = > edp connect to one VP, one show the image for left half, one for right ha= lf, > = > a function like a dual channel mipi dsi). > = > I know it split mode is not supported by the current mainline, but i thin= k keep Ok. Sascha -- = Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip