From patchwork Fri Oct 18 20:34:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0A98D3F29E for ; Fri, 18 Oct 2024 20:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5GuU7tWYyoCMELfexr2H69ppcidX40bNWoyi/8R/8OM=; b=xF268QAQaZTP0u9dU33JJfk+s1 +WnpaTzI3QfWC9jgxL7mUb1BW2i06dUEKwjkxuCPLHoGxiDymguk84u0hi8KnyHCqU5JI9rC946ay DvdxWfBKtNO3zDwWztAHWpSIIRSTn2MMwXhyS3xG/L7njDedk7ZA+C39b7zhk72AYldss01nAjAYZ NTGJSp/vKT1qbzMeY72wY3rEYKy5uJv6DA/0B3vrt0jJcsM57RV/Tq4C78lBdOCXuW06exw0zQDs7 CWB/wcdxkSvhEevcD9L43c1V8qbTcWneN6fyC/GVpDFpgovuAsZMiPOzD9iOGyhO4OFDQwOfESm05 fKmRVhXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1ton-00000001zcM-1N4y; Fri, 18 Oct 2024 20:43:29 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgD-00000001xcd-0lCq for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:39 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-539f1292a9bso3323996e87.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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5GuU7tWYyoCMELfexr2H69ppcidX40bNWoyi/8R/8OM=; b=WWH1FtJUbp5VIIm5E/yyfQaUo49eSOkPkDwHrMtfTujCuWCSVCEdN0CkMwmXtfz1I3 sQfft0rhdJkJUEPjSZ1AKUb0808g5L6KBwX+mZDB/lRDUuQ7IE9gxaguRLm/3K2zNGcO 4HHydBFFQWYeuKudHAyHKIT/e5rJ0KnMU98GAT5c4XJtPHBc5g7K5loLUXAhCK9T4Q02 58LouNrpreiljdWt0Lg1GkBGVfo+o7gSM1PaG35ecpFjxtitBXvSyBF1sEtrw2g2w5Ef f82/mIFG45oSR7ZY6R1qy8mnUaNsmiJGNnXAwnp16AxNJHATmhmkAX7BtsoJ7L+/X271 EiVQ== 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=pMlr3J3nFLoGEwBwglNDK974gOgBLYvf3j89HGgKYJuTa5QC8obhz1P2Hvr20oSBrR t20Bq3ZUO9ga9/5mShe5emC/Ewwd20spJ+VMZOKrC8lMUHHcyTjFUWTG3rLlFVmdUT8l 7UBgvZUpig+hmoVgyxi9WGih96/L/tXHNvoBTjtS0zay6m8sSBc1wwPGLz5ZDEUHylmE F2grWV2qJTjMo+I/Sd0mzVUuJu+/tIh32DvNvhANfPUBif5RNCto6NmDCyvIiPPEjw+o gkzl5n2EoxRTG4leGrb7S6JBVM0IvKSuNZzXMzGGpuqQ7qh9H+oy7b3MAzusLHLnB6Ad BCqQ== X-Forwarded-Encrypted: i=1; AJvYcCV1w76bfCKPM7XTP94+QXv32hknUun/8LBVn/50FOkukXfriwPfSsQWQ8y4kJU1a2aJ50R76NVijOA6K2BoQoP1@lists.infradead.org X-Gm-Message-State: AOJu0YzEbdYxaKCkfBDJJFYYoL2Z7NcxcbeE29Q+vuirgKQHaZQ1vmO7 Q0DkRCiY5tYvYI2nHxXvaTtMLcF1ChC27/es3VD9ANPQH9GyToDdA4cgBGQzRs8= 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133437_347213_3D8CCF81 X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 | 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/display/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_mode *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 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(const struct drm_connector *connector, + const struct drm_display_mode *mode) +{ + const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; + unsigned long long rate; + + rate = 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/drm_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); +enum drm_mode_status +drm_hdmi_connector_mode_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode); + #endif From patchwork Fri Oct 18 20:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25BEBD3F29B for ; Fri, 18 Oct 2024 20:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/m0kHi0t1totPQ3PzKzLk6eKNQU+IyYcKKk3sgyVyJI=; b=Vzi4IbYwV9osbn4+FCbx9Vcxka dGpZmjsddfgbkHk+5RH2vnwl1xW0miZ1ITR7rsqR9Go2PESuWg92GbGVdiJ1+Bqk3g0K3Ir/OvlEt GZVA4ff9mtv6WU4xbz2rsCzxB3qtmn876T/xB7TtyXCnUqJTvjq9vtiTSmkvJwgXiekhHh67Wn0f3 bnyJ1STpVukFM9Owy9oh/pIOWgn/wZWuzbphmtjZqmP9QSheUVcPmSeazkCXbsjD/L+ZYyLGpna/K M7OJrEheITEYuMX4Vcz4ehn28a8mLEzJ3kWOz0DxzLBY6pynLd38Z7w8fSHFk9fxPfifHsSo1+psK RUFVRkQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tqE-0000000204W-2xnM; Fri, 18 Oct 2024 20:44:58 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgD-00000001xd5-3WAV for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:39 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-539f7606199so3019766e87.0 for ; Fri, 18 Oct 2024 13:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283675; x=1729888475; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/m0kHi0t1totPQ3PzKzLk6eKNQU+IyYcKKk3sgyVyJI=; b=MhMY9c26EZ8tdlM/bMtRWNwoQr6M62BooOx2lmKCBEWmHMKDd0zt0zOx2dpPKT7Rad f/j5YIY1mi7wQDSOHAUK+BpRL7v4XARGU/ysua43/6eTPiPyj2/SWslk1r/M/y2WhkUR UXsNx1DD29sVP0zwIuze6qq+vAPx+mzKj+0ALHRt00OkR4R/PKTPw8TPc5HKMRLq0FEw VdoVidpy2exgxbCQt24ozGzE/TSs6yQvp5X5UJriqfpu2HE9niqv7GikJFsRxpfHT9Te z2KKjTC28Z66d0s9qrcTmqXiBZPFikAZyrw+j6D+mWppL2UBCSQkU3oYj1gFO41wxd5S T98g== 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=VboVT83r2ZDCVyaVHobnwbakv4tuxxI0Kn41t3DXN+Mg1Qsb7f6cfHLNxW6y9IoxJf XUXjcEyqgzszZNKsphDF/ZsAoHCkzce+5rK5/dXegC7NPf1aq6jcCfPZDVjZ0/s9D9P1 RVI0TlnHOxlRW9IarWIj8wueOsx0/HpURy2WuK6qC9ou5ZjkuGGw+UWxub+wwOYWuAGH Vszf7O4w37LUJFiQ7F9toiEiA7EY7w1J63j4gez0efKeY9hMCkRadaDtV5Q3nF5cxmc9 gGpM7oEPBOeqMAYIBgR2pg6/bR4pvjbjokc+z7/9fIXWFzbukf7hKIR2G8H1t6Ks1Gp7 GYZg== X-Forwarded-Encrypted: i=1; AJvYcCUdIAo2fkYH4+bTW1JyKlPJfSfZZgB6rowrBhUoHYI8wKVJfYFFunL5vZVm4lF2QnfHOdEHXOUgBnP9QExm+xr3@lists.infradead.org X-Gm-Message-State: AOJu0Yw1TMTegnPQw0Ho+wFosS4El4trJFBwprKLU30iwgT/4YdGAyp2 jT+0IsF6IRIM5LQ3CrRMpEp0JrpBFGjdVmMY9AZSKxSAYTEXYu+0B7BuO7WzAhs= 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133437_929931_190058AE X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. 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 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 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 Oct 18 20:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D192AD3F29B for ; Fri, 18 Oct 2024 20:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ca1rU5SjfCzQNv/FEym5QKCwQ3XnYE+z1oSBkBKPVBg=; b=GLZTTC3Q97wCB6GiwuKYDwVhwW 8QnF8CBHU5dpROy0WrOfKt699VzN+NdtOS9i2aAYSvCuWoWFntU1Ou+2FnN1nLY7LaWlE7EAAzAVE 5VcMD+Vcyj8jLYuIzTm2GOTIHdEcovVVJy9PceFYfbWjL6bx/Fvq0M9+BgSuvWYmUGhCzA/ZagAvs 7ccC/mA0sRQiVaqrGGuI0EW5tkYbmfxsUzrrMthd2LzZXOItkikU7oeJfYa69g/PVdCXt8WALMmZi f+He+olNimdalLvOZwC9qOIimkNrObcxEKijV4LUpSucQs4tw9HgOVEQyYlOmAUd3ocVn3SBxAoO5 fbSayo+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1trg-000000020Ld-1pQq; Fri, 18 Oct 2024 20:46:28 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgF-00000001xeQ-1TSt for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:40 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-539fe76e802so3084578e87.1 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ca1rU5SjfCzQNv/FEym5QKCwQ3XnYE+z1oSBkBKPVBg=; b=IRLI9JaaB7PJMXWTQFsGyvE/6lL3xa/PYOfomM+BmhX69efG+NNbWdrjajJ5oys9xQ hoKYyOJuRtI5o3SEDmyaikWqDVaYKopF3ymqtDYNuBm5yxYhKxpzy5EVMC0CTgpgN2Z1 t7Ywpe/iyNw/L2kq+u44hsJ1ybh/U2pLJU+LCGkJhRCiOqKekFqqrJMBxeVvr0dFK/s6 gqRcq9Zo8QCQmJN8BSrYv1zaaSu8SoGUq3z7JQKAFllCuLVFZBmxE1eWYWKlimgnX52f kOQvoUwJ7fEl9O5o8M2ljgNRnk6IBFqTD4Ho2HZHuVmSq1ZMQqVYUhwCusmB392zsD36 qHqA== 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=N0n8PcfiyrOwyex7m7q79ca6q6AggW63qIShpoN+HpnX1PWvhmJoswHo2IL5xgSdP2 j2B3DUOjCoLBCq6BaI1al5hjX4e4kwbAM4Uu4tNGW9uEQq70KAD0cgWVNTDm21ngloLR i3J/uIvy/T84896MGoyn7f1KkrycIwHXyaA2VuSKLSet19MSOmR/DNqrBHwOYzui0Xuy 7BBLDJHm46RAyuP2Yll8/Jx0UUwNwHeomXRJulJVEkZlqp8QOx+gbkX77WUoRy98Bs9r 1+XMEHhlzazNRfvTpIYLqAsYnLmyjN2O8t6Sb0oyaQj2FxC5K9zkIh4JmibI010C5d7B Syfw== X-Forwarded-Encrypted: i=1; AJvYcCWRkrt73TqiWctkLPUODRaLzT5DiOEu7rTAd9KpFO9nQ7VojvoTUuEtJ2i7fc5C4POSxWLz9PpOFWV4O/Gt2GmW@lists.infradead.org X-Gm-Message-State: AOJu0YwHXzlcxXMgSCajIixN5IQANldm0KnJ0Lyugo4jAcLkKnrDa8un 6M2JFLeX9drCJXc90HODOaXCzyQMXvfn+FUXB1Rd1KDNCxu1sG91Z5HU2gDYGeI= 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133439_556023_6E65B8EF X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. 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 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 *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 Oct 18 20:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12BC5D3F29E for ; Fri, 18 Oct 2024 20:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=HdsYdXyVM238ZtJ2wQVLNOVp5C Qf3Bhguml6NoYwm8zD3LoFgoXQWAUJKqDNMZOlLG01rpkFXwUvAF0yvYhFYowfDTNA9z7An71LYlG 3KtLygOH3eCXf+BA/GrzZ/2vJg7RDFpaYw1MXPlpPAxh9CIbznTz48T3veqXedi3fU9BvihdgDvBz nCEciy490cFw1EGWGKRpt2UWE6piuIlU0JqHAwO5DObdKXN4zov3a8RP+nhAP6RRTJBKR7qvj5/03 7ygQbS+D1Pu2EY0KDVVIZ0xIL4D197ObuotuoOvpm7Tg2AqpLK1l9liRQMdhFB/bW4rUaDpY7DJyc isq08NLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tuX-000000020jU-0Edo; Fri, 18 Oct 2024 20:49:25 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgH-00000001xfZ-3MPy for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:43 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-539f72c8fc1so3009676e87.1 for ; Fri, 18 Oct 2024 13:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283679; x=1729888479; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=wZvPRkKUZvzMXQCU5+yU/hrimy5Pc21lDHajmiClvrUz2BHj+4yo0j5YZX4QBVMF9D DMMZALH4eLAFDzdtz/kkbd3Zga5tJm6hg84/OvTrR8EhnD0QSaBoe68CxRnJewBeT3bO zE81O22GR8bf7Te9jzHbsE0jd1hHBwv4Y5c6ZehV8JZHVRMstR5kufeDEBdwS1zO5ZFP ih0gNg5f28KnCiM3ekgD/RTgC9kaYzutqbyjA77w4SkUOBvQjhINPoa3hGjI37UdXm3U 41S/T05zuKcdaCoeK9RiJZ5OCWycVLosnzOBl+i+avI/bIpPAdzv9YMmqRuQGhXF5QwZ SE5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283679; x=1729888479; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fjo3xom5hyHJVXQDe/CPNDPIWLjDZtVAaVw4HhlPIfs=; b=lDhojpTC6xCmsoVlys9/3WVnJ/X8nt/WmQpxJ6VHrg9oy0RMaVc59hMWa5YnxXvCXU T1IpDr+nggwVIoBAn0IIjeQeQjbthVRdkoN8L0pDCXZRlVIs5EGVrU9+kPEF7qvlr1xW KnXDa1I2zzMSt/siItDiStVj1GfOKQn3g2UQDnPYKcn696A3AP7e0yNcSNmCTwdk//4g 78V9LoYML4FSg00QdySTcvHMigOuNZWYds5UAxsYhJPHsYvp0bOnLUeS01A39s6QtEA4 h4vBBIk2ZHaBTydR4W0mKFG6gyGWOYs6tmr0jp53G3aeTO5DeE+OvDebaMvLHPrG6RNs +5ww== X-Forwarded-Encrypted: i=1; AJvYcCXiED0VREHkSHeqAbZQgL1pVwGX8n2UPPMnUZKTeVAf1jDqA0+BxbldQueLqjl6rcC3zvMI2429/5lLuzMkTeFS@lists.infradead.org X-Gm-Message-State: AOJu0YyeZZ+8UB2ES219Wl4Ng5n8l54T8QYD0KviDX9h4+RV8XIzs7VE lFmI3/8x9GHkqvsQwR87aJtQeef+2o547x8EmV+BmeUjN68kuVpTBHxajQqfxWk= X-Google-Smtp-Source: AGHT+IF8BVoRIxnX151X/ou3wfgvDZ33vCYdpPGEJRWz11slO0h1dFciQ3fgvHB6ZjPafQuKkOrHTw== X-Received: by 2002:a05:6512:689:b0:539:93ef:9ed9 with SMTP id 2adb3069b0e04-53a15231e83mr2568387e87.36.1729283679380; Fri, 18 Oct 2024 13:34:39 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0e09sm314047e87.146.2024.10.18.13.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:38 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 18 Oct 2024 23:34:22 +0300 Subject: [PATCH 4/6] drm/display: bridge_connector: use drm_bridge_connector_mode_valid() MIME-Version: 1.0 Message-Id: <20241018-hdmi-mode-valid-v1-4-6e49ae4801f7@linaro.org> References: <20241018-hdmi-mode-valid-v1-0-6e49ae4801f7@linaro.org> In-Reply-To: <20241018-hdmi-mode-valid-v1-0-6e49ae4801f7@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1724; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=N3fpJ8U7Ak99t/Z4rrwzOntZmmVW0UU1b+pAthTP+sI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZWeps0ACTRHt9hRd/qx7Ya08ePnqAT37CMz 0SKraccjUKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1b6OB/41ftMl6NnJ3cRxPukMLnle7BAxhRv6D5fefVcCKYyvbpYkKmNAYLWRN8s0T2q/f15mZfz UE8xxtBlmALOjmUa0S4uLfve0aqalgAsQIAG9gxLSbBNhTtpmLNIv0+RNpJ0DRnrwi1ND4bJIgT WPcqL5WpwQq9T4rkiQsEHwcP9QuxeEg/wAqr+K/MAHq/1bLpu6I/kzDaeoVbr6w+bXxy40f3iq/ EOpk6yliKUDhA4ypEeO3L1mhNldVR7bsYUwVdsTdqxjqcadDhvDyIxCTv/w4AIGengb6jNP7Iei mXCwiSlpXwh8my5JY/3Qzks9N7ysEsKjfeZBa2l+7EN8yQqU X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133441_881968_7E0DDA0B X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_bridge_connector_mode_valid() helper if there is a HDMI bridge in the bridge chain. This removes the need to perform TMDS char rate check manually in the bridge driver. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_bridge_connector.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 3da5b8bf8259..3304ab0c00f6 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /** @@ -299,9 +300,22 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector) return 0; } +static enum drm_mode_status +drm_bridge_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + + if (bridge_connector->bridge_hdmi) + return drm_hdmi_connector_mode_valid(connector, mode); + + return MODE_OK; +} + static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, - /* No need for .mode_valid(), the bridges are checked by the core. */ + .mode_valid = drm_bridge_connector_mode_valid, .enable_hpd = drm_bridge_connector_enable_hpd, .disable_hpd = drm_bridge_connector_disable_hpd, }; From patchwork Fri Oct 18 20:34:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E978D3F29B for ; Fri, 18 Oct 2024 20:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jQVWVw/idsCMZK/QpoLkRhrGm63gf8m8ez6XsTKeLHM=; b=g7WFRO9m65e7YXVnGfpIzj0HTo D0QWJgj1cwhR/taMLnnKQo//xB3lA6avjDdLTPT/QEHsFl5SwpS9DdKtw7VHSc9r9Z55OroAtxD6L zxCyvwLtoPkIFhXN8ugYghB3zogdl/a3j3BjTo4QA3yO74bcJj668VGu5rdtjXMnIFC8BBgEAVCx+ 5WXFAjeDICDIJ38qP+H5mh0T5wiCTO3s2xkK4sbOCK39MTv5sXTnUcM9scsBsVjLdT5Q11giIA4sL YXpAh63seGdidPKU35zWNpQAnHvwBzp+oEzkmrJ0o8x0lurMgUZ1uEPLgLirevwcFUDEk0zdPBodv c+nGz7yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tt7-000000020Zk-1FC5; Fri, 18 Oct 2024 20:47:57 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgH-00000001xg1-363A for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:43 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-539fbe22ac0so3056049e87.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=1729283680; x=1729888480; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jQVWVw/idsCMZK/QpoLkRhrGm63gf8m8ez6XsTKeLHM=; b=GT5dMlj0I5a005Jtn3PQtsLGUTCgI+YWMEIR/S8pHxjnMTwDdx04kSQAQWbT8Eymyc XrXR/cSujCBFt+moVh7iu0dorYbtVq8BSvUkwP4O9B9kbbOiLc3dmOQBuN24GIpo488T 2G33WIX+U73R0o/hbw6HE8Mxfg1CghK9NrCMhXlJc6w3GeuEamDNV5PURXmRNUfWXtgi 0eXfBLkRWPu5DcN8IEYdNqTY6o4FqMSFjWaMC+j0VHFISYW69kQjh7+XrWSb0YtFyift jS4vAxabS7FRU7qhWTRNEJPgf1UX/3kPXRQTnssWyjbp9HcxaLIRoWpnN11+jq8W/WtS Tmxg== 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=MpCvO+icLYKeOhBk9E5Xr4ubVnuqhfzHXPkzJLvqG6fbcZxt4FleR7EJ8jnc85t7aZ Mu3Xs/cNzNogT4Q0BvpPDJ0xiKUUzwvy4WswM4IxsLkxh3s+xnmfkj7HQETNBHy/+Mjg t8jY4m6ZFSn0MmfMKRwj/6YAENgAmtYp+Meu9dnJSuBH3unQGz0rnMBVTl/7w4l3cfN9 9vhm58TxyyHOv/xp+pSsoVKo0AtJF++3Jv3jG+oHlysnlep1zKXydY8DGXFMogY4tnza 4/lRjHTXoRdNYcmT61ZZRRi3z+6ZXBxQ9dQaV13HvEMrCkhO7xZqk3Hh634zcND1qpWH HJTg== X-Forwarded-Encrypted: i=1; AJvYcCXZPJOgk5KQCUbIzpSta9JHNaV0MclScBPuVwJgU+h+LBX45rOTTlNfiHV3OI5Vw5eeLNE4xRGzErREIAj4j5r2@lists.infradead.org X-Gm-Message-State: AOJu0YyqjXXTB4iXQfbUYDZ1G0LFeP+bCjORGgLFCLt7fxVFWBNGN2xG 6AVjo/FtRFSRbKcv936Lensrt1UQxxl3Rm71NB8kDiCapU1LiJ4RRk9FM2QseJo= 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133441_819800_711DBD0B X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 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(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 Oct 18 20:34:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A3C1D3F29B for ; Fri, 18 Oct 2024 20:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8KNF3aZ80xlLK3q7tI6wiBMuQSM/G62kGRgo4sUnlVk=; b=PbmUn/5oMl/Y5y58oPs8V+JYNa yuizLMhWdcM+Tv3MqHnxU0lo2cTZoimO0NKpHX06AftW5thtlDucB1IVSzfjf33c2XpGkGGp2YoxQ 3GaOYuD2/mVidODiQzeltJbWC5Z3/xR9SyA2fqDrWAvHCpVmUciTyPhrGTuUF34t5HiefBalf8xdu X0ahuAFMQAXOMtxM2J3NHhUYPU32X7R2xiAIjSURdeo5Re8Kq2osK1Wkh8PE7TYfPS02dVqQA3/SP hxvwZFE31EQ8HkeQ1e/WVTy3sz5xH5ymBxMciVLDSJtndayTGml01LudE+Xf4axCT39K3GhrisAGn T6U8hFQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tvz-0000000212u-3S8B; Fri, 18 Oct 2024 20:50:55 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1tgJ-00000001xh5-2xn5 for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:46 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-539fb49c64aso3755190e87.0 for ; Fri, 18 Oct 2024 13:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283681; x=1729888481; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8KNF3aZ80xlLK3q7tI6wiBMuQSM/G62kGRgo4sUnlVk=; b=lG/RLpnijN651V+uqzFWmFpEQUM4NIuJxfbzvWpYrREp7G067oQYiF60NuflNbtRYg Svcu6oZ3CHZMnL1OA0jqRtmKOSad40kRD1W13VKtinM1O3Gf/ovf0mNdd2FJq95Muh6Y Xbik9W+IxW4dgitN70a8O01Dkgd1b1k2hqTphFttuC1wANm5EMIZdG4G3+qp+piQZFUS jCK5GiAaiB90W5/I56SKB372kJrLjF6uqmKvVETsmVfIcG/BhgXX7L+vzT2asmLtfsQ5 JaC8G0ixiPOyb2j9VmmX26OowM0QRCfWbi42aQvfBLxUNWsZIzgaxLcFly3m1OR7oKZ5 4/3w== 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=B2VVxuYWQE0pnbOVXJ/X0Bxa8hZtLco4ACeZlgtFyHnVXEFIKuqbfmg9NPtvcI04RG X8phJwbhQt5XZTwxL6W6pzvO0CEI6FKdtYwVedHJY4F956b81e9J8QOEtRn6BTkLgSyT 2EQzSaqVjN/NUMx/Eh/QNivvbt3I5ENJ+B0uG0EliY94QytkHJ0DlDvsSoUTM6uL5Vj4 Y5S4JesvdPAhjXKvjOiieLD8fjXtOzMjT6hTkijZnspLgqNNg9nwR0HNuWDyHDMTSGec wq7aGbFGixoHhDC+Iya2zuLOcLRvSdRl4reviaxr6ZLo0m00XZrUhBlo5XOV9Rq9mF+r 3fVA== X-Forwarded-Encrypted: i=1; AJvYcCUIQ8nY2U3dZ3TTuov6JZEzKHoxttdNniFO+2o2ivbX9+H4H8Vstbfl0VZxkIchaPc12apV9LEg9ZlEpUn7DK+W@lists.infradead.org X-Gm-Message-State: AOJu0YxAWefsab/ffpIb/mb8YU+r0J5RgPnlAmsCnqH5XqBVRNVEIlqn DDyJ9OeQeVzn71OLBndHa3tosvp117jYNc9q4g/V4qgIeEFic4WLZGAHXWgZXHk= 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133443_965324_83D6FC4B X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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, } 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, };