Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp11536lqj; Sat, 1 Jun 2024 06:15:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2cXIeUNecSNfv7DYFUcmv+IWQAEVFCponvFo5HQKEPV1sBhuXHWtXFhZwXqCFU8IoqP8rU6cdFWFBM5nIPeJ4st+er6RtO98BIX7z6A== X-Google-Smtp-Source: AGHT+IGoqQoYKvmkc5b+ljhZ5IXY+EQWt9q6a525zNWl3Rb7pSLimVeAwCfv9ZLcixBlUOEJQznf X-Received: by 2002:a50:ab17:0:b0:57a:14fe:461a with SMTP id 4fb4d7f45d1cf-57a365c9ff3mr4427774a12.39.1717247700600; Sat, 01 Jun 2024 06:15:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717247700; cv=pass; d=google.com; s=arc-20160816; b=b33+a2+b6RCXZs+NUltF4bYGP/ryO/MDzqaR2g1fKaZWNEyIo4bpygD5hYf5J5IUAg hhoC0qLHNhI1eAMkaprEgms3VbKodf4nVyqA6giD0Ua/rA69xe2+Cs/1saFXU5+ypomF Mkokh3O+A7DBCUjWoYtFx8yfjm7OlDUSMZ99oNYp0UfrU4vXO8FBFRhxYNY/FYzJvlZ8 riZRuS7alYutJN9+PAICqENaeKyMgODz9+LELzwHra7A5yOKk396dWxvhWsw8+NcvPhl 6iPNtoPEouOpeMtZ6BkK/cqBTBc6Crb73AwrHN1pegwgEGwGhiL6kF99T/9E1HxW7IT8 fGdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=2FY8gLYRLKqYz4Y2gX1HpfoPjmasANJ9xj9aWhGYy/4=; fh=lwnmantY1w9Tee5UVCW0JNSzjw2yECTYhtHjua6upNg=; b=mLrMcztykRg7r0WphLj/EL7u0UDQos+uyp7bfNafpq/iNX+VjrjuE62EznmQKzjN7L FjUnbFy4xhenZ5YUzb6xDqeKdIcvKiqr1TFAJJB0Nxw8cwxKsiHP0o73braY9SWMg/8o 4RX4OCR9S1vPZjopHuSbglwi4FFAJbDQp0GSoiJJrWKCbtbUHWz5MJV6sIIf9U1hW5/W Tmgm1rCmaQRhH21jN4ZLAwTFNGYoYsstKeFr2108LnB/sRIPeNnb6CPcSH7BTg6Bnakh QI1ZcrgkwHEgXnQC8bHGvOXhvl46YHfQ+a+2OolV6FzthFsqe2+uWQ8nDzCNCCMC6vMG vfkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QIGTIiy3; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-197856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31caf2f1si1974914a12.605.2024.06.01.06.15.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 06:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QIGTIiy3; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-197856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 54E751F21FA9 for ; Sat, 1 Jun 2024 13:15:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 274FA153580; Sat, 1 Jun 2024 13:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QIGTIiy3" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A19F1514ED; Sat, 1 Jun 2024 13:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717247592; cv=none; b=XQ1ycELNMxbqkEjxT6pCoPU3KTFqJx3c4Puu1UKBPywUZcos2n6mW0pi+uqzUv6qQRUh8fECABZfyEdPP+JwnJZXNRMZs1/XMVNf+DqlXay8Cv4QZp5ZGKEw9Tero9qPgjT+OZTcm7okTYQeYW/9dSxoivzwDf+Ct+MCWITNOS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717247592; c=relaxed/simple; bh=b/8Z0IbvDFW+qeJDNTjrqHUhEf0nvgproXHjL4e1WRI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kl9ZTZ19F/n3XnTCAtoG1xssFW/Gr0ETcvRiXovPnEx3Nl7GSngDBKfUv+lOCsuch8itDVh4LRR1alXXRjZcnJiA6o//+iXqE6q7GFO0NL91S5rr0rqGisD9IutJ9S+Yq9Rm0AB0M+JUC4jJm3w6oXiQK/Osa7Al1Ph5pRJBSvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=QIGTIiy3; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1717247585; bh=b/8Z0IbvDFW+qeJDNTjrqHUhEf0nvgproXHjL4e1WRI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QIGTIiy3XZLCetWY1vfuTkHYAicPqxVBwLZGMg4+CVqjnLOC9tVhCw8R+as9Q8mpt izg3Y3PL//M+kLZBoLm5q2NiuEGOhdrcUH5G1m8Yb3IZD+OXdGcbRoiXPNTD5iVrCF f4TMtFd+cnIcFs0qm+q2RlEMQtO6Zj2geWLnd6qiQdXz639OJRyA3w5c0opQY49IJ9 GZrCgrExzVOjmvpVQ/pNxy/W5u8qWn0lKYaBMJtGt/AHUu0WKr1dfxKMGR7JpygMMZ vjtR8jKpjdKgTN3Ps8fpm5PsQNlpjaLn2fMcr1ksajJEE7AbbXY7O4eNdDkH6bUyIw yCzEhq/KCgvyg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A257E37821ED; Sat, 1 Jun 2024 13:13:05 +0000 (UTC) From: Cristian Ciocaltea Date: Sat, 01 Jun 2024 16:12:28 +0300 Subject: [PATCH 06/14] drm/bridge: dw-hdmi: Factor out hdmi_data_info setup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240601-b4-rk3588-bridge-upstream-v1-6-f6203753232b@collabora.com> References: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> In-Reply-To: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Yao Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, kernel@collabora.com, Alexandre ARNOUD , Luis de Arquer X-Mailer: b4 0.14-dev-f7c49 In preparation to add support for the HDMI 2.1 Quad-Pixel TX Controller and minimize code duplication, factor out the hdmi_data_info setup from dw_hdmi_setup() into a common dw_hdmi_prep_data() helper. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h | 2 ++ drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h index e73b8eb7528b..5fb65db4aaea 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h @@ -156,6 +156,8 @@ void dw_hdmi_prep_avi_infoframe(struct hdmi_avi_infoframe *frame, const struct drm_display_mode *mode); struct hdmi_vmode *dw_hdmi_prep_vmode(struct dw_hdmi *hdmi, const struct drm_display_mode *mode); +void dw_hdmi_prep_data(struct dw_hdmi *hdmi, + const struct drm_display_mode *mode); enum drm_connector_status dw_hdmi_connector_detect(struct drm_connector *connector, bool force); diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 5cf929f68ae9..d124c781da20 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2133,14 +2133,9 @@ static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi) HDMI_IH_MUTE_FC_STAT2); } -static int dw_hdmi_setup(struct dw_hdmi *hdmi, - const struct drm_connector *connector, - const struct drm_display_mode *mode) +void dw_hdmi_prep_data(struct dw_hdmi *hdmi, + const struct drm_display_mode *mode) { - int ret; - - hdmi_disable_overflow_interrupts(hdmi); - hdmi->vic = drm_match_cea_mode(mode); if (!hdmi->vic) { @@ -2180,6 +2175,18 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, hdmi->hdmi_data.pix_repet_factor = 0; hdmi->hdmi_data.hdcp_enable = 0; hdmi->hdmi_data.video_mode.mdataenablepolarity = true; +} +EXPORT_SYMBOL_GPL(dw_hdmi_prep_data); + +static int dw_hdmi_setup(struct dw_hdmi *hdmi, + const struct drm_connector *connector, + const struct drm_display_mode *mode) +{ + int ret; + + hdmi_disable_overflow_interrupts(hdmi); + + dw_hdmi_prep_data(hdmi, mode); /* HDMI Initialization Step B.1 */ hdmi_av_composer(hdmi, &connector->display_info, mode); -- 2.45.0