From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94ED2206E79 for ; Fri, 18 Oct 2024 20:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283677; cv=none; b=XSuf0RrdWAshHPLzqSp7kKICqwdxjXANEZFxo9gDA4KRjbnnNgxbDAxb+pTg9q6ir3MKaofLiAdIoOwjzGLqzm/W0aXWQrFwqh0VVBN/JYQ5DjhQdJCH/fvllWlspKlgqOctytQ6QL3AgYoKEoA3sCd5v0D/0Zx4BkBBNeA+nLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283677; c=relaxed/simple; bh=05eR0rzcMjCSZr+JFEQ+hv6PM74BY2KccFSMBu6VpEs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lLfzLKJUZTgGipnWNLrjvuy0OuCd+5KVpTZ9rPLokloRgUOvx9VeW4f4JCEJEvFg839juyCf0Z2R4lw2N/Rj0giwvvZ3AKTXzegldb/BftNDXusLl++RZmZ/Aq7gY9nUkGFXq6rn2XzNJNJv6cm2Nu0sF6IQP0RithZdXy3NZOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=AEiMtw19; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AEiMtw19" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-539f1292a9bso3323998e87.2 for ; Fri, 18 Oct 2024 13:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283674; x=1729888474; darn=vger.kernel.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=5GuU7tWYyoCMELfexr2H69ppcidX40bNWoyi/8R/8OM=; b=AEiMtw19OkU0e/kVhSDrD5/fcDtRczf5UEc/IGMuP6aALvlpNSSmD28CfGFGN2QSsU 63cmcgRNPImCWPuypDhRDaoYkgr5oeSdJiZnEWgWnbTmI4zr8+rbE5vobipg7Rta8Nkm jq5SUzuNl1VmylYgr1jK+dmQiWq3FeNbSsC0Ct7RjRVx0AuV8dDvgkP38ZXG4V0LJfNO e6Gi2zYSLRzDab44e4XcajmyOPvbClLS26jWAkLjEtRl8DRqdkvMerrfiKPtamHR+tzg dEcMl01ofMf1Y6sCRYCff/EoT3KCfEJ7ad3NpwWadPLPLAYwaZKjoFl31Q7OZblLCUVm 4CmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283674; x=1729888474; 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=5GuU7tWYyoCMELfexr2H69ppcidX40bNWoyi/8R/8OM=; b=TB0YoB9FP1glXThZ0lE5OYp417LcVT2rK1EhurAC+y/mGe5cMG+X34KJOjhRuqXogM 1DdtoOMcZEeiibwX3KEhDAzCIfN/UbPCN/wcywEOkGm0MNK1602Icu1wAC/7umZZ0DY3 5V2iP6HFkpUYAEqlblOjzU/w9K3t0/2aHFTHJZOW6cRxt6rCJiZ6/jLh1EkuNwlb+Wv9 CHyTBCgkgT9wrvCo1VN+ea/B/x5VubZqP7KK9fOjNUgE9/31wmUei56PAlCOLzGEHJH4 3c9HiulYTk0vYXlh76Eb8b+efcT2MmJFHJcPmqSlNtOxCl6YC1w5cl7XcsVHj1I69Ehu eQRw== X-Forwarded-Encrypted: i=1; AJvYcCXnz5rKJ2fh8oAjp3Qw7E0tjVW7B5f8if2tYK/H+REwa+Du10gDY/0SFw7ngOiwuu/oz6ChcqFT2X3bupA=@vger.kernel.org X-Gm-Message-State: AOJu0YyGVgnbcteA4MXEOdzXLN7CkJ+8uy3wv+mhGFmUMJII7mGz3IdM n3K5pPWDOKXJZDRZeMdpo//gUH49HbGm0En+KK3vZ7xQIxGFMyYA6vSWILQ1wf8= X-Google-Smtp-Source: AGHT+IGloZ6wDijqUZKKkUYLuvbutQRKOF6lHGzo2l2n81Zd1WUUiZf9hJGMWBZ06a2NX4wdB4qK8g== X-Received: by 2002:a05:6512:10c9:b0:539:fc86:ce21 with SMTP id 2adb3069b0e04-53a154d8042mr2295837e87.56.1729283673599; Fri, 18 Oct 2024 13:34:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:33 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:19 +0300 Subject: [PATCH 1/6] drm/display: hdmi: add generic mode_valid helper 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: quoted-printable Message-Id: <20241018-hdmi-mode-valid-v1-1-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_Canal?= , 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=2159; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=05eR0rzcMjCSZr+JFEQ+hv6PM74BY2KccFSMBu6VpEs=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZW3m5IznuxEQtNTc9EWw3cd2bY+FbRHbpPY 9wot4vemb6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1dF9CACWov/QNo6bt82KZcmQvzsADQbKiFLhhwfiZhK1hr3xE441Mf4iqjWBfQz1bZdyHfWCMFI tAggG16qjyRzCbqHkzPpuiIRfln/5K81YATrsU3yYi7L3SjUPPs4M0wVfavvW12Ik7wKvNmivj9 QbRyNQGuDxBtxyCmF2vZLDRlO+fbavhc7nDWytINEAJwoiaL7LIC0eAiWF/T4eT+GqDIFNoQbbK 1K1IgQZcPkjYG7SvqcX5oQobue+Do6pxmPaaHEnDNkhPc/IWI35+cIpWOtrKJazzxhccgFjDgJl 9nJTVPbVYR771G0S2xuCXsvfYTuJbNVfnaGTPVEcqpzPPXMn X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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 Reviewed-by: Chen-Yu Tsai --- drivers/gpu/drm/display/drm_hdmi_helper.c | 25 +++++++++++++++++++++++++ include/drm/display/drm_hdmi_helper.h | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/di= splay/drm_hdmi_helper.c index 74dd4d01dd9b..0ac5cb000ee2 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -256,3 +256,28 @@ drm_hdmi_compute_mode_clock(const struct drm_display_m= ode *mode, return DIV_ROUND_CLOSEST_ULL(clock * bpc, 8); } EXPORT_SYMBOL(drm_hdmi_compute_mode_clock); + +/** + * drm_hdmi_connector_mode_valid() - Check if mode is valid for HDMI conne= ctor + * @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(const struct drm_connector *connector, + const struct drm_display_mode *mode) +{ + const struct drm_connector_hdmi_funcs *funcs =3D connector->hdmi.funcs; + unsigned long long rate; + + rate =3D drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); + if (!rate) + return MODE_ERROR; + + if (!funcs || !funcs->tmds_char_rate_valid) + return MODE_OK; + + return funcs->tmds_char_rate_valid(connector, mode, rate); +} +EXPORT_SYMBOL(drm_hdmi_connector_mode_valid); diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/dr= m_hdmi_helper.h index 57e3b18c15ec..e38b62df59f3 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); =20 +enum drm_mode_status +drm_hdmi_connector_mode_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode); + #endif --=20 2.39.5 From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57CA72071FB for ; Fri, 18 Oct 2024 20:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283679; cv=none; b=gLzZlwO1XjaNwpU5QtEO5qfPgcbAOCsJEnx3UG5uNW6hL1HSaRFVsFahnMg65WFRDWWiYWvZyxRih1JyQ9Q9WY/SSTuHNf3C0cYobzTng9fA5Lplh7h2bSoaQeNRGlmaBcvekts9pxLWc/Y0dVbwgIwGr7O/R8xcw5bRoCVFlQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283679; c=relaxed/simple; bh=MtW4rEaw3z2JqlmFrdNRTkI3k9zk4GSQZjrxwP7bYGo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Cdj5Esd5nz9TH6cZm2Gxk6sWiYLK4r9iIQkxcZGzB2U+kGnzABn+sI+RpU0P45xiMeZByc9RsSHwjY+C3ywEvpYO2xIKCMrd1h8eSnhr+yZtM/E1scW+VOEQa03+ohe7Dw4p716BBOm9X4TRCv8Xh/M1S5pojrvhNoGW2zEgntI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZsAe3yOp; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZsAe3yOp" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-539f72c8fc1so3009610e87.1 for ; Fri, 18 Oct 2024 13:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283675; x=1729888475; darn=vger.kernel.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=/m0kHi0t1totPQ3PzKzLk6eKNQU+IyYcKKk3sgyVyJI=; b=ZsAe3yOpeZYuKXSQl+jJEuGvMtyL5Sf4LwICT+jiHzIh/BYBdzSlewnY5IttIz/nkd +QV9r2J2u0MOX3H+pibZdteNExUQ43ranpqORxeW/Faz5fotjCnpnYnLPD9BTu0EWpXI KkQf/6X1Ln0MXrpix8MxvdgqXdhc38jvwYo6EihH83bXtpa9AOyW/wUWIxeIMy0t2Pex DwD7GTep5gA1jkIq1pCBqKwOnVepJL5rahchO/lMAANUtooTGxM9eZiN2vybsbVg8Pm+ yQK6oWyNUc2m4SxVg1jmoWtBO3/6HINSnVr2H5zNdk1AWp27O6RwEkOIooqdE9RTkE1v NTCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283675; x=1729888475; 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=/m0kHi0t1totPQ3PzKzLk6eKNQU+IyYcKKk3sgyVyJI=; b=hajjQ1kKmZ4XSvhA3F1ic6WeCEw7S6I4DSR017hM7XDDqWrRm9szEZXf3z78Fbv2Ba EMOCcu/Swzy7abOg0JBGLNpA4L2td28zopv8mwjxwF4vo+LaiN+WTsbNZNSVCmQSuSZM rTLx9lgHwXi4C94iCD+KIZ/HPQbEZ6IVtBzJCdyJiaYQbLuV6tUd1q5/cFHdMpq4mLmF 8evMSmVMCvHOkYQIXf7EOJVzA2iY0JbcjSKLAOsb4Ju9NK57/O+1F+bRXDY0+UPhpvhu bGK7+DWUZT5NHNQB8WzY0fOK1FUqjWGKzvHZA+Wb7ajIhsV7n0uQ06UCuoIl42J1Ta5Q ZPqg== X-Forwarded-Encrypted: i=1; AJvYcCU7Qkgi4BK2D5s2Me1SDCV1fWnZpHUXMoy4RmzmV/U0yZRDA6RzX6vjmnnJtBVIJN0SMTPXOGGUMLlVpb8=@vger.kernel.org X-Gm-Message-State: AOJu0YydueUBtwdFDnqyiJhO8e60I+sysqSR2C74tm4Zd8UCaK78yaKJ FiCjXKHTSlOMRJhGGVsPEVa3nIy4xAwbGAHo6E77ylA2xMMUF1lkQKsNpW4PX00= X-Google-Smtp-Source: AGHT+IE8teJd2ZASdpn1PLVXXJ8Z0lyW9kTdAysHgWEAGJu0SayFj+KAyRByYqJcMZXxWhWyPtS+1Q== X-Received: by 2002:a05:6512:692:b0:539:8f4d:a7dd with SMTP id 2adb3069b0e04-53a154436dbmr2588171e87.42.1729283675244; Fri, 18 Oct 2024 13:34:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:34 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:20 +0300 Subject: [PATCH 2/6] drm/sun4i: use drm_hdmi_connector_mode_valid() 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: quoted-printable Message-Id: <20241018-hdmi-mode-valid-v1-2-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_Canal?= , 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=1475; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=MtW4rEaw3z2JqlmFrdNRTkI3k9zk4GSQZjrxwP7bYGo=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZWS7Xr6vqJfAnZJaxT8pE156T+ugvlMXDE3 cWVO2I31JaJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1RStCACcZGiWbJ6rwl1Z7TfhmYAv6dtF23Ul2Ba84Yg6T1vuXwq/cb/4fJJgxp0DdL2C34giGeM OX7nDtrcBG8ZwXo0GOsmJqZxtWzIiBAyCVGTmz+yx2Y+tR5Nhnu2zkJeXVuxV0n5G5uT9maCxns NKuL0ICAxfeQ+ICDoNDqNkgABXsNpo03+AUcDftdjzQDqqcQeaKnK9f5YiWI/97U/5ABstMbZ+K ceX6ul8ImmiIFu67jcbEl347B72uAN/TLXdutztOSkElYtI5UwIj/Sl4fJOiQQwobFAbw1CoNCD wN2I8yrwr3Tn99ueCn+aeGGPbo7vTkfjtwCWzxrkVIR9jctY X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Signed-off-by: Dmitry Baryshkov Reviewed-by: Chen-Yu Tsai --- 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 b3649449de30..54b72fe220af 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 dr= m_connector *connector, return 0; } =20 -static enum drm_mode_status -sun4i_hdmi_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) -{ - unsigned long long rate =3D 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 =3D drm_connector_to_sun4i_hdmi(connector); @@ -269,7 +259,7 @@ static const struct drm_connector_hdmi_funcs sun4i_hdmi= _hdmi_connector_funcs =3D { =20 static const struct drm_connector_helper_funcs sun4i_hdmi_connector_helper= _funcs =3D { .atomic_check =3D sun4i_hdmi_connector_atomic_check, - .mode_valid =3D sun4i_hdmi_connector_mode_valid, + .mode_valid =3D drm_hdmi_connector_mode_valid, .get_modes =3D sun4i_hdmi_get_modes, }; =20 --=20 2.39.5 From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B578220C039 for ; Fri, 18 Oct 2024 20:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283681; cv=none; b=e+zvYhnwk05YQXzRSb/St6hsrfUq5RLM60aysGNSgxRaBcQnlr9x9xbOI4BWBtHXGEaEC2MgYYEjroQUhGBtnd/nFbJS5/Wc9ezgECvW9W5BpeSAyNMCWhWt8vBtMBrZgk+keGOOOhaG5ZQ+AVyKKcNYu6TOcGg5KktJRqiaAhI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283681; c=relaxed/simple; bh=SLiFFY4mHaK2mj2q8xisga/Q9Y4nw81QpArU89KsdC0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ejfAkvNXYAKyr0arPcD2TAkNsew/RhSoojIowuzp881CNuqAvoXVvJuSU3zQS+qBqe8btyEfIdq+fT69/kUTPMEvdhwnALBnTQ9T5jw1DNb6KLNrwqoMRTH4r5BteOa27bvbRMyXWphm8JeQtscW3ps5hNa2o7V9x0Gxqe8wjcg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DspD/beY; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DspD/beY" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-539e690479cso2899025e87.3 for ; Fri, 18 Oct 2024 13:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283678; x=1729888478; darn=vger.kernel.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=ca1rU5SjfCzQNv/FEym5QKCwQ3XnYE+z1oSBkBKPVBg=; b=DspD/beYZx5H/9ow/JknE81DCPDCvKaeMI0G+fx6QBSAtWBpoPBNtTNla3xY8wJKUJ o4iuypM6ETezp34++SxFmBxVTRRkRbiOtV9NnB0YYEqz5XI0hF0KyaIGC7iVoZiKKt5N polGWGkrGYJbzOwnI0EKxetQ12Xdk/2BWpkeN4wtTJJ9FkkgZHoAi+hAJXrv1JO+w5iV F67/44cvtgnSrGQyp4B+wo/RGalqfsQb4Bzw1i5mftLrehiUqODsOju7QgVz61aWLyhW Rre3vI+rqPtIPla7EPtdJPMvIRnc/hRaGWcIG0zaO9bI34Q7k2LoaYxbtySmGNovrLBF 9fYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283678; x=1729888478; 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=ca1rU5SjfCzQNv/FEym5QKCwQ3XnYE+z1oSBkBKPVBg=; b=FI/05qdIlFkAqxCA/OFjboCVw9U2H8CXLqYpCSIDkqiXOrgDZ85LUz+L6HldmmdYhn o8VgvDpMZ5ndswHFuiSvZsm1c4dlXfC3OLjEls1myC1s3mrhXtB/FSX+5+g4G/L+L500 bY2I/0rt9a6wzFAHNaQQ83z9it8aqGuxT7AghJQY8vwliQ/0hZkewWOb2m2MX8gDfIQE 2Z8YE6Y3+LIAv+GjxExC770BSpCHGkoPVFXoTVyKRuLbEHGj7jsuNH42RksvK5S0m/Z+ 52wFC2vdzOBvcZ/XvcGgkPQgP9bhZ8jQl22rf1ipDUJqkW69V0fCMcMIKxF2GmvZ032K s1Ag== X-Forwarded-Encrypted: i=1; AJvYcCUuZVTpHfgN1cfbwh2DoV4OwTnBueP7ZeUQglD2pdveXXeKQ/+Adffq+TBMOyhvnaaN+aCQGTyFgWDNUus=@vger.kernel.org X-Gm-Message-State: AOJu0YxccthspP3ayvOY+noswInh8nUyIHi3aO5+QqRF46vgoWJtroZI BUHPna/CTtFK42j8SrGvOnQNPGc/HeqtsFlIJura2am9JPEpeWfF10Kv0hKNTG0= X-Google-Smtp-Source: AGHT+IFTHfkrFtW/rXOHHbEDQkVHYXvE16LJg5mmb3Z1WRleIxcPDhcnmv9BafU4kuhPvZsMxuWfcA== X-Received: by 2002:a05:6512:118c:b0:539:958a:8fb1 with SMTP id 2adb3069b0e04-53a1551168cmr1519828e87.60.1729283677753; Fri, 18 Oct 2024 13:34:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:36 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:21 +0300 Subject: [PATCH 3/6] drm/vc4: use drm_hdmi_connector_mode_valid() 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: quoted-printable Message-Id: <20241018-hdmi-mode-valid-v1-3-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_Canal?= , 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=1248; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=SLiFFY4mHaK2mj2q8xisga/Q9Y4nw81QpArU89KsdC0=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZW5T8Y/qcRfISUNqKDHuO2cK3wsa4ZaEnDU L3k4nG0OqyJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1V3DCACgaS2mX/0MXs81TWTKcZTjZ3KAqTJ3HrXMX6GnlBiCEqicvl7vBA4LM0KdCkTZk29pVaS FmoWyRYXnr0PklxZ9FlSqHz1LpsPCgONRG6Iq1szlo/1g4WbnHeracbGaj+Xt5QeFc83wJS1SMP PSssSHdZe/VhLGFADVaLuUvCim0834TLcmafqiK43Bx3yjx+XdZNXMc+75uXf3HD434HHhdA/Dz i1WWdq7icOPAZsT3xj3cbPCtGWy6ehHrkYS3R8vHwsIPJBVDPweWJxntNcRnQIIjxP2zNrDpo6x 8G3v4fRMVwQ4wQe48iAB9NxgSl9mMIBEGeqryrzXVBfvHBhK X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Signed-off-by: Dmitry Baryshkov Reviewed-by: Chen-Yu Tsai --- 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 62b82b1eeb36..486e513b898d 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 *encod= er, const struct drm_display_mode *mode) { struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); - unsigned long long rate; =20 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 *encod= er, (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; =20 - rate =3D 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); } =20 static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs= =3D { --=20 2.39.5 From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81632208988 for ; Fri, 18 Oct 2024 20:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283683; cv=none; b=Q/25Ni+gJ7jagRiWFrBSSq1qFOHe9IR9EVEn63BG1rnPtJ+Vm8qpV56VwfimYEk3NkpAv3cMFI/27q/dBhZXaGkyp7lPZgokrjN6FcdV5odfrK40RxVNIO/hIax9nMCwCFdZCcoaTAN3/o0xtMj92cM7j+TFB5xYpqYkinaXVgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283683; c=relaxed/simple; bh=N3fpJ8U7Ak99t/Z4rrwzOntZmmVW0UU1b+pAthTP+sI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N+ypTUJZqaReX+MjPH3VdqUsMe7qhT5bjfun7v0itZi5cCF4Zw7JgC8s/dP5cgXY0YEJW3/yz5bpycg5cRJnj/c9UR4S0Iwft4qyt1w90ksC1pUWZ/pIc2FR6cgn6LWC4A/7wG7AbexvuNY31zbS/4UKMtv8ebDGITHaXBLj0P4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aahDAxfJ; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aahDAxfJ" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-539eb97f26aso3095634e87.2 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=vger.kernel.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=aahDAxfJ0KaWiScG6nmDpU6lBZWPuxHRkLY/1eqfCWgXiu5yHbnBzpGBKyBdQ7AsXC 4Cew1LfJq1jCHtolFFPCwXEixTWWTKQ0ruAUYQF/wRdWr7neAbwYl5XgXns60sbj78+x U9fjWtQvWm7DVIm9V4Ej0YD5zZNw69eZi6FiBYTVaZkJEU4WQ/VIXA/NdtY55JHOnDSF CHcOtIEYfJpOxDYFLPi8L/ERoklt4CjZtRiIaK6BCrJJjPezwYCswFh7ZV//te80+qww 1Quz2cmut86hkNi2SFCo/13zM9hvHxj4fMXKhob94BTkCbeO9a3R608UCI8DF9qHjM2+ pahg== 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=Tmi1mf9Dy7EQ0wwzrpCzfXWnsslIFuTIX0wMC+jho1S6zIMpDcEPaPVzTuAXST7kPO dMSRCF85oXSsYNC76prGcXIdAgFO9d6e0PsAKxWSiZl0CEfMA+vUmyNr0kqC3FzUyD+A ZqFTZ7EWzPGPNo/75sJiTIR1dY1KG72FzquHOzmd/TNmSU2SfxojrBa/Vc1MUEMvG0mB +xMjuhMORfLbkHkaBn4+Kr5/N2PRT6fZfshMrkbr8iXLRZTx8QAO9pfPGfyMjd8A7EG+ bPGi5ifTTVLx+kZ+ReZwqR13uP2PRwwrxewOeUlvPOSBLC+YCdEamwCCRQFc6qz4W27A Bu6Q== X-Forwarded-Encrypted: i=1; AJvYcCV2qZmZ1SPfWIQESLZ+GGKZ4b5XmM7vwmcrVV5Nb2VRQOChv9dv1s9bnwHDSm9CShr0Z9NBf7xy8JuSnmU=@vger.kernel.org X-Gm-Message-State: AOJu0YxQpacT9qAalTsaQUP3iJw5WGiMj0S1UM9RHBRZhvtiPbyGnbyi tIGsus1k/5+K2l6d68Lan2ta/QSzM9yGGc86RKlEks+J+mar4seJu5S4NEyNJVs= 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() 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: quoted-printable 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_Canal?= , 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 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 Reviewed-by: Chen-Yu Tsai --- 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/d= rm/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 =20 /** @@ -299,9 +300,22 @@ static int drm_bridge_connector_get_modes(struct drm_c= onnector *connector) return 0; } =20 +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 =3D + 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 =3D { .get_modes =3D drm_bridge_connector_get_modes, - /* No need for .mode_valid(), the bridges are checked by the core. */ + .mode_valid =3D drm_bridge_connector_mode_valid, .enable_hpd =3D drm_bridge_connector_enable_hpd, .disable_hpd =3D drm_bridge_connector_disable_hpd, }; --=20 2.39.5 From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CAD1212D23 for ; Fri, 18 Oct 2024 20:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283684; cv=none; b=k75uMlmwG+PgtAa2YQ0pi1Kjltzx/Gvgique9bA242SWysztaiJ+QpnZMSVcH2YT7JR/4PiwtSe0S2SNYF+Iq5WGRwJUZF7qSxoJ1OQcieAA8CvQ97aOZGV4D8jTOhemdOp+ET8ZaoUUwkAD0VF2J5RWmqpTSKR4m8iwa2EgJwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283684; c=relaxed/simple; bh=osIrL7yWr+4pmjn4TVjBTzhg7zx8VCnWZvSiQ2XJamw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mcRtZCkxODRVS9FN1j4PsAb47KwQUhD9ivy72+XyO3DgMrDvqrlJCJjcalH5z/lhnrcO4k8UtqfEmU1a8UPK943yaZLQEakAYslkgsKjITWG7UHJumBG3Nwwi5IEkDgfrfYw+8dp6SKt0b0Vq4hpv3p44t55/bywD22FPZbKPAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=q9hazLp+; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q9hazLp+" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539e5c15fd3so2468034e87.3 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=1729283680; x=1729888480; darn=vger.kernel.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=jQVWVw/idsCMZK/QpoLkRhrGm63gf8m8ez6XsTKeLHM=; b=q9hazLp+KEVI/SvGH3RCcOrL9Df7X1Du0eU+6xSzzdUTQGSoWQC+hQ5fFRaYLHOAUB gd4WQbUwU3jrim2DkYCD0IRGjEJRB+9GTamhb7WwuWIOJ04VpkFOTagOC4K+Ce9zQEwA mpNmjauw9+6BmKwX8H52Wg0Mn8PdOqyUwvN/XFc5xTLy6Xv22/C3xZeV2yjdufkcu20m UE6oZTTgXt/4GXAvDg5QnhK51CdlYKiyYKzck5BB6/svUyNk5l+KcGo5mLSPJsRdm2TN zv7DA0jfQ3ngri+acEtvRBK+CXaneaB/VRjBdP8zItDD/Y8XH2NXVEuJbCNvvTnA3ddb XHYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283680; x=1729888480; 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=jQVWVw/idsCMZK/QpoLkRhrGm63gf8m8ez6XsTKeLHM=; b=TtGcA/v/zwn8KgD9nAALb4XZWFcWuJ06bOciHRFLfigEOYF5TIXZpwu7bdL7lP2+rr yl1r/sfsj3gEPAPaF0rbfqvONChYoTgb2ijvbL8n469RZrx/ZatJ+jyRytl016DcwyIt BsMKo+hPwzkbJhsqSyRwO0CQqYEYaC0cSXegJlj0QWI4DY+5wEGGGcMy6qsuY/p6ICHQ St1h1c2DaRqSA95ldBs5bUvsS4LXstvz2uluPDSokFwblgxKZLDRt+lfVyVc21SOPC6O 9D7NUrhYh1Q7w950gcKVwyDs2ZrMlC6b6UFrGUu5/ATCHAC4OKg+0FVGMdzijkB6JLUU ZVRA== X-Forwarded-Encrypted: i=1; AJvYcCU6eulOwktVmGSREHg7G5AxR7D4vWr2DuairmGRmBk1J9qj2Fs4YBlg3k9+k6fL19Qw07hbIqKSnc//Y84=@vger.kernel.org X-Gm-Message-State: AOJu0YyTM+4fFedB3ZKPHGpcm36Oh8mg76PjY/FshJXbY1xz+JhaLlzy LE+3ZAsnv5+ZULIPiR0hc/mbSzctOiltHhqfEeJQivj5luSn6K1hDo/jDZok8Us= X-Google-Smtp-Source: AGHT+IGoSpeJeqVcn2bBpU1CDeVL7TbnH9BzbJ+fJdWG6AlVnAH1yvvW7YML8X25GofhaYelXl/hnA== X-Received: by 2002:a05:6512:3ba6:b0:539:ea54:8d22 with SMTP id 2adb3069b0e04-53a15218aafmr2609863e87.18.1729283680110; Fri, 18 Oct 2024 13:34:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:39 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:23 +0300 Subject: [PATCH 5/6] drm/bridge: lontium-lt9611: drop TMDS char rate check in mode_valid 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: quoted-printable Message-Id: <20241018-hdmi-mode-valid-v1-5-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_Canal?= , 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=1245; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=osIrL7yWr+4pmjn4TVjBTzhg7zx8VCnWZvSiQ2XJamw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZX2CRSrVD6zRlV3sf79iOpwhz41ku4gX4qc tGYqxdPC/uJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVwAKCRCLPIo+Aiko 1RyYB/9E+wiPd2wCJklbxNW0iDngze8b+l1vYstAn14YjudFSUOj7PzR+r+wuO8oBzGp30jLWxr 2hv3hyWP7IHMsIgLkbUSkoabiCeCcw00YJ8pTNRNA03XEUYNPShaFGKncbTJjclO8N02NDuqbbG EVBl6Wn92lNxdYi1TseW2pacNmyCH3D+R8WRBF2OFFYKVx/lcV47U6CAT7vh4Oh9sdmiYQKg9+s nK5XOLg0lX2/m1gGOePKId5J4Sz18NrsoOXoEUXbeyUJynFaWCg8HwtmA1ZmeiqbEBu/DF1TVVo zuOH+2JIHO9gjlZ3jT4dd918nxB+waOmoaThOushOweRJPOs X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Drop manual check of the TMDS char rate in the mode_valid callback. This check is now being performed by the core. Signed-off-by: Dmitry Baryshkov Reviewed-by: Chen-Yu Tsai --- 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/brid= ge/lontium-lt9611.c index 1b31fdebe164..b8ccffdf515a 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(st= ruct drm_bridge *bridge, const struct drm_display_mode *mode) { struct lt9611 *lt9611 =3D bridge_to_lt9611(bridge); - unsigned long long rate; =20 if (mode->hdisplay > 3840) return MODE_BAD_HVALUE; @@ -765,8 +764,7 @@ static enum drm_mode_status lt9611_bridge_mode_valid(st= ruct drm_bridge *bridge, if (mode->hdisplay > 2000 && !lt9611->dsi1_node) return MODE_PANEL; =20 - rate =3D drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); - return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, rate); + return MODE_OK; } =20 static int lt9611_bridge_atomic_check(struct drm_bridge *bridge, --=20 2.39.5 From nobody Tue Nov 26 08:40:08 2024 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45673212D33 for ; Fri, 18 Oct 2024 20:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283685; cv=none; b=iPCTmdjiU/o3V5GXh4nexI387bXRC9eU9GaxJG9d8EJes0IqZnyZ0ylUToTv3Xs0Vo9W3sOVNORl+qeMcaZcSPC2dqJhEhcxu5eIfa7b4xGY7CUo6VDKdhBdfiDDgqRfJsIHx01Bv6jkqKpyWmG3bP0f1nr+xvlqMngORoDHyjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729283685; c=relaxed/simple; bh=62YpkgWLFOCHVyXEfwzdT8WXezDQplIIX6XUhdEmdrA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V9OkarSl6BD5NhCGRjN7lAHcbC7u+ycrflMNlv7b+bCk7mSQRKx8fMOexfTmviCfcKAdpnebk3KfMT6uaeS2sG2p4y0D6vSD16FnlvTmlndtm4GHkv2EJm04tZDanAAFoR2NOfAnSLevAGj/AqUAG/2trt4Y2fNccCmTl+w87II= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UB3tMiun; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UB3tMiun" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-539e1543ab8so4522411e87.2 for ; Fri, 18 Oct 2024 13:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283681; x=1729888481; darn=vger.kernel.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=8KNF3aZ80xlLK3q7tI6wiBMuQSM/G62kGRgo4sUnlVk=; b=UB3tMiunb7Iwb8bVyrNLVUoBC+qVTv0XU75c901Y4FflmiEDlX+kR5YfTeNFpzpIL+ NZ5+ld5I6X8T0W4L7Wb2lCdUmPsQQKygM64dW3fEzfp5KqEqcaQ4KNBNwRCTP+6EnPX4 r+/tTbSWH+Hbpwk2Apoo19GQosV+5bPEf9PJyq3Y3UgyWh9asngJZ2HlsCDtFwq6x7UU 8b5ZbtWxxpu8a34crx9efPPBg211xtZ7YhMxWwb/PwTZN5eQv33b9coJdEA3X8pOZwLF 3FVGjVwJPZZGybM51U1PmiYYy9JoWPVewOzMpFkN/9wofSFbTrsNCNFoBDwZVY6OzRDv OGhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283681; x=1729888481; 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=8KNF3aZ80xlLK3q7tI6wiBMuQSM/G62kGRgo4sUnlVk=; b=bH3CJSltesLPYDy2FDgwoAbQ0Es5lr/bBYriSU87blEHK9NagUuPNmk5+6i/POVmIh Zi6igy71+qQ6s7YxKqKo1JtDuw5z4DounzupptV0/22xX+oKjbMkMIB32xYruMkrc2Xc 9kda4aud5F3aS1pryGsasyNQ0OxSDwCYp45T9D+bOQxuW8cLUM3BaQ9kqfQXGos/X3M1 WtYqyOekXi6pFxdfJ3B1D+l81IZp/HMAjtd4xX4P0NwcMS79o/OH8iPHjkX/e/H7eF4Y htW0IcpFVZo8uPMHx0eEZDzwNI3AnKiUZH5H+KtptAsrAiviZBi4W0VfsaMLXDUcx+Gh Wj6Q== X-Forwarded-Encrypted: i=1; AJvYcCWAemOvVkeNXGhSTcfWSZ0Ec8Qg4N5sX9JAS9cHLTYtiTGzyUHKKpqIAfTzLodw1JXpSN0wU+cE1elpEzs=@vger.kernel.org X-Gm-Message-State: AOJu0YxiWEAK4GWHZwaPu9D9Ed8oD41q9KmUhdZGJ8FlfHMruGJOdJtC Th1n/t0mPLiFm45kDqayq37giWk7a0Nob2I9YTKbRyUpS5nL3rnyMEJHHPO/BBs= X-Google-Smtp-Source: AGHT+IGB98MZ4b+WRaD4A9VvwnCwxRN8d8/Fl30hE0Oq/p3vkPf3ZXCtCy1fbIicLKx9CCVIxFGzog== X-Received: by 2002:a05:6512:e98:b0:539:93b2:1380 with SMTP id 2adb3069b0e04-53a154d80a7mr3793237e87.48.1729283681263; Fri, 18 Oct 2024 13:34:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:40 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:24 +0300 Subject: [PATCH 6/6] drm/bridge: dw-hdmi-qp: replace mode_valid with tmds_char_rate 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: quoted-printable Message-Id: <20241018-hdmi-mode-valid-v1-6-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_Canal?= , 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=1944; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=62YpkgWLFOCHVyXEfwzdT8WXezDQplIIX6XUhdEmdrA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZX9lakH8ExWkyFJBh3Vc/U3dgf2jd+BXIqJ 6Bk7kv5Vj+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVwAKCRCLPIo+Aiko 1S68B/0X7Ry1mckj6d7MJuKYGTrRuZOVLxsRWDxeWeqwBQoQpAxzeojZvPJev6Oxh31fNJfDHlv viIPEJeCikJpCIWZRjx18K0IkZgFjHF+4lPgja+L45P7s9www21/P9l8yxpZxaeY8tfp9Feeva1 w8zMRXKb2SIsoV5auELsD4HbL/zMAREVeDlAM+MAs/gM5SsfNbu0xS82tMU2PvLaWr23nj+XDiN M4NgU0NZh7rhHdbrRlo9A18C9fmxpbOkQCz/+cPA/upYzQy4eY6ZKOT9ZTAWLc6fVO78/I18bp1 5I4arn059C+4n+6SO3O3HL370p623RGL7qCqpFj6x7vdg7A9 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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. Signed-off-by: Dmitry Baryshkov Reviewed-by: Chen-Yu Tsai --- 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 181c5164b231..c686671e4850 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, } =20 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 =3D bridge->driver_private; - unsigned long long rate; =20 - rate =3D 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; } =20 @@ -510,7 +508,7 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_= funcs =3D { .atomic_disable =3D dw_hdmi_qp_bridge_atomic_disable, .detect =3D dw_hdmi_qp_bridge_detect, .edid_read =3D dw_hdmi_qp_bridge_edid_read, - .mode_valid =3D dw_hdmi_qp_bridge_mode_valid, + .hdmi_tmds_char_rate_valid =3D dw_hdmi_qp_bridge_tmds_char_rate_valid, .hdmi_clear_infoframe =3D dw_hdmi_qp_bridge_clear_infoframe, .hdmi_write_infoframe =3D dw_hdmi_qp_bridge_write_infoframe, }; --=20 2.39.5