From patchwork Fri Oct 18 20:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842387 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 12BC5D3F29E for ; Fri, 18 Oct 2024 20:49:34 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=HdsYdXyVM238ZtJ2wQVLNOVp5C Qf3Bhguml6NoYwm8zD3LoFgoXQWAUJKqDNMZOlLG01rpkFXwUvAF0yvYhFYowfDTNA9z7An71LYlG 3KtLygOH3eCXf+BA/GrzZ/2vJg7RDFpaYw1MXPlpPAxh9CIbznTz48T3veqXedi3fU9BvihdgDvBz nCEciy490cFw1EGWGKRpt2UWE6piuIlU0JqHAwO5DObdKXN4zov3a8RP+nhAP6RRTJBKR7qvj5/03 7ygQbS+D1Pu2EY0KDVVIZ0xIL4D197ObuotuoOvpm7Tg2AqpLK1l9liRQMdhFB/bW4rUaDpY7DJyc isq08NLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tuX-000000020jU-0Edo; Fri, 18 Oct 2024 20:49:25 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgH-00000001xfZ-3MPy for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:43 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-539f72c8fc1so3009676e87.1 for ; Fri, 18 Oct 2024 13:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283679; x=1729888479; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=wZvPRkKUZvzMXQCU5+yU/hrimy5Pc21lDHajmiClvrUz2BHj+4yo0j5YZX4QBVMF9D DMMZALH4eLAFDzdtz/kkbd3Zga5tJm6hg84/OvTrR8EhnD0QSaBoe68CxRnJewBeT3bO zE81O22GR8bf7Te9jzHbsE0jd1hHBwv4Y5c6ZehV8JZHVRMstR5kufeDEBdwS1zO5ZFP ih0gNg5f28KnCiM3ekgD/RTgC9kaYzutqbyjA77w4SkUOBvQjhINPoa3hGjI37UdXm3U 41S/T05zuKcdaCoeK9RiJZ5OCWycVLosnzOBl+i+avI/bIpPAdzv9YMmqRuQGhXF5QwZ SE5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283679; x=1729888479; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=lDhojpTC6xCmsoVlys9/3WVnJ/X8nt/WmQpxJ6VHrg9oy0RMaVc59hMWa5YnxXvCXU T1IpDr+nggwVIoBAn0IIjeQeQjbthVRdkoN8L0pDCXZRlVIs5EGVrU9+kPEF7qvlr1xW KnXDa1I2zzMSt/siItDiStVj1GfOKQn3g2UQDnPYKcn696A3AP7e0yNcSNmCTwdk//4g 78V9LoYML4FSg00QdySTcvHMigOuNZWYds5UAxsYhJPHsYvp0bOnLUeS01A39s6QtEA4 h4vBBIk2ZHaBTydR4W0mKFG6gyGWOYs6tmr0jp53G3aeTO5DeE+OvDebaMvLHPrG6RNs +5ww== X-Forwarded-Encrypted: i=1; AJvYcCXiED0VREHkSHeqAbZQgL1pVwGX8n2UPPMnUZKTeVAf1jDqA0+BxbldQueLqjl6rcC3zvMI2429/5lLuzMkTeFS@lists.infradead.org X-Gm-Message-State: AOJu0YyeZZ+8UB2ES219Wl4Ng5n8l54T8QYD0KviDX9h4+RV8XIzs7VE lFmI3/8x9GHkqvsQwR87aJtQeef+2o547x8EmV+BmeUjN68kuVpTBHxajQqfxWk= X-Google-Smtp-Source: AGHT+IF8BVoRIxnX151X/ou3wfgvDZ33vCYdpPGEJRWz11slO0h1dFciQ3fgvHB6ZjPafQuKkOrHTw== X-Received: by 2002:a05:6512:689:b0:539:93ef:9ed9 with SMTP id 2adb3069b0e04-53a15231e83mr2568387e87.36.1729283679380; Fri, 18 Oct 2024 13:34:39 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0e09sm314047e87.146.2024.10.18.13.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:38 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:22 +0300 Subject: [PATCH 4/6] drm/display: bridge_connector: use drm_bridge_connector_mode_valid() MIME-Version: 1.0 Message-Id: <20241018-hdmi-mode-valid-v1-4-6e49ae4801f7@linaro.org> References: <20241018-hdmi-mode-valid-v1-0-6e49ae4801f7@linaro.org> In-Reply-To: <20241018-hdmi-mode-valid-v1-0-6e49ae4801f7@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1724; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=N3fpJ8U7Ak99t/Z4rrwzOntZmmVW0UU1b+pAthTP+sI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZWeps0ACTRHt9hRd/qx7Ya08ePnqAT37CMz 0SKraccjUKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1b6OB/41ftMl6NnJ3cRxPukMLnle7BAxhRv6D5fefVcCKYyvbpYkKmNAYLWRN8s0T2q/f15mZfz UE8xxtBlmALOjmUa0S4uLfve0aqalgAsQIAG9gxLSbBNhTtpmLNIv0+RNpJ0DRnrwi1ND4bJIgT WPcqL5WpwQq9T4rkiQsEHwcP9QuxeEg/wAqr+K/MAHq/1bLpu6I/kzDaeoVbr6w+bXxy40f3iq/ EOpk6yliKUDhA4ypEeO3L1mhNldVR7bsYUwVdsTdqxjqcadDhvDyIxCTv/w4AIGengb6jNP7Iei mXCwiSlpXwh8my5JY/3Qzks9N7ysEsKjfeZBa2l+7EN8yQqU X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133441_881968_7E0DDA0B X-CRM114-Status: GOOD ( 13.89 ) 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 Use new drm_bridge_connector_mode_valid() helper if there is a HDMI bridge in the bridge chain. This removes the need to perform TMDS char rate check manually in the bridge driver. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_bridge_connector.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 3da5b8bf8259..3304ab0c00f6 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /** @@ -299,9 +300,22 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector) return 0; } +static enum drm_mode_status +drm_bridge_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + + if (bridge_connector->bridge_hdmi) + return drm_hdmi_connector_mode_valid(connector, mode); + + return MODE_OK; +} + static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, - /* No need for .mode_valid(), the bridges are checked by the core. */ + .mode_valid = drm_bridge_connector_mode_valid, .enable_hpd = drm_bridge_connector_enable_hpd, .disable_hpd = drm_bridge_connector_disable_hpd, };