From patchwork Sun Sep 29 09:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Walklin X-Patchwork-Id: 13814976 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 E14DBCF6497 for ; Sun, 29 Sep 2024 09:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3QPNGe1zZiKhzuTyCeTHAjPsIfSM0kDD9Pg1n81Bevg=; b=jMZXxUv+W+G3IVYsh1SWqZ3/id +9SJnj7wKytd02wHa9g/N5RBuM6vZzhRNOlwRyM2jCaUxQ5kTqOnj65eq03OI1FmVX4eSXPo+AFvY iUnSydPQ9LlxAYLB7JUwj4kCA8gzN0GHj/fiVA9HuqSH+gR0C8M7/8m58gi/MMU+/DyOhlzseh9Z2 YHM/Kvnji5RtS7aFzq6sy4/MlmQHsvsWVHEj7xgprb71IQNvhQNPKGR2cXtiXVinr7atdAP6OI2aL 95idsYsOhIEAI8c/myJ3No9BJ1pRqVvmfdB3bbL+4s3SC8CXJftoo8cNjzTSXjilotfZbfU7/k/Sl cUBJT3Eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1suq5p-0000000EUUN-09m9; Sun, 29 Sep 2024 09:19:53 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1supyH-0000000ESyk-3wo0 for linux-arm-kernel@lists.infradead.org; Sun, 29 Sep 2024 09:12:07 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 5750C13802B6; Sun, 29 Sep 2024 05:12:05 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Sun, 29 Sep 2024 05:12:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=testtoast.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1727601125; x= 1727687525; bh=3QPNGe1zZiKhzuTyCeTHAjPsIfSM0kDD9Pg1n81Bevg=; b=B 3SY8x0qqVYpj2JSvaYl6PDtXAoaB/9iuiG5ycnsjdqjtJ+DF3E9VukgHV0yHvqSH uabjHdjiQSWBOMzOrGXSGkRgocYbkB2oLc2DOCDC8bGNRNrFmkHFrDRzmFPvhm37 L4E0wFRvSNl0BYGURdG6GJV8UxYVVBexvGYeAj3Is9+hxEqEr5nbs+VfLckgd0+C z6aE5J6GGQ9zrKQ9cItqBRv6EhRFuvLb4EbSLqRlmzQOHnGIA3aqY64TqKqbNUMs iJ16kls4+3L6xMriYHj7WfQ8N93hQXR/rfRxLfCyHUR+8yKlAq5Rf3HPjGdS8424 wSj44nDYzb/w57V7e1Ypg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727601125; x= 1727687525; bh=3QPNGe1zZiKhzuTyCeTHAjPsIfSM0kDD9Pg1n81Bevg=; b=K G8ymsi+jFxk2Vbpi574WsA8C5tsNGql7H2qY52eYtdBsfTF16bGHnoPNTzTQ9DB4 2QA92ih/azy6I/BTe20097v/iYgtYUsfTv+e6gFxzRI+4wGSHkqlstI5IbffpIjf x3WIplVxHrQDLIT98qO+K+TZWbMiopqT6HtKbYIOR12vJ+QxsVptR1BdwAq4W8MZ rfYNv4o1X/32f6D7RTxNL27VgrKShFBeUzgrmvgPDH12Et+c12jHqqL1t3LVS402 RQUhS+3vkq5rTR6Z0TzuhZM+KJWx1+6/fRKyrIuWhfwU/aT+GRb5QIXNkxo73Je7 gMdiyzjQ6TjmCYtVyBGyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddufedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptfihrghnucghrghlkhhlihhnuceorhihrghnsehtvghsthhtohgrshhtrd gtohhmqeenucggtffrrghtthgvrhhnpeffheeiffegtdfgffejteevgeefkeelieelkeev ueetffetteduffevgeeiieehteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrhigrnhesthgvshhtthhorghsthdrtghomhdpnhgspghrtghp thhtohepvddupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmrhhiphgrrhguse hkvghrnhgvlhdrohhrghdprhgtphhtthhopeifvghnshestghsihgvrdhorhhgpdhrtghp thhtohepmhgrrghrthgvnhdrlhgrnhhkhhhorhhstheslhhinhhugidrihhnthgvlhdrtg homhdprhgtphhtthhopehtiihimhhmvghrmhgrnhhnsehsuhhsvgdruggvpdhrtghpthht oheprghirhhlihgvugesghhmrghilhdrtghomhdprhgtphhtthhopegurghnihgvlhesfh hffihllhdrtghhpdhrtghpthhtohepjhgvrhhnvghjrdhskhhrrggsvggtsehgmhgrihhl rdgtohhmpdhrtghpthhtohepshgrmhhuvghlsehshhholhhlrghnugdrohhrghdprhgtph htthhopehrohgshheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: idc0145fc:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Sep 2024 05:11:59 -0400 (EDT) From: Ryan Walklin To: Maxime Ripard , Chen-Yu Tsai , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd Cc: Andre Przywara , Chris Morgan , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Ryan Walklin Subject: [PATCH v5 06/26] drm: sun4i: de3: add format enumeration function to engine Date: Sun, 29 Sep 2024 22:04:38 +1300 Message-ID: <20240929091107.838023-7-ryan@testtoast.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240929091107.838023-1-ryan@testtoast.com> References: <20240929091107.838023-1-ryan@testtoast.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240929_021206_080887_A03F0244 X-CRM114-Status: GOOD ( 12.58 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jernej Skrabec The DE3 display engine supports YUV formats in addition to RGB. Add an optional format enumeration function to the engine. Signed-off-by: Jernej Skrabec Signed-off-by: Ryan Walklin --- drivers/gpu/drm/sun4i/sunxi_engine.h | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h index ec0c4932f15cf..c48cbc1aceb80 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -123,6 +123,17 @@ struct sunxi_engine_ops { */ void (*mode_set)(struct sunxi_engine *engine, const struct drm_display_mode *mode); + + /** + * @get_supported_fmts + * + * This callback is used to enumerate all supported output + * formats by the engine. They are used for bridge format + * negotiation. + * + * This function is optional. + */ + u32 *(*get_supported_fmts)(struct sunxi_engine *engine, u32 *num); }; /** @@ -215,4 +226,22 @@ sunxi_engine_mode_set(struct sunxi_engine *engine, if (engine->ops && engine->ops->mode_set) engine->ops->mode_set(engine, mode); } + +/** + * sunxi_engine_get_supported_formats - Provide array of supported formats + * @engine: pointer to the engine + * @num: pointer to variable, which will hold number of formats + * + * This list can be used for format negotiation by bridge. + */ +static inline u32 * +sunxi_engine_get_supported_formats(struct sunxi_engine *engine, u32 *num) +{ + if (engine->ops && engine->ops->get_supported_fmts) + return engine->ops->get_supported_fmts(engine, num); + + *num = 0; + + return NULL; +} #endif /* _SUNXI_ENGINE_H_ */