From patchwork Thu Jul 23 01:35:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2756 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id C752E1C2B5B for ; Thu, 23 Jul 2026 03:39:47 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-24656-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-24656-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id BA8C430D7760 for ; Thu, 23 Jul 2026 01:35:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBFF4318EC5; Thu, 23 Jul 2026 01:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Xlm3nEiq" 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 21D3D2FD694 for ; Thu, 23 Jul 2026 01:35:14 +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=1784770517; cv=none; b=QdPKavOA0Go/w+4Vp2Np5fYuCmXuLILa7O+/mpqaRL4ppo9zvLpIfXuFaLkXA+BlsyQ3pykXhkSs2WSmpsAhOuabHMrpLEvtUW2ygw8sXFXiDxLmjxaEqjkzNIh6MI0B1yAC3mhvyvDUSLdvfuYnLWzQ9WtE0KZCK6vzBpHt16s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784770517; c=relaxed/simple; bh=q7cBSlf+upKqhrzdvUOmPKZalLVFqUdAibNT8ES0Wh8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cCaNcDZC+CUPdONWedyr6AKiwRg6xY15T1KNE6hu/08cOiARspGHinpzzgvZbd8fDKdO9CcNsFE78V/zlTZO2za33q1RSSVQ8Y8JGHmpE45Jy+tl0zYV3Ne2bZxZUdDWFnOKm4Np2XOXOVJlOCIH7dFGRivlBS82N9Hcpve8ATk= 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=Xlm3nEiq; 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=1784770512; bh=q7cBSlf+upKqhrzdvUOmPKZalLVFqUdAibNT8ES0Wh8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Xlm3nEiqPidMcbYeRy0tg5+GlmpdRMFQ15QBe1oqUwMUxBWlNpDq8QVl2fn6dDC/X K0cNlYAQqZYv3LuQ7oKwiL1RTF9dq8q93JvBC0VhRzqdtz6fB72o/sXBRrrNHjnMcq 7zca/+JEF/yMUmf/r1Sn4w0EbYWfGc4Wu618tUdQGEN2Cl2yzOw75umFonjuBjZelC CnCK2kOYZsjvoGPoLUGHsBe/USAZeAouFPUC+u2yVBpr1tGumS7uhmc5qJOnbz1OhK 8QyFVU1Vtkdk5wNCJnvlJNz1kA0YGkpQ2QrXxnOgVDfKt8IFeQY46L3Cs9cKbhUepv MDiSnpb1NGoIw== 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 880BD17E36D7; Thu, 23 Jul 2026 03:35:12 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 23 Jul 2026 04:35:04 +0300 Subject: [PATCH v9 15/61] drm/display: hdmi-state-helper: Add source TMDS rate validation Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260723-dw-hdmi-qp-scramb-v9-15-4fb12ea22ac9@collabora.com> References: <20260723-dw-hdmi-qp-scramb-v9-0-4fb12ea22ac9@collabora.com> In-Reply-To: <20260723-dw-hdmi-qp-scramb-v9-0-4fb12ea22ac9@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, Maud Spierings 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?= Validate the computed TMDS character rate against connector->hdmi.max_tmds_char_rate, when provided by the driver/source. This gives HDMI connectors common support for rejecting modes whose TMDS character rate exceeds the source supported limit, while still allowing drivers with custom validation requirements to implement their own tmds_char_rate_valid() callback. Tested-by: Maud Spierings Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index ce17eeefc2da..92be6278ea44 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -560,6 +560,10 @@ hdmi_clock_valid(const struct drm_connector *connector, if (info->max_tmds_clock && clock > info->max_tmds_clock * 1000) return MODE_CLOCK_HIGH; + if (connector->hdmi.max_tmds_char_rate && + clock > connector->hdmi.max_tmds_char_rate) + return MODE_CLOCK_HIGH; + if (funcs && funcs->tmds_char_rate_valid) { enum drm_mode_status status;