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 71EACC54E67 for ; Fri, 15 Mar 2024 15:24: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=UzuizwNJY8kL2ZiO946Rmq4OAmmmsST8NkHxm0Ggp18=; b=SziUfgyyHa+B/FdO6HAE5IkZQm TY4KNGxFbmMr+/SW98peltBQmr0aP4ETJSSe/YVILEI/RgU6lxRnUQzzCH+BjKOxj4req4DWIJNxB +oW6RdOaswO1CVwx6t09hzXzylItjXY2QzEQRFHAJnIeUi24Bh0vKWTJfwviv/95dfJDzhrr0a8Te EamLrRUf4hXy8MWWlv6R3eu1c+z7Me6cuREQCXzpnGt2gJgej/cQWLiwQRPiqgdUwrGiJPdve8Xbp IW4X62g/saxfbE5pzGHQOqcTlOXp06oeLJwNogZ5q13MLWgfpar4Z7svN2bKIevL3HUYjTg9GyX0N EHkpROPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rl9QA-00000000ezm-261A; Fri, 15 Mar 2024 15:24:34 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rl9Q8-00000000eyW-0eUm for linux-arm-kernel@lists.infradead.org; Fri, 15 Mar 2024 15:24:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0961B60C06; Fri, 15 Mar 2024 15:24:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D9BEC43399; Fri, 15 Mar 2024 15:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710516270; bh=dv2BQE3C1SVPJZ9yimIjK4LwzWdStVZ/9oh5jMElhhY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q3FqpOfrAyIR0n1E/BYxHdrafNQUI/II/3xPBGFjRQNvkIA01sH3u4copbooOrd3l cRwBP0tW8u99Seoh6KsfPE1T1QtAsMbO4zDIIF7MqubfKvhbJT3QT7LuxU791IX8GM UYz2rm9RIu2cFyNcBJjktCKjMZDq9YLqSWcfrs9bEa/ncZjulHerbNMkbnI07kw/ai OoMWt4pwdQzPG/WHuiPEx+viosvck3Xd+K48mJL/SOPmw/pq1eHIa/T8ejz0Gm7LIY kHEsgUD9Xm4HNHRh58vrGDimxevSRqZlNwLT/ZnktUXTFGENoXw00lLYMqUqOUDI0f oAU6KTk/Sgo9A== Date: Fri, 15 Mar 2024 16:24:27 +0100 From: Maxime Ripard To: "Klymenko, Anatoliy" Cc: Laurent Pinchart , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , "Simek, Michal" , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mauro Carvalho Chehab , "dri-devel@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-media@vger.kernel.org" Subject: Re: [PATCH v2 8/8] drm: xlnx: Intoduce TPG CRTC driver Message-ID: <20240315-quiet-pragmatic-capuchin-79c2ab@houat> References: <20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com> <20240312-dp-live-fmt-v2-8-a9c35dc5c50d@amd.com> <20240314-esoteric-delicate-sidewinder-5dc4db@houat> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240315_082432_328743_D1A4655D X-CRM114-Status: GOOD ( 26.84 ) 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="===============3577090227782512492==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3577090227782512492== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uhyiww26fdxh7rdb" Content-Disposition: inline --uhyiww26fdxh7rdb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2024 at 07:43:30PM +0000, Klymenko, Anatoliy wrote: > > > +/* > > > +--------------------------------------------------------------------- > > > +-------- > > > + * DRM CRTC > > > + */ > > > + > > > +static enum drm_mode_status xlnx_tpg_crtc_mode_valid(struct drm_crtc > > *crtc, > > > + const struct > > drm_display_mode *mode) { > > > + return MODE_OK; > > > +} > > > + > > > +static int xlnx_tpg_crtc_check(struct drm_crtc *crtc, > > > + struct drm_atomic_state *state) { > > > + struct drm_crtc_state *crtc_state =3D > > drm_atomic_get_new_crtc_state(state, crtc); > > > + int ret; > > > + > > > + if (!crtc_state->enable) > > > + goto out; > > > + > > > + ret =3D drm_atomic_helper_check_crtc_primary_plane(crtc_state); > > > + if (ret) > > > + return ret; > > > + > > > +out: > > > + return drm_atomic_add_affected_planes(state, crtc); } > > > + > >=20 > > [...] > >=20 > > > + > > > +static u32 xlnx_tpg_crtc_select_output_bus_format(struct drm_crtc *c= rtc, > > > + struct drm_crtc_state > > *crtc_state, > > > + const u32 *in_bus_fmts, > > > + unsigned int > > num_in_bus_fmts) { > > > + struct xlnx_tpg *tpg =3D crtc_to_tpg(crtc); > > > + unsigned int i; > > > + > > > + for (i =3D 0; i < num_in_bus_fmts; ++i) > > > + if (in_bus_fmts[i] =3D=3D tpg->output_bus_format) > > > + return tpg->output_bus_format; > > > + > > > + return 0; > > > +} > > > + > > > +static const struct drm_crtc_helper_funcs xlnx_tpg_crtc_helper_funcs= =3D { > > > + .mode_valid =3D xlnx_tpg_crtc_mode_valid, > > > + .atomic_check =3D xlnx_tpg_crtc_check, > > > + .atomic_enable =3D xlnx_tpg_crtc_enable, > > > + .atomic_disable =3D xlnx_tpg_crtc_disable, > > > + .select_output_bus_format =3D xlnx_tpg_crtc_select_output_bus_forma= t, > > > +}; > >=20 > > From that code, it's not clear to me how the CRTC is going to be able t= o get what > > the format is. > >=20 >=20 > It's coming from DT "bus-format" property. The idea is that this > property will reflect the FPGA design variation synthesized. >=20 > > It looks like you hardcode it here, but what if there's several that > > would fit the bill? Is the CRTC expected to store it into its > > private structure? > >=20 >=20 > It's impractical from the resources utilization point of view to > support multiple runtime options for FPGA-based CRTCs output signal > format, so the bus-format will be runtime fixed but can vary between > differently synthesized instances. > > > If so, I would expect it to be in the crtc state, and atomic_enable to = just reuse > > whatever is in the state. > >=20 >=20 > This could be totally valid for different kinds of CRTCs, although for > this particular case, the bus-fomat choice is runtime immutable. Sure, but we're still discussing an API to accomodate your use-case here. Your usecase is one thing, but the API has to be cover all cases, and there's definitely some CRTCs out there that support multiple output formats that would benefit from that API. And it would mimic the drm_bridge API, which is a nice consistency bonus. Maxime --uhyiww26fdxh7rdb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZfRoKwAKCRDj7w1vZxhR xbZ6AQCqyIWNrOekCzZErEBBgva8wYYFUxOXwSWD2p63fto44AEArbdEKOyhIRfR TluOQSyvoL63/q0ohUCoINatpqawVQo= =Yted -----END PGP SIGNATURE----- --uhyiww26fdxh7rdb-- --===============3577090227782512492== 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 --===============3577090227782512492==--