From patchwork Fri Nov 1 00:25:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858517 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 C410BE6748F for ; Fri, 1 Nov 2024 00:25:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 835EE10E0B7; Fri, 1 Nov 2024 00:25:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RuXsjLb3"; dkim-atps=neutral Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0262510E0B7 for ; Fri, 1 Nov 2024 00:25:12 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-539ebb5a20aso1574305e87.2 for ; Thu, 31 Oct 2024 17:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420711; x=1731025511; darn=lists.freedesktop.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=f6wvkpdEJy3UY0KoyL1u6wW6pZJHCkWq8daEN8XaygQ=; b=RuXsjLb3POSNrdtLQ7z82PfXa1XhwNFvZ+XPSS6/nvvJt49/D06/0wT2Ws1+5Ou9GF BoaqUqWJAY97TW1POKj1zDIXy7fAJNL2bQXalhIPZY5RJcuHs1h9ZgegzvPHIUIKeJTU GSj4BG85F1loVtnl1jCyV0aYEMCLjY71AoT/ZninLOl/2ZfGPAzntk88iyUPfYQw44mB N7dj0VS/hDXxqs22LjlmWh4Pe3+AUCEC5LiDbqKwtyfHHXzHFsgDpViO0xxO7j1VzxuQ PNsIufh57+PpqXu8Q9TLPWqETTLLtOFIngDPflx17/jN3yI5YvgDLnMQQNpR7G//nUEE B6Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420711; x=1731025511; 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=f6wvkpdEJy3UY0KoyL1u6wW6pZJHCkWq8daEN8XaygQ=; b=D6coIT9ypIndasjEwEed40Jxe+5qP10R+FWiHwCnmFB1oDpNmjEZsGTXK3tA/rqaRs vGbP3u7HdSPbVFjCdszdyXSqe8r8g88ZHzyqb8220hMGyFVI+AXabG2UcCRBj3557O9A ih49dIiTzzE2X78Tdkbyhu8UN+Bm72C7WNMbVLQexotv4Mx+Rv3qxB5q9DYcgwA/fg5U GUwJpGHgmrS/ggNoCpOurnm1EaeCL33+Zqj/sxyrbRR6UlS0E5RD5wvZHJaJvdAzEScn mqcl+GFuNICALemAd797FY9qYYUFt1LqslF39L6bXxVGeEwv08CeNk8FUi0ZCWtaW0f9 oN5Q== X-Gm-Message-State: AOJu0YwwAqo8FiSynwhcYfTHXgDmxOSHA8cRzh88fMo1o8eMpPapMKCf ESlIYHZD40qhwVCuelgzke2VRcKwbQzuVxJn2EA2cVOzlIFMrlMxre5CttDc7RA= X-Google-Smtp-Source: AGHT+IFl02U+Enu+dOc8nLBGUqiQvjvTgpJmOb8nUqlghPqDc1+5KcRdRr4F22uyWdsyfKCDEEXcqg== X-Received: by 2002:a05:6512:114f:b0:539:958a:8fb1 with SMTP id 2adb3069b0e04-53d65e1aeecmr830681e87.60.1730420710791; Thu, 31 Oct 2024 17:25:10 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:09 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:04 +0200 Subject: [PATCH v2 1/6] drm/display: hdmi: add generic mode_valid helper MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-1-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=12996; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=kVBUKzWAeHVvHBydx3EkRE4Q3REprXqMLr3/QDo5buM=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/h+qQ1svDVzgd0LXjIU1mOZYulRshe8N4cO hhkv1trDDmJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4QAKCRCLPIo+Aiko 1YsEB/oCWybrGbF8Zp55m5T5SgJSWWMvmHdwta73P4TbzdbYxcw2s2JeW3ZdBed51YYxvd29orC p6PB0KX/CZKEEyn4Xp9ZqQYRtEo4BZufIesiJxN6SWc+jisZtmmNry8JkoNh0C6UaLeip2k6dF3 HHISp68oCmsgCVPYX7oPUN3Yv27H8YXfd1/UllhI2fuAMNtl4txBzdiPwRlvJpZEKv3CkGnOgeP QTdDn7BX88d9AjlBozZcgJa5Hib1obJ31EY57vKWvMxLt1vgPH5PIE1g94Nmq01lQdsUoZvV3GJ HjeNxTzyfa42+vFSYu0Zppy75ikECUbDVNoTowRpSr3FDqub X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" Add drm_hdmi_connector_mode_valid(), generic helper for HDMI connectors. It can be either used directly or as a part of the .mode_valid callback. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_hdmi_helper.c | 45 ++++++ drivers/gpu/drm/display/drm_hdmi_helper_internal.h | 11 ++ drivers/gpu/drm/display/drm_hdmi_state_helper.c | 26 +--- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 168 ++++++++++++++++++++- include/drm/display/drm_hdmi_helper.h | 4 + 5 files changed, 229 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 74dd4d01dd9bb2c9e69ec1c60b0056bd69417e8a..560c5d4365ca54d3f669395349cedfd6f75fa033 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -9,6 +9,8 @@ #include #include +#include "drm_hdmi_helper_internal.h" + static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) { return sink_eotf & BIT(output_eotf); @@ -256,3 +258,46 @@ drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode, return DIV_ROUND_CLOSEST_ULL(clock * bpc, 8); } EXPORT_SYMBOL(drm_hdmi_compute_mode_clock); + +enum drm_mode_status +__drm_hdmi_connector_clock_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode, + unsigned long long clock) +{ + const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; + const struct drm_display_info *info = &connector->display_info; + + if (info->max_tmds_clock && clock > info->max_tmds_clock * 1000) + return MODE_CLOCK_HIGH; + + if (funcs && funcs->tmds_char_rate_valid) { + enum drm_mode_status status; + + status = funcs->tmds_char_rate_valid(connector, mode, clock); + if (status != MODE_OK) + return status; + } + + return MODE_OK; +} + +/** + * drm_hdmi_connector_mode_valid() - Check if mode is valid for HDMI connector + * @connector: DRM connector to validate the mode + * @mode: Display mode to validate + * + * Generic .mode_valid implementation for HDMI connectors. + */ +enum drm_mode_status +drm_hdmi_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + unsigned long long clock; + + clock = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); + if (!clock) + return MODE_ERROR; + + return __drm_hdmi_connector_clock_valid(connector, mode, clock); +} +EXPORT_SYMBOL(drm_hdmi_connector_mode_valid); diff --git a/drivers/gpu/drm/display/drm_hdmi_helper_internal.h b/drivers/gpu/drm/display/drm_hdmi_helper_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..ee74435c04f62cf71b9857bdc427c46442b85697 --- /dev/null +++ b/drivers/gpu/drm/display/drm_hdmi_helper_internal.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_DP_HELPER_INTERNAL_H +#define DRM_DP_HELPER_INTERNAL_H + +enum drm_mode_status +__drm_hdmi_connector_clock_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode, + unsigned long long clock); + +#endif diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index feb7a3a759811aed70c679be8704072093e2a79b..29c2cb2c3171366a2a68fc6ad48f8ad8a4dc7e30 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -8,6 +8,8 @@ #include #include +#include "drm_hdmi_helper_internal.h" + /** * __drm_atomic_helper_connector_hdmi_reset() - Initializes all HDMI @drm_connector_state resources * @connector: DRM connector @@ -198,28 +200,6 @@ sink_supports_format_bpc(const struct drm_connector *connector, return false; } -static enum drm_mode_status -hdmi_clock_valid(const struct drm_connector *connector, - const struct drm_display_mode *mode, - unsigned long long clock) -{ - const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; - const struct drm_display_info *info = &connector->display_info; - - if (info->max_tmds_clock && clock > info->max_tmds_clock * 1000) - return MODE_CLOCK_HIGH; - - if (funcs && funcs->tmds_char_rate_valid) { - enum drm_mode_status status; - - status = funcs->tmds_char_rate_valid(connector, mode, clock); - if (status != MODE_OK) - return status; - } - - return MODE_OK; -} - static int hdmi_compute_clock(const struct drm_connector *connector, struct drm_connector_state *conn_state, @@ -233,7 +213,7 @@ hdmi_compute_clock(const struct drm_connector *connector, if (!clock) return -EINVAL; - status = hdmi_clock_valid(connector, mode, clock); + status = __drm_hdmi_connector_clock_valid(connector, mode, clock); if (status != MODE_OK) return -EINVAL; diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c index 34ee95d41f2966ab23a60deb37d689430f6b0985..8640e7280053bd95852f53b92159f493b141f2bf 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -43,10 +43,12 @@ struct drm_atomic_helper_connector_hdmi_priv { static struct drm_display_mode *find_preferred_mode(struct drm_connector *connector) { struct drm_device *drm = connector->dev; - struct drm_display_mode *mode, *preferred; + struct drm_display_mode *mode, *preferred = NULL; mutex_lock(&drm->mode_config.mutex); - preferred = list_first_entry(&connector->modes, struct drm_display_mode, head); + if (!list_empty(&connector->modes)) + preferred = list_first_entry(&connector->modes, struct drm_display_mode, head); + list_for_each_entry(mode, &connector->modes, head) if (mode->type & DRM_MODE_TYPE_PREFERRED) preferred = mode; @@ -125,6 +127,18 @@ static const struct drm_connector_hdmi_funcs reject_connector_hdmi_funcs = { .tmds_char_rate_valid = reject_connector_tmds_char_rate_valid, }; +static enum drm_mode_status +reject_100MHz_connector_tmds_char_rate_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode, + unsigned long long tmds_rate) +{ + return (tmds_rate > 100ULL * 1000 * 1000) ? MODE_BAD : MODE_OK; +} + +static const struct drm_connector_hdmi_funcs reject_100_MHz_connector_hdmi_funcs = { + .tmds_char_rate_valid = reject_100MHz_connector_tmds_char_rate_valid, +}; + static int dummy_connector_get_modes(struct drm_connector *connector) { struct drm_atomic_helper_connector_hdmi_priv *priv = @@ -147,6 +161,33 @@ static int dummy_connector_get_modes(struct drm_connector *connector) static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = { .atomic_check = drm_atomic_helper_connector_hdmi_check, .get_modes = dummy_connector_get_modes, + .mode_valid = drm_hdmi_connector_mode_valid, +}; + +static int dummy_connector_get_modes_100MHz_max_clock(struct drm_connector *connector) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv = + connector_to_priv(connector); + const struct drm_edid *edid; + unsigned int num_modes; + + edid = drm_edid_alloc(priv->current_edid, priv->current_edid_len); + if (!edid) + return -EINVAL; + + drm_edid_connector_update(connector, edid); + connector->display_info.max_tmds_clock = 100 * 1000; + num_modes = drm_edid_connector_add_modes(connector); + + drm_edid_free(edid); + + return num_modes; +} + +static const struct drm_connector_helper_funcs dummy_connector_helper_funcs_max_tmds_clock = { + .atomic_check = drm_atomic_helper_connector_hdmi_check, + .get_modes = dummy_connector_get_modes_100MHz_max_clock, + .mode_valid = drm_hdmi_connector_mode_valid, }; static void dummy_hdmi_connector_reset(struct drm_connector *connector) @@ -1734,9 +1775,132 @@ static struct kunit_suite drm_atomic_helper_connector_hdmi_reset_test_suite = { .test_cases = drm_atomic_helper_connector_hdmi_reset_tests, }; +static void drm_test_check_mode_valid(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_connector *conn; + struct drm_display_mode *preferred; + + priv = drm_atomic_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 1920); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 1080); + KUNIT_EXPECT_EQ(test, preferred->clock, 148500); +} + +static void drm_test_check_mode_valid_reject(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_connector *conn; + struct drm_display_mode *preferred; + struct drm_device *drm; + int ret; + + priv = drm_atomic_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + + /* You shouldn't be doing that at home. */ + conn->hdmi.funcs = &reject_connector_hdmi_funcs; + + priv->current_edid = test_edid_hdmi_1080p_rgb_max_200mhz; + priv->current_edid_len = ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz); + + drm = &priv->drm; + + mutex_lock(&drm->mode_config.mutex); + ret = conn->funcs->fill_modes(conn, 4096, 4096); + mutex_unlock(&drm->mode_config.mutex); + KUNIT_ASSERT_EQ(test, ret, 0); + + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NULL(test, preferred); +} + +static void drm_test_check_mode_valid_reject_rate(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_connector *conn; + struct drm_display_mode *preferred; + int ret; + + priv = drm_atomic_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + + /* You shouldn't be doing that at home. */ + conn->hdmi.funcs = &reject_100_MHz_connector_hdmi_funcs; + + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); + KUNIT_ASSERT_EQ(test, ret, 0); + + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 640); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 480); + KUNIT_EXPECT_EQ(test, preferred->clock, 25200); +} + +static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_connector *conn; + struct drm_display_mode *preferred; + int ret; + + priv = drm_atomic_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + + drm_connector_helper_add(conn, &dummy_connector_helper_funcs_max_tmds_clock); + + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); + KUNIT_ASSERT_EQ(test, ret, 0); + + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 640); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 480); + KUNIT_EXPECT_EQ(test, preferred->clock, 25200); +} + +static struct kunit_case drm_atomic_helper_connector_hdmi_mode_valid_tests[] = { + KUNIT_CASE(drm_test_check_mode_valid), + KUNIT_CASE(drm_test_check_mode_valid_reject), + KUNIT_CASE(drm_test_check_mode_valid_reject_rate), + KUNIT_CASE(drm_test_check_mode_valid_reject_max_clock), + { } +}; + +static struct kunit_suite drm_atomic_helper_connector_hdmi_mode_valid_test_suite = { + .name = "drm_atomic_helper_connector_hdmi_mode_valid", + .test_cases = drm_atomic_helper_connector_hdmi_mode_valid_tests, +}; + kunit_test_suites( &drm_atomic_helper_connector_hdmi_check_test_suite, &drm_atomic_helper_connector_hdmi_reset_test_suite, + &drm_atomic_helper_connector_hdmi_mode_valid_test_suite, ); MODULE_AUTHOR("Maxime Ripard "); diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/drm_hdmi_helper.h index 57e3b18c15ec79636d89267aba0e88f434c5d4db..93f0e566257338fb6e9a1f0b2cc14ce9c97ec0a5 100644 --- a/include/drm/display/drm_hdmi_helper.h +++ b/include/drm/display/drm_hdmi_helper.h @@ -28,4 +28,8 @@ unsigned long long drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode, unsigned int bpc, enum hdmi_colorspace fmt); +enum drm_mode_status +drm_hdmi_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode); + #endif From patchwork Fri Nov 1 00:25:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858518 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 ECE59E67492 for ; Fri, 1 Nov 2024 00:25:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FE4C10E15A; Fri, 1 Nov 2024 00:25:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nrcaQfHg"; dkim-atps=neutral Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6AB2510E116 for ; Fri, 1 Nov 2024 00:25:15 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-539f2b95775so1688696e87.1 for ; Thu, 31 Oct 2024 17:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420713; x=1731025513; darn=lists.freedesktop.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=YdWiUnW6vTgN40+31xk3R74ZtFvE1HPhsssihDLePE8=; b=nrcaQfHg6YuC/0tvY8HvkWGFOtWjVaSetx+o7jyirX6QZE5Yb00f2OprHUpD7M/9lS r1zhEXWF2fAoxCtkg1yq8RQoVcJNWJnk7jBSneRITPe+L1jMGfUhqmYrfx/heGnKeKG/ SbbFsdFV5k21WJW3rFAAOFNIfgIWaW8AahLVwls7JZ+IvMUSkXnBY1ZFmVb5Qw3ZSOqz fqkEswIe4uJEk6qDqxhXt9LhZAbshFInc5OROkUt14EcnL7vHqy6D+PA2wep1A4HB2pg Kyq/Juq8b/MO028XqbzgHt59dRvCWJx9iAW976M3EwQQMPLvxMT7Cb0v0cN9bymjvaDi Rkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420713; x=1731025513; 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=YdWiUnW6vTgN40+31xk3R74ZtFvE1HPhsssihDLePE8=; b=Blz1W4PINVHjX0hLbWcI3zPCW6hsFJ/02z0uq0yYtyE13vuyfUd2JCcEAO7FoNRqv8 dmJ9v9zAgQGThJZpFtlgOeh92bFUk0JBiE7/WXMc3lfhsgTmXINR9LJcK41/0kYJ94sJ wuecZFk8v4/UB0cMFthcBJg62wGHLJSdgb6JHqCtQHR8WfK6aTS5SyMoWwi7fhMA+EgG /VuC6r2oBPwvt1PvUVG3E+9Z6BL+Ay68MIFvsFNuGITOIUi90p2YmG32A7QSZA1gmruh I/C32F30fqit0pgT2Whr5DHPOFrvlJWgNUOjLS/HaS4zTD/EXGBp23vUu0EmAzGVPMSd GjHg== X-Gm-Message-State: AOJu0YyZw9aMmDMVqPU/NeBL8j3TySuUCLb8Nupzd7SzEg0JG1vf3fhy zBZKR5/DY3ljeT78KSpraFKcQ9AiGlWdUY65EIHQ9Z6H2upgyord3M7xGAk7j/Q= X-Google-Smtp-Source: AGHT+IGbq8fCpRY1c1bmmg92095C0kqytUrIWwSrZUXkLxY5mzg2koxLARty7zdJQk9WrWqL2+9CxQ== X-Received: by 2002:a05:6512:ba0:b0:53c:74a7:43de with SMTP id 2adb3069b0e04-53d65df2488mr1464938e87.29.1730420713436; Thu, 31 Oct 2024 17:25:13 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:12 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:05 +0200 Subject: [PATCH v2 2/6] drm/sun4i: use drm_hdmi_connector_mode_valid() MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-2-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1574; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7WdeDK9PVMnPHS0xN6wrfKPJv4ESCzGwmvZnGPcMZ/4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/hVs8ck2mIuOojDf5BsZyDpCAOCNbvDgTjB eEdeVyvSe6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4QAKCRCLPIo+Aiko 1bLuB/9NYYP+2gWguXV7p7pxvci6OEsal/Vmy8LRfAO4mZDqwSPpZaLvK3tQVnCC2tplz45RV62 KH7xpFWZe4L9XV8JIyduCPu3BEZe8cdEHSNio4pUw2nXKz8fuaj/73N0DEwpQF87bixbIKyB11p EjmlZKOFvHTJ7yeuUgUUiKM6X+RDLGiXX/Qof/VMIgQjhJT0Q4qmUg2B351WDikp1lpmyRxfTpd eX0xqtaokT6BLTm64axs7FFb8od8hvVrsfpfiH3FuPtsW6Ca6XVMAIb4t7YNGUs/h7Ob4NcwJJ8 xbghQayNSZROF+m19E/pCBd8Dbmht0Ig9PpLzYlQ1LJDdDRt X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Reviewed-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index b3649449de3026784ae2f3466906403a0b6e3b47..54b72fe220afacc208b3fd48d5160031127ea14a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -205,16 +205,6 @@ static int sun4i_hdmi_connector_atomic_check(struct drm_connector *connector, return 0; } -static enum drm_mode_status -sun4i_hdmi_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) -{ - unsigned long long rate = drm_hdmi_compute_mode_clock(mode, 8, - HDMI_COLORSPACE_RGB); - - return sun4i_hdmi_connector_clock_valid(connector, mode, rate); -} - static int sun4i_hdmi_get_modes(struct drm_connector *connector) { struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector); @@ -269,7 +259,7 @@ static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = { static const struct drm_connector_helper_funcs sun4i_hdmi_connector_helper_funcs = { .atomic_check = sun4i_hdmi_connector_atomic_check, - .mode_valid = sun4i_hdmi_connector_mode_valid, + .mode_valid = drm_hdmi_connector_mode_valid, .get_modes = sun4i_hdmi_get_modes, }; From patchwork Fri Nov 1 00:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858519 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 743DFE67490 for ; Fri, 1 Nov 2024 00:25:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6CA110E116; Fri, 1 Nov 2024 00:25:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cFmEwYnR"; dkim-atps=neutral Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 049A010E116 for ; Fri, 1 Nov 2024 00:25:18 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-53c779ef19cso1814657e87.3 for ; Thu, 31 Oct 2024 17:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420716; x=1731025516; darn=lists.freedesktop.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=Oz8IVPHbbVKsM7ENVrxAMUhoPK6SMfJXrPI8pxkC7X8=; b=cFmEwYnRYwAxkryr6w0G2XX4VDe78PPfwNar+0TBMoPtYtE1tZINW82dgGE1IBGOkE YM61zrjGos+luj/Jz+11TZ+UQo5iQO8LhAnPCK5sw1CUGY5TsYSpyrv1ewnxsA/gn0Mj gNspf1iI5G+TqHHM2FmnG8Cn7YYFwlqwvP/qus8lvXyz+6gG2QPTKq2CM8/8vdsKom7V lYSKAFiwD/laRdTCC9bEQbJyuPDtAYUb9wexiDpn/0TXiHV5JAtg/Oteq79kTP709bNx J7LfzcV9gKQU3Wno7vedOL3RzGIKoUGRCTHlTn4C1VzlajTRWINfVGtETUU4v1x3BSDD i72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420716; x=1731025516; 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=Oz8IVPHbbVKsM7ENVrxAMUhoPK6SMfJXrPI8pxkC7X8=; b=Sj+CQlpMUI15rPDNAsceSJVsscOEcLwhnTDFCHI9LGCRhK0ZeuBxIVbHa+PeN4Lu0A YNHKnW6JSBN1u5HKSga8DSUqwZtwwv3MiH+jFqfm1Rc8EwQwBO40BFB4PTsNcJ9BDF9i 9EpSuqx81MKRiSG4c+ml/gV8BrMLpabuxXVisgSNjcthCQmvbiO+habCcRDoSRcKOO0u LjnRVgqY4mNQ/V+qntvuDSp1zEWtbllyzcZT9hcNJTth1yxcwckSA1ak5ORr6fMMICMB o69FQI/Q7C3LyHKKlOU9dRPPT/r+hUfuSZ94lkXlM5zfDhb6ghx5DFg1uVDRBfeO5a9l jReA== X-Gm-Message-State: AOJu0YxYZAi9/QOHNuccLgpaDTSwMVNCPyDHn0qyqkcLWhZxv/hztbre bPgrS8Chp0nNVuBNB+ZqIADv9YnVex+IadyOSh3y03uj6Vi39In1TycqngXbqR4= X-Google-Smtp-Source: AGHT+IHcnRqxSLmcfcXWYuLKSdTWcQFnoMfz9gg3tI8jWHEyOYxomQLugov09w4G+e8FKbd9IggEGQ== X-Received: by 2002:a05:6512:2214:b0:539:fb49:c489 with SMTP id 2adb3069b0e04-53c79e16c2emr2460125e87.9.1730420716030; Thu, 31 Oct 2024 17:25:16 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:14 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:06 +0200 Subject: [PATCH v2 3/6] drm/vc4: use drm_hdmi_connector_mode_valid() MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-3-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1347; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=j8Ztg9arYN1ELRagVfF2elNxB8pJWUt6BffPwIK5vkY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/hBB9KzuzMuq6rZPVIIyhq0/H5DKznjnvjc mWPqbE1GVqJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4QAKCRCLPIo+Aiko 1SHmB/wLX9KwONfQBArsPgo8Qz/Mgw1Z4L54OL1ZshkDnVR+j6A1CHLrTiAn9haUM9+bgg1kAdT mJ5lQ2iexzQSb+vqQ6TPriswRPmiJPhsRJ8Hrt/j7l7zjpf00cpdDUCc0xX4hq2FGgi2OnwrGH9 8t/FOZqEZsmzrkkDf5Brms3bEZHmxOsYdt9C3Cr+6DGf/B41PgSXAgbp4X64iQN1BlkEly/Otaj vLINazwB3mxY9sN4JmhaZfrTWHNbe/39wV4Y7rA7ZCZ696ZvbGQULrGumY5jceHeqNseiYK8cB1 UvP4ZZBU5mNKzwSAMaXF0LHzTr5DeBG8s4VVaM5S3ylORuQO X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Reviewed-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 62b82b1eeb3694d1685969c49b2760cbbddc840e..486e513b898d7f761e8615f2afc193ca44b23200 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1752,7 +1752,6 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, const struct drm_display_mode *mode) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - unsigned long long rate; if (vc4_hdmi->variant->unsupported_odd_h_timings && !(mode->flags & DRM_MODE_FLAG_DBLCLK) && @@ -1760,8 +1759,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); - return vc4_hdmi_connector_clock_valid(&vc4_hdmi->connector, mode, rate); + return drm_hdmi_connector_mode_valid(&vc4_hdmi->connector, mode); } static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { From patchwork Fri Nov 1 00:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858520 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 A214EE67493 for ; Fri, 1 Nov 2024 00:25:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F1F910E438; Fri, 1 Nov 2024 00:25:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LNJ2H3ed"; dkim-atps=neutral Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id A87CB10E438 for ; Fri, 1 Nov 2024 00:25:20 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-539f72c913aso2407687e87.1 for ; Thu, 31 Oct 2024 17:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420719; x=1731025519; darn=lists.freedesktop.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=Fn3LhrswAJ6uldcqCvizMSK2GK9rmkw5c0L7tOFDyzA=; b=LNJ2H3ed6lxb0wwmC1aJ/nUflHNhlxhdAQ2+z8By+Wf/du7GJ4nxTwUT7dIabPXEoa Teb61iQVdyGTwpWvNjSXp+Q6ioxtzaE0tTylMV4e0f67gXy3tMlNJhDnAWcnUGT+Fsus zCEHZY+4Rsq6NslT2t3zQw4KUTfbKg2TRLZoRDxX9SaHhFrQ/7+NbZT7Klco5f9kSDgK 3jV4UWUSYTWNDKDAv7UybrUWJH5RWXhuvNFyihKLU1R2r67DO6ewr/e8nGBPM7nFPK0k cdHxr+Cz91zCM7t7ck27Mc1EDuAv0DXATcPuzoP6URVm8wO5wE6MXG3d3fkljByAY8BL fTXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420719; x=1731025519; 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=Fn3LhrswAJ6uldcqCvizMSK2GK9rmkw5c0L7tOFDyzA=; b=Ej0HppgqEn2QJf3F5YTndRK0GfcheGlAOHac/Ti/UgViosct9CTjC9FmGxFRRBo1DQ jzDK7qFy1vOF4lT41QRau5MQPz4hrX4ZUfEuKhcUbEz/T0pGG9qWzs4N1VinU3hJG541 9yk/+UtM79xRh4rpRa5wtzRahYzRCENylpETF9OnPrTwc6a8qz/Cah9loo3qqHwu7hWS IQ7wOhzdtbxurf2C8pddwpLYz/8zEVr2y/W8jDqiOoZ58Pn4289riJhnmIrWXJTc0c01 /Fjq5eRpqhaNuHk9iiDTyjlrlBaBJyaoRuJX6TUlIMURsY3SxkkyhChCF3JUdPCjSMnL u74g== X-Gm-Message-State: AOJu0YzQ7MV/Baa8LMqiPt1oMKoiPAnk4HYS1sPNK3eKAMM1gG9XQ/as WNg+URONNXdJIaY14T8HlhQ4l4YI6m6KjextotFM58noFuDE5AFeMLNQ9pGfv5c= X-Google-Smtp-Source: AGHT+IFLGk370oJX7M/fOs9yssB9UroX/yB5UrOBpoOmI1k9rBV3Tjw44Gv6j6p0t2YpMLg9rxw7rw== X-Received: by 2002:a05:6512:33d1:b0:539:e873:6e6 with SMTP id 2adb3069b0e04-53b34a1953amr11874626e87.43.1730420718759; Thu, 31 Oct 2024 17:25:18 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:17 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:07 +0200 Subject: [PATCH v2 4/6] drm/display: bridge_connector: use drm_bridge_connector_mode_valid() MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-4-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1823; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Q9ji/NbRYwF1TNZj9n1TpgdHLjl20UItRRGWWpdDvcQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/hTl+xfDm56PcvCfyLR4ruPHvUICtQpdeUo JnDXQfGiVGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4QAKCRCLPIo+Aiko 1UGsB/0ZWiyvOHwonVjOKqiPjNjrJWmuBjMDfQVw3/uHD8NPKzxvZ9Hr3iL0YRRXMuK3C+IGqcZ 1xDNk2AzPqJOGZgbbGmpLSH/Vfq6va9o3zKRASXyCKqCYVPLYrHwhfxwJJ+TqXvMYWQrGm35SKi jUViyUXSxon0WYJwpk/vcmqyB+DineqeodUGO0o6BRHs0eKeAqqkT/GiDQapFvbC7uizl6AHCjB i6jc11/scL3bkp27MSP3HSuKmIMjtfX9dg/uyl7UEyOEM5tMkpbonBX96LPrwSzUbsRnAefU8O2 LLRA4GeogLOARJb31LmT0HUrWNwo2OHAqrb3GA19J0T6xiHS X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" 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. Reviewed-by: Chen-Yu Tsai 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 320c297008aaa8b6ef5b1f4c71928849b202e8ac..512ced87ea18c74e182a558a686ddd83de891814 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, }; From patchwork Fri Nov 1 00:25:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858521 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 6A3CDE67494 for ; Fri, 1 Nov 2024 00:25:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D638810E948; Fri, 1 Nov 2024 00:25:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dJZ8bcH0"; dkim-atps=neutral Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5492E10E948 for ; Fri, 1 Nov 2024 00:25:23 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-539fe76e802so1907777e87.1 for ; Thu, 31 Oct 2024 17:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420721; x=1731025521; darn=lists.freedesktop.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=L5YSV0GHN6tODKa+I9kvPXfXQWz+eBBIeCxWrWSu71k=; b=dJZ8bcH0CZWQR46sAHiIXC41HuzQUDCd54gZaFNzpI9JyusFo0Ls71nCGWWYfO10mP 33EL+0tWbdx03beI0v/PQ1mwj4EZuDsNeGmQ+q4PHNAUYdXQaS4NziOWer/4WmWo+xlg s7gXCl7X9T17rC7dGbZ30/y9fkSSPE0vjE1VQ80Q7fmmTJWt5p7ve7Uwhn7zrOTPZ7BH X+LYj2Xi/VY/Ugbg8GT1TzUa+eHSa1GJk1CKfCdoVtaXliE2UGEwEwMHxb5spaiZxQK0 nYP9r9pAYkx6waLRqh8bckldq8hZbHU+v2+UeQd2yWLOgX3EdaLZE+7cVRw6pn3JgiKj GSFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420721; x=1731025521; 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=L5YSV0GHN6tODKa+I9kvPXfXQWz+eBBIeCxWrWSu71k=; b=UxuRO6aw1MMX8RuVU65Ahx9hjvvzSz564umoEwMOulsDO4jQCzuXZZ11N1UMVPQRKx l4JCxlIyFldQYxktuD6Qyihak9BtMa5BzcX7QMPSDetftq8/MbtX+i+zQjPDgWc7HpHH 4KToLU/wu10rwGZaW8wvO89f+vuXgTL2+EWP/YKQkbAZFDQCnYpnPJ/UeYAGAjG+yB9I Qmsrp1B1CXL0MrS95XzJMNlOgDdZKT96yPvBfQuOcHFvIY9GGIuMB9aK8VXFRkKkbVQ7 PSaIq/VMnLrhDHIKLXJLHBP64q9/ePZU1SX6WbJ8K7grKgtXGHAeCI/tJxTDf0MszDmi Cv8g== X-Gm-Message-State: AOJu0YwHCRo4aq7uE83/erC1WHiHPGbUJcnAcQaIJL1ZjWeD8ec3j+7Z wCYJ31nGa+gIVSfbdVqLgTslLtJgTYaV4NL9+yukUCfPf8qY06k2oteDBYZ3PdcVuI2g7aXKlgW K X-Google-Smtp-Source: AGHT+IH+Z352s483KbHjtU5VVJ6ZByUM9w51iqApUCzupb2q+5C0iuOE0kUGC7cK9WZXbJJqsjEwvg== X-Received: by 2002:a05:6512:31cb:b0:539:e436:f1cd with SMTP id 2adb3069b0e04-53d65de60eamr1039132e87.16.1730420721328; Thu, 31 Oct 2024 17:25:21 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:20 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:08 +0200 Subject: [PATCH v2 5/6] drm/bridge: lontium-lt9611: drop TMDS char rate check in mode_valid MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-5-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1344; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=2cAY9yTx7ywPgJgHfm9Yb5s7i+clqrcNRhwPtafGQxY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/igzsmQyIppH1aHxewnBY4Uhlduz4k+yAau 9lDSDvbvv6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4gAKCRCLPIo+Aiko 1RyvB/9WSZ4mNeqd6GCGzKzlegONFJkuLiNKth6QBGTxQ//vKPOg3+AtwZwoekG8i/XcF3v32K4 65STYUOFY1I/FgP221HjXjV3D9ECFQLDGGeKhm7aLPml3ejppcxSFCoSMIczoSfyYm5k1G2xoKr fCCE4IU+aSG01lp6cHyXCQG6y9YHZs864O0vGh0SgHH1N6SeLGRb4NG2Fe3MKhnXwjYwEcYpOyU J2lEr7q8KPfcvWjBZZzLDqwPmQ9c8C5h1xKOssI4DO3MY56kui4eN8trJfFkVfWm0Fg46xuPxrQ 6aBgbPv0pAwW/CBUvWVI6roTVlburpPQoWsR3WuP+sPFeVDU X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" Drop manual check of the TMDS char rate in the mode_valid callback. This check is now being performed by the core. Reviewed-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 1b31fdebe164063e6f3972fdf8a5801ef4c35c4e..b8ccffdf515ade6e3bf863edbedc41e6f2030f29 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -757,7 +757,6 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) { struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - unsigned long long rate; if (mode->hdisplay > 3840) return MODE_BAD_HVALUE; @@ -765,8 +764,7 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, if (mode->hdisplay > 2000 && !lt9611->dsi1_node) return MODE_PANEL; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); - return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, rate); + return MODE_OK; } static int lt9611_bridge_atomic_check(struct drm_bridge *bridge, From patchwork Fri Nov 1 00:25:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13858522 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 1DEDDE67490 for ; Fri, 1 Nov 2024 00:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BF8210E184; Fri, 1 Nov 2024 00:25:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="slE8PLw2"; dkim-atps=neutral Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A0EB10E184 for ; Fri, 1 Nov 2024 00:25:26 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-53c779ef19cso1814755e87.3 for ; Thu, 31 Oct 2024 17:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730420724; x=1731025524; darn=lists.freedesktop.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=Hv2lxmvcj3iHqVSo1vO+GpyATUEKN5RREgLh1lW/pKI=; b=slE8PLw2SkQ2GjF/qeeyA/mx58i7Bk8l+lCk7WsbkDNircYd5e3zixmEbGQe+MixrJ rUHRKbELEMzk2wit3kSRhbKqRjTAJEouZM1Akit0GIEJj0t5dm0GudiuyoHHX7Hkjh49 EhcUx1zhKS33aS5qsw4My3Ws+HlvmZnk4tzSgB4C7WJXUpzvthJzRjPzqDEQRkQTkfQb bmRp2UyWbo3iM2ZT7Zd1FdQLLwXmwSYtFhjRQK+I3JAJJN2n8UKlglTjFjZOQwFQaEMN gh21WtJFRUHUm3wlhwIDR/hMZsoCFqFiuc0zJIMiAIFlwyUii3a0zSART14dkCANeO9q NB6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730420724; x=1731025524; 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=Hv2lxmvcj3iHqVSo1vO+GpyATUEKN5RREgLh1lW/pKI=; b=py6BDhnB0Rft9RqCKVBpFpORqGJRH2wcD+bexVBTG5v0vXDx0s0jI6Wdu61MU5+cZt lZ21uvo1bkhjVrGSOn81ivIIg5EYYYuWRDGwOVw0hbJ0dNlGCwFMS3MLpLE0z356HGsb rQXsjVRsoUmS7+3y/8z6GjQJkDUbJRNksYVAfjrOKpN8Lop6v906RtslRnSkaUuaAKd0 L3/0BY+XCzoUec/3Kd+UGxZY1KeuZQdk0yIMz950ggIT8YQPaifPCNQB02kvwU+QkulU 2ie3mgTzAhO52OyewLLsP+flQ24bq31iH93GEnk3sP5xqKXE9596K2Xsd7iSKmfwni7T d3UA== X-Gm-Message-State: AOJu0YzqT8ok0aDcvSpQfnhYL2AJ68+2i1g5ZaoJaRCetdCrepGG9rlj 2lBGh8HCFxtHmI8NfYIUVwNYHw20V5UySQDxwPBObov2Ld/D98SMwQ2HjV1ZzAs= X-Google-Smtp-Source: AGHT+IEAG9yn1GIhE2YrHT9rrcbTzRT2YsspXsGtFKg4MG2x8/7FF58dsirEGqVuW26T1ugiJs7GKw== X-Received: by 2002:a05:6512:1106:b0:539:8b49:8939 with SMTP id 2adb3069b0e04-53c79e913efmr2851992e87.41.1730420723969; Thu, 31 Oct 2024 17:25:23 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bcce489sm371153e87.127.2024.10.31.17.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 17:25:22 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 01 Nov 2024 02:25:09 +0200 Subject: [PATCH v2 6/6] drm/bridge: dw-hdmi-qp: replace mode_valid with tmds_char_rate MIME-Version: 1.0 Message-Id: <20241101-hdmi-mode-valid-v2-6-a6478fd20fa6@linaro.org> References: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@linaro.org> In-Reply-To: <20241101-hdmi-mode-valid-v2-0-a6478fd20fa6@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2043; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=rnWWDnvK/2UdwmliNMd8qjy7ZbPEcXVWLie22T2NTNE=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnJB/iyyoKxhJ9ymVIF5jZKxhY4Q/llakDKMFQT BEjedUrIaeJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZyQf4gAKCRCLPIo+Aiko 1URAB/0Q+lN9KyT42dXskzxxSyFiafqSlV1SV+VcON3MjaaEaECIjnFoHbPKEDxvle6Xicl7vHs h46RF3lrs7ptPTroESb/pvPY/Jj5EK9/dqatVhqiLYq2adABTz85k64UaLF9WIvj1pF54o1lMJJ 0R4OFGKZEAjC02s31dNE4fIMUbhsnc8JNoP15YRKxjq6AvslRKkkh+qCN5QhotWa9AUe6/FuS3d S7bNUR5mrFzDH3QH2n196BQPAJqsuELq2I2VbXoJuXeBSoQHuH5Dlli1/25UfCBLmbABtstMdis ux9EbzgijZfuFg2ndroerRXzSm8rHmu9np1KtZBbhZYdo8ju X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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" Replace .mode_valid() callback with .hdmi_tmds_char_rate_valid(). It is more generic and is used in other mode validation paths. The rate validation for .mode_valid() will be performed by the drm_bridge_connector code. Reviewed-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index 181c5164b23192f0b557624d73c6223032b90ec6..c686671e4850a1af75b82995185ffc3cbb22a447 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -442,16 +442,14 @@ dw_hdmi_qp_bridge_edid_read(struct drm_bridge *bridge, } static enum drm_mode_status -dw_hdmi_qp_bridge_mode_valid(struct drm_bridge *bridge, - const struct drm_display_info *info, - const struct drm_display_mode *mode) +dw_hdmi_qp_bridge_tmds_char_rate_valid(const struct drm_bridge *bridge, + const struct drm_display_mode *mode, + unsigned long long rate) { struct dw_hdmi_qp *hdmi = bridge->driver_private; - unsigned long long rate; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); if (rate > HDMI14_MAX_TMDSCLK) { - dev_dbg(hdmi->dev, "Unsupported mode clock: %d\n", mode->clock); + dev_dbg(hdmi->dev, "Unsupported TMDS char rate: %lld\n", rate); return MODE_CLOCK_HIGH; } @@ -510,7 +508,7 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { .atomic_disable = dw_hdmi_qp_bridge_atomic_disable, .detect = dw_hdmi_qp_bridge_detect, .edid_read = dw_hdmi_qp_bridge_edid_read, - .mode_valid = dw_hdmi_qp_bridge_mode_valid, + .hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid, .hdmi_clear_infoframe = dw_hdmi_qp_bridge_clear_infoframe, .hdmi_write_infoframe = dw_hdmi_qp_bridge_write_infoframe, };