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 168FCC74A5B for ; Wed, 29 Mar 2023 19:57:46 +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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dIltBGSefjG5V5HB/mHng7jCb5AeAZ9T8+wbEYEUXKk=; b=aBO5D9NRLLWK6nWg8EC4AO96Yq oJjikG0fJWbXLfAv0cjfWPwAQ1rFC1g+shlGtiKQ3ViFVBHt76HUkGJO4a6yKfE+VpGWIqyxveIrB vu3PokfD864K+InX+bPYPriDbED7vxHsM+KZGwCmFmY+JcPvBuwfbpvQMqGl+T16rKCqU+5t28ZY9 r3BEkl7nLF+X7REt3uciwt325rRl8drP85vCWjJ82kH/Ysnu8ku+SHy2SbKU1W9qUfngr4XGYpKKm Bd7T9NRMF7b0z0agDfeXwNLcYdM7U6y1xssFwkz56zGI+ApUHZNz/AiE1q9uuy954HQnLstcSIfxy 0K16nC7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phbuY-001hG5-17; Wed, 29 Mar 2023 19:56:46 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phbuV-001hFW-2q for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2023 19:56:45 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id CF0D032002F9; Wed, 29 Mar 2023 15:56:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 29 Mar 2023 15:56:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1680119801; x=1680206201; bh=no XiJIPie8dV9ePTw+SFQsO0YQNm2CoaSAiwIsdQxWY=; b=dhX/CDGktLBJ59bws1 SBd5MyUrWvJrFsBrVeAcOAIIOON8qZVFvlHWEupXGQ+QK9V6Shv8v1V06GUfSHbE REpoPWc4hpwXLYnOM2yBzg9XThL5e88JOKvyn9WDy86EkjsFXTKAtgocml/wELkK M8CbixMKVxgLW7vA+szzycquz6Kd6FuLzewgt+ej30+TL+hFaL4VAPztbJo44ELG hIrT8HCkNG+x+Ui+TalipT8H89pKukX3868zIlyVPPlm4MsNSEkpRC09R6iNAgsO kp9sbQfeWynd1hRnKNj77/HENaBHF1jwvncRUVngGBVjNo7YsbyZ4gzqPcXyKA6A Mkzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1680119801; x=1680206201; bh=noXiJIPie8dV9 ePTw+SFQsO0YQNm2CoaSAiwIsdQxWY=; b=VQflJgiYK2fuZdRhXHweK9JeB6Anm hA0vcz6up+MNKNHhh68F2kQF+/4NhFDnxiT7y6it/PctSKFwI66OC47kTVL+rts/ 978f/qKQdDK6xpgdhHhnZGB58lQ4ZBX3c/tGi0chGgBCgUlc1xW+jA9xiKvDOkVX wcXVZksgXC/665tWjAew2SBt9V8u70RWHWUyyCItLvNpSGiMiI1uOWyVihpZ8j03 V1JWWsVcfBajs9O5xkKyRYURQLMkGTTgcwVGDeiFy4zOwNK7gtYYRxGq81mO1svf NI8SuXlIQXLDdEs/Sr5WSgkMI32fDtPDZhW44t6UtdTZJ6Kk1JzNkWvrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepteefffefgfektdefgfeludfgtdejfeejvddttdekteeiffejvdfgheeh fffhvedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Mar 2023 15:56:40 -0400 (EDT) Date: Wed, 29 Mar 2023 21:56:39 +0200 From: Maxime Ripard To: Frank Oltmanns Cc: Roman Beranek , Chen-Yu Tsai , David Airlie , Daniel Vetter , Jernej Skrabec , Samuel Holland , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/sun4i: uncouple DSI dotclock divider from TCON0_DCLK_REG Message-ID: <20230329195639.iep4rv5rcigu3gj2@penduick> References: <20230320161636.24411-1-romanberanek@icloud.com> <87wn356ni4.fsf@oltmanns.dev> <20230327202045.ceeqqwjug4ktxtsf@penduick> <87bkkc3bzc.fsf@oltmanns.dev> MIME-Version: 1.0 In-Reply-To: <87bkkc3bzc.fsf@oltmanns.dev> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_125643_976369_B3E077DC X-CRM114-Status: GOOD ( 18.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5741609207487760839==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5741609207487760839== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w77waeuhy2kubgq3" Content-Disposition: inline --w77waeuhy2kubgq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Mar 28, 2023 at 09:28:19PM +0200, Frank Oltmanns wrote: > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -819,6 +819,34 @@ static void sun6i_dsi_encoder_disable(struct drm_enc= oder *encoder) > regulator_disable(dsi->regulator); > } >=20 > +static bool sun6i_dsi_encoder_mode_fixup( > + struct drm_encoder *encoder, > + const struct drm_display_mode *mode, > + struct drm_display_mode *adjusted_mode) So, mode_fixup is kind of deprecated in favour of atomic_check > +{ > + if (encoder->encoder_type =3D=3D DRM_MODE_ENCODER_DSI) { > + /* > + * For DSI the PLL rate has to respect the bits per pixel and > + * number of lanes. > + * > + * According to the BSP code: > + * PLL rate =3D DOTCLOCK * bpp / lanes > + * > + * Therefore, the clock has to be adjusted in order to set the > + * correct PLL rate when actually setting the clock. > + */ > + struct sun6i_dsi *dsi =3D encoder_to_sun6i_dsi(encoder); > + struct mipi_dsi_device *device =3D dsi->device; > + u8 bpp =3D mipi_dsi_pixel_format_to_bpp(device->format); > + u8 lanes =3D device->lanes; > + > + adjusted_mode->crtc_clock =3D mode->crtc_clock > + * bpp / (lanes * SUN6I_DSI_TCON_DIV); And that's visible to the userspace, so it's not where we should store that value. I guess the best way to do something similar would be to store it into crtc_state, and then reuse it there. But it starts to make a lot of rather complicated code compared to your previous patch. Maxime --w77waeuhy2kubgq3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZCSX9wAKCRDj7w1vZxhR xaruAQCGPe9DdXyqjNQS1/luLCBVHVNEYdtb1P+8H83LWTX0FgEAswrnvVcJtuq+ lBULl/xcVsrxuFzib6ShMcSpHy9u6AM= =LAf9 -----END PGP SIGNATURE----- --w77waeuhy2kubgq3-- --===============5741609207487760839== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5741609207487760839==--