From patchwork Sat Sep 21 09:45:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Walklin X-Patchwork-Id: 13808816 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 55743CF9C64 for ; Sat, 21 Sep 2024 09:53:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEE2210E216; Sat, 21 Sep 2024 09:53:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=testtoast.com header.i=@testtoast.com header.b="DbwGrAXo"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="F4drYuJy"; dkim-atps=neutral Received: from fhigh3-smtp.messagingengine.com (fhigh3-smtp.messagingengine.com [103.168.172.154]) by gabe.freedesktop.org (Postfix) with ESMTPS id 37CE810E216 for ; Sat, 21 Sep 2024 09:53:21 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9B3961140259; Sat, 21 Sep 2024 05:53:20 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 21 Sep 2024 05:53:20 -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=1726912400; x= 1726998800; bh=UUs9KKw9gM7Rm8ttFhQy8Tmz+91u9KDG5MSJ+Ys1Ptg=; b=D bwGrAXoYyxAhD3a6RpfKcDyUx8hf+RQHAr58YGEQzMzlp4H0aOHt0zPb/TbpONDS zW3/LFaPmhda2Wiir4S7aadR0nQACg6ZbzWJOkpbiveSSpFBq4C9hcHC/gpGXu1k l/7HcKTAY8DecMRUfaxPLVDHZy/2DR1LkoteXkyrbWhTBHKU3jNAwhMscJpc47s3 CswUw3TSXifFtEbFIG6jl5+5vdtkBOzfUf3XPyu0dEhSZmrQ5buPaRnngHwbhxRu LKupW8AYoiimwkAuKr038Pkk6R3wedlcDl5t8D4PuUIcy+xpcESjH7FbeWZdJXdy aXvbmxlot4emZLImSYO4A== 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=1726912400; x= 1726998800; bh=UUs9KKw9gM7Rm8ttFhQy8Tmz+91u9KDG5MSJ+Ys1Ptg=; b=F 4drYuJy/AFhAbi3XGICrkv/J1VzGYsl8EqBHsrs7GC78LCfxTMY3PAHltJTaeXYj a3CI/V4RfINJibAhgIk827a5NLrHGzmJAis6GMfx9o//8TQ5NgfdgWmaJn64Rwo2 AGXsKPt0jEJ9yvMFsK2trRmnm/mx4DyqtTxp8Ga2qqSvSfZ+5NxQXbDaHKbd8KCI 6PhNLup6Y6g1VpYrfnnkF6o2GYmgzWAYFb9apcL4DAI0qoOXmHT+F+iZtUhd+uUE U7tplSuPX2q2OGJGGV2vRgpV/tZnKjugZzis0srGCN7POsyLF647qDwwoZcpPEfz t7oZv/fVterX9ZefRs9rQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelhedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptfihrghnucghrghlkhhlihhnuceorhihrghnsehtvghsthhtohgrshhtrd gtohhmqeenucggtffrrghtthgvrhhnpeffheeiffegtdfgffejteevgeefkeelieelkeev ueetffetteduffevgeeiieehteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmh epmhgrihhlfhhrohhmpehrhigrnhesthgvshhtthhorghsthdrtghomhdpnhgspghrtghp thhtohepvddvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmrhhiphgrrhguse hkvghrnhgvlhdrohhrghdprhgtphhtthhopeifvghnshestghsihgvrdhorhhgpdhrtghp thhtohepmhgrrghrthgvnhdrlhgrnhhkhhhorhhstheslhhinhhugidrihhnthgvlhdrtg homhdprhgtphhtthhopehtiihimhhmvghrmhgrnhhnsehsuhhsvgdruggvpdhrtghpthht oheprghirhhlihgvugesghhmrghilhdrtghomhdprhgtphhtthhopegurghnihgvlhesfh hffihllhdrtghhpdhrtghpthhtohepjhgvrhhnvghjrdhskhhrrggsvggtsehgmhgrihhl rdgtohhmpdhrtghpthhtohepshgrmhhuvghlsehshhholhhlrghnugdrohhrghdprhgtph htthhopehrohgshheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: idc0145fc:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Sep 2024 05:53:14 -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 , John Watts , 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 v4 09/26] drm: sun4i: de3: pass engine reference to ccsc setup function Date: Sat, 21 Sep 2024 21:45:58 +1200 Message-ID: <20240921095153.213568-10-ryan@testtoast.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240921095153.213568-1-ryan@testtoast.com> References: <20240921095153.213568-1-ryan@testtoast.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Jernej Skrabec Configuration of the DE3 colorspace and dynamic range correction module requires knowledge of the current video format and encoding. Pass the display engine by reference to the csc setup function, rather than the register map alone, to allow access to this information. Signed-off-by: Jernej Skrabec Signed-off-by: Ryan Walklin --- drivers/gpu/drm/sun4i/sun8i_csc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.c b/drivers/gpu/drm/sun4i/sun8i_csc.c index 68d955c63b05b..8a336ccb27d33 100644 --- a/drivers/gpu/drm/sun4i/sun8i_csc.c +++ b/drivers/gpu/drm/sun4i/sun8i_csc.c @@ -148,17 +148,19 @@ static void sun8i_csc_setup(struct regmap *map, u32 base, regmap_write(map, SUN8I_CSC_CTRL(base), val); } -static void sun8i_de3_ccsc_setup(struct regmap *map, int layer, +static void sun8i_de3_ccsc_setup(struct sunxi_engine *engine, int layer, enum format_type fmt_type, enum drm_color_encoding encoding, enum drm_color_range range) { u32 addr, val, mask; + struct regmap *map; const u32 *table; int i; mask = SUN50I_MIXER_BLEND_CSC_CTL_EN(layer); table = yuv2rgb_de3[range][encoding]; + map = engine->regs; switch (fmt_type) { case FORMAT_TYPE_RGB: @@ -204,7 +206,7 @@ void sun8i_csc_set_ccsc(struct sun8i_mixer *mixer, int layer, u32 base; if (mixer->cfg->is_de3) { - sun8i_de3_ccsc_setup(mixer->engine.regs, layer, + sun8i_de3_ccsc_setup(&mixer->engine, layer, fmt_type, encoding, range); return; }