From patchwork Fri Jul 31 16:20:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2838 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 0209C1C1D58 for ; Fri, 31 Jul 2026 18:35:19 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24865-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24865-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 9FB943077CBD for ; Fri, 31 Jul 2026 16:26:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4264246D2B0; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bShXLtHK" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 BFD9C46AA76 for ; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; cv=none; b=SYT2RjjD5+PfoveW791DAuEiToeWyA7vw5c1lPWD252NRB6s1RRSAC4Id+qCJGsLjTewjq/n9XhWsjLICH/1AUmXz5yQdjvm5qsJrsZdNW/wsQWuE1WqVAFl3qQ/XL9aDiFvA14zDIkRTqb6FDr3wVlqmgCs7zCIk8PRIPNcGRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; c=relaxed/simple; bh=plxawnmT20w7v+1sTZz825WPXTqg1jAro3a9cOhXJdQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hVyVnRR77itGTmFZOB6Er60Hn3TR1ToNDryKwEnCSEDph13ekKxwZ3L0nGycX90ahcu9VWhXhvpDpxI2cganyQEtXT31H36AR72vd2l1aUpCjc4/J+pqp3s6ZgrHHCVrhUUfIOp96N9T7GKa30XZhDYIeSugxIIK49tJYnI8zs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=bShXLtHK; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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=1785514794; bh=plxawnmT20w7v+1sTZz825WPXTqg1jAro3a9cOhXJdQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bShXLtHKT160n7wYmyOV6tj7a+kfV3Rcc0M0QRyMZ3WJAEcB8y0U7fB15YeS9PzUS KVQh6eZCYGfL3ZPbGhYhJ9HyyihWzoRa/C3jA98CXtb2GS+y+ZCaNbjaq6EZRoo2iY pvuJq50RzX4aVYRZH+vS1UVhnIt44j5oHtQA2qBDZur1V2bvnuNY+sgsSzmbbrIEAJ 0H/nvlaG0E5rpc4xgCpNqQzDKjoI6BJbzillghFxcRL1tYYwMAPHQgjRIcjybKD/TM UZs+kEVCgjtqpZBsxdVdROr/VPyLRHBIFVcAojrFeDR3QRyWitIPPz2WSPmt1NjUHF wZgRMS1wRJeiw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id DD21C17E0906; Fri, 31 Jul 2026 18:19:53 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:02 +0300 Subject: [PATCH v10 55/69] drm/sun4i: hdmi: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-55-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch driver over to the new drmm_connector_hdmi_init() signature and advertise HDMI 1.2 support. The vendor, product, supported_formats and max_bpc values previously passed as arguments are now provided through struct drm_connector_hdmi_funcs, together with the new supported_hdmi_ver field. The HDMI connector helpers infer the 165 MHz TMDS character rate ceiling from supported_hdmi_ver and reject modes exceeding it before invoking the driver's .tmds_char_rate_valid() hook. This makes the explicit mode clock check in sun4i_hdmi_connector_clock_valid() redundant, so drop it. No functional change intended. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 96b2b597caa6..850a8fecf0b5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -192,10 +192,6 @@ sun4i_hdmi_connector_clock_valid(const struct drm_connector *connector, if (mode->flags & DRM_MODE_FLAG_DBLCLK) return MODE_BAD; - /* HDMI 1.0 max TMDS character rate */ - if (clock > HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ) - return MODE_CLOCK_HIGH; - rounded_rate = clk_round_rate(hdmi->tmds_clk, clock); if (rounded_rate > 0 && max_t(unsigned long, rounded_rate, clock) - @@ -253,6 +249,11 @@ static struct i2c_adapter *sun4i_hdmi_get_ddc(struct device *dev) } static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = { + .vendor = "AW", + .product = "HDMI", + .supported_hdmi_ver = HDMI_VERSION_1_2, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .tmds_char_rate_valid = sun4i_hdmi_connector_clock_valid, .avi = { .clear_infoframe = sun4i_hdmi_clear_avi_infoframe, @@ -653,19 +654,16 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, drm_connector_helper_add(&hdmi->connector, &sun4i_hdmi_connector_helper_funcs); - ret = drmm_connector_hdmi_ini2(drm, &hdmi->connector, + ret = drmm_connector_hdmi_init(drm, &hdmi->connector, /* * NOTE: Those are likely to be * wrong, but I couldn't find the * actual ones in the BSP. */ - "AW", "HDMI", &sun4i_hdmi_connector_funcs, &sun4i_hdmi_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA, - hdmi->ddc_i2c, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + hdmi->ddc_i2c); if (ret) { dev_err(dev, "Couldn't initialise the HDMI connector\n");