From nobody Thu Dec 26 14:51:26 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 0FF3457C93 for ; Sat, 30 Nov 2024 01:52: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=1732931561; cv=none; b=ATU7HhxhdXzb/DFfrcQZigw1RKUJj+hzr34EYJ8uY6FRGyI12kM9jY3MOO8QlVwP3k2YX3URShLO1FA4ZKbLUfsi8C7Efg6BK5NZtwIG9Q30WaGjXz/Nlsmpg05WHP93vpODqIUvoy7pA1QIxk+sERG9c7kx+QM4vLbnxlWJMU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931561; c=relaxed/simple; bh=rXzXs1LIiHZL8UtREKepdy9gjR2Nvrl9SsrJH4c2YZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cwQRCI5Nk7LBh/PCpXJnSk8j/ZvsmGcpX475fEJohCutr3tB9gRRxjF8eVnBSomcjOnFT4lKnXL5ze7gkuoB/0h+a63RhLpC6q3LEqF/UnNpSN6DinEFrpxJP9eeaCBYZrcm0KPlGaT8HmEYJi+EXi+zwtrctHaUv+c7kMETVjs= 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=l8XyQRXY; 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="l8XyQRXY" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-53df119675dso2969511e87.0 for ; Fri, 29 Nov 2024 17:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931558; x=1733536358; 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=rL+Q+A1E5WdeyWGlnmxBrdioN3F1q14QakvZcTSmWyI=; b=l8XyQRXYQBp7wnDYwF+fLpCr0OTLfMEPHz0KrxvzUhhuZMPN/RxWJYgLB9QmRN5EAU R1mY+Sl/LrXptRVELzc2l4VgeC1fuNE0R6Tun/2tQBTMxG0r08ttI5aO8qCML4Lo72t6 10Ko9ZFBjZ5Vak3+j4LejBzRvuqJvo9PEUue9JIvUkwjfJs3bJTzXtsrOC/lVyjQN2OR FG6UI7gAeNEuXDB3z2SKnTffw6AhA3PgCgzF0IbhhhdLwAZaQy01u6zjmBOF2Wvu9AVQ TjYI85Jr3ciVJJznImG5XalUzFZznvpAdWV+8B+p8ePZK/FupdIBtyEXeiaUOvNQVS3V 10gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931558; x=1733536358; 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=rL+Q+A1E5WdeyWGlnmxBrdioN3F1q14QakvZcTSmWyI=; b=ALcD/Dm2dMm/q552djuZQeEDrwoJJSzgVjdgU/0OjWfZXIQv6eTIsyrCdxFAoDsH0i yodS5h/RYpgCr+X9Tadvt9tIVd6TGIFEdP+FNdc/sibQActewXkxuSZxd9+Da3aAd3Mw 2o9JjCG0Yy9wNmTIgUD7ZUpoipkNVvZOpFR2hqrkU2Of53iO0pHcsVVjQyelHR5szkvX SwVRYGUdC7ulP32EeZcGKE7Nxdz9lnt1j6ViD+9wD4f8aJQsAtcvhyim3WK8dw66sLhr Y+Vaby2w1LdiGUdyrbEzgeOz47SdqUaqkGFFmDE8Ou5/NXrEISVwI4ttSMQExcN+IBtp fc5A== X-Forwarded-Encrypted: i=1; AJvYcCUdVQxwl+L7gxYEIXwJk8cs3vnq0Q/5M+VLgBbD/+lCHQzhplRGUql3OBu60h4MF7qJ6cU5uz8JLTQzqxk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxsj5h6i47LXDctaTUWnF7OYhbJJgoqWEc+WKdBB+FKH2zf3F6U gFp4HJKxriS7vHJL32TP0mYHEmpScspB0xHDzm8IELaAqXZ50GjBqjOx6DkRwDQ= X-Gm-Gg: ASbGnctFb/HuQRTHPNwOJ1J04pmi6lElZaEiFKkasvFZs+2BETOODpN+65i8J4JT5Vs flTDnmEE4r14ZL8Gc15I5naxUi9Updk+VCWSXGX5UKB22sfaBMzSuxPVWTkbu3kz6Ek+rKlqY0v 5hePHF+WGXyMsUHhh7FCChPFeJ8yAoUo76wSzBTv9mRBTMnS5RsNTWPh0aKHhjC9pi/k6iU3Uxf gdkBKkJdjlQQeZkKk9hFDqP16xcbWf0N9LHqz7rAXDoYIrXNj3hCa7nMg== X-Google-Smtp-Source: AGHT+IGVvdf1lO5fwuFWw9xeRiergMVxDBWPVsqq8kgBU3WEnEIe51FT1/PQjZaCSi/PMkMqSKbTIQ== X-Received: by 2002:a05:6512:2822:b0:539:da76:c77e with SMTP id 2adb3069b0e04-53df00aa234mr9021742e87.5.1732931558219; Fri, 29 Nov 2024 17:52:38 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:36 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:26 +0200 Subject: [PATCH v5 01/10] drm/tests: hdmi: handle empty modes in find_preferred_mode() 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: <20241130-hdmi-mode-valid-v5-1-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1196; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=rXzXs1LIiHZL8UtREKepdy9gjR2Nvrl9SsrJH4c2YZQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/fBLnvkUW9qRbw575QavDrP72LTHBm1NxMz 85M4Ziti7uJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv3wAKCRCLPIo+Aiko 1dv7CACoQI2bC+09l2FHVrI7eITxhbdZjhlH6ypKucApGgA2wGe3crPMsMfJbwgJSJY1noUUULK YusunI4AlPgsBei8HxSGMe41Mk0z8AcWabq+XcdFbHG9aaY7Q+myFSq3c3F2ErXzjv0yWu8DFBA 8oR967KFGvjLLSa7noPp/Moe5zrDoJaVD7HriBced36KzyqZLROp652AKv+6CpC+rsOt/T1NK4L CNXvVqRyV1Adpa4JZASWt/Yj/xDR+/FMfqRCCdFJLQPyN9uG1m4rChL+TjewMB99voI2nIaImHt /oXkkNBHtWoZFXDTAnJws5tJU/s1zd70ka0C29pX++CTpwbp X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A If the connector->modes list is empty, then list_first_entry() returns a bogus entry. Change that to use list_first_entry_or_null(). Reviewed-by: Maxime Ripard Signed-off-by: Dmitry Baryshkov Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/g= pu/drm/tests/drm_hdmi_state_helper_test.c index 294773342e710dc56772f839c2db9c2e487bbc1e..1e77689af6549f162eb3026c7bd= 2bbd59516ed98 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -46,7 +46,7 @@ static struct drm_display_mode *find_preferred_mode(struc= t drm_connector *connec struct drm_display_mode *mode, *preferred; =20 mutex_lock(&drm->mode_config.mutex); - preferred =3D list_first_entry(&connector->modes, struct drm_display_mode= , head); + preferred =3D list_first_entry_or_null(&connector->modes, struct drm_disp= lay_mode, head); list_for_each_entry(mode, &connector->modes, head) if (mode->type & DRM_MODE_TYPE_PREFERRED) preferred =3D mode; --=20 2.39.5 From nobody Thu Dec 26 14:51:26 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 A05EF126C05 for ; Sat, 30 Nov 2024 01:52:42 +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=1732931564; cv=none; b=uqd8wFnZ3rwQhWvU2IO+iZlx6/B7QM17QBA19haKA9njTlFCwhOeqbD3SxrmzHhcvl99Ec7J/uGtS6fTKRKsynBLkInLgNXBTXWWaxmnyPAwltd+a8UmrT3Mxsnvv1K64yOZOtTot4LEKPWYI4olAOOukh7tfNySr1sY45UKSjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931564; c=relaxed/simple; bh=v8BoSRVhNVLNIqn0L1HvmQQ2nfTsZdUMUqZ1imeVKuY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XJXmgSzlJlnx6aCR1nFxFXMpY3MWvk+rZgnEyRiuSnpC/CWphDzm7dHBbl25hYdHXqE28jSVGhfXn0w3fDtlOGLhnf7F9505zzv9nVmHtDx76xC+5+Z+rjI9EQ8DVqU40oyYTOs3eWGaq94ydhC9jtKtx7COnaIESmi/qoOxIJk= 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=KeqEvpgu; 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="KeqEvpgu" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-53df1e063d8so3074842e87.3 for ; Fri, 29 Nov 2024 17:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931561; x=1733536361; 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=b4B0Y8eeW8nijFHMU2wdPBEmou1JUmUHuwSM02tCW6A=; b=KeqEvpgutvC0cpWVEakEgILb4XPFDEN7wgpFqKIJvK9ltC2fUT7UQqd09s5avbfSyJ vLLuPGtUE31NmexP7tfHbOEK2idqXDT6QGnL8LWke0hV4BsFyCTPIUt1+6ES5hwGkp4G 6g+nfJmc6+5lVCzxGLOEBJP+OrqvD/9HtRVIgNV8X5zHrD6bV8d7w2eSwYtEMcxMKRiZ WqX1OwbzJmvggj69RRaJCCXOuBQnNj8lgSHysAvH2fWBZG07qiriqr5nz5suR5l9x+l/ 5o9chmCZtwsRQZIFiqbJ7RHwCzg3C9bxvRC3xy+vsGRLjlFVLZbyoEcXpuqcvrG99kBB 3giQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931561; x=1733536361; 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=b4B0Y8eeW8nijFHMU2wdPBEmou1JUmUHuwSM02tCW6A=; b=HKDU/HQuKVNPAcgeruCf4/qIaCLShiNW/s52ktluR1QBHAqcv8/qofTVxwG2Qw6yS4 tFdL5JwBk+ScDW4mKUjAOGna1msvCNFPfL3sRdXlfyFS3II08vw0PR4ZBeQQq1VnM6Ta KqBkIRjjWdM/f1VToCr5UtHqlopJB0fcZNwPDxfqt7JBiNihsOhQuPoDnevk5izSzWux e7XaiKOI8ZbGEkYQ/a+pTIMi4zamcmUxOAVfExAqtPnf+a37yL6vNaVbO+FPVdkA/lov aU2mArzC4Wj76QGWeAZok+4tbRrUhKmXoup4meW5UD6OFvGd9uq9V3fSM0Qq2QVfka03 +POw== X-Forwarded-Encrypted: i=1; AJvYcCWtWc1x0TFnAjHgSzEhJ/6PoOXIW61zvmydikvGiqYoyYp6um52G2dK6T0g7GmdQVcKLGsNSg5tWGclYLU=@vger.kernel.org X-Gm-Message-State: AOJu0YyPaQ2WLXZkRnQQMxEAew0BGNiOQF0pqPfYGVdqRohwTkZCVQYL PQ4l1Tr0SBbd4WjMdkutVmC6OTtwWpfW5TAbbJ9fc6CV9NLtfb0p8k6Scp9wJcA= X-Gm-Gg: ASbGncsgTFqf9GTbKCDGJs1sVbRbrtOuJX1oCvuzAUQZJvop2w26Ht8LBdu2GElh/XX S+YOPk4+i3RM+NKSPtxziuX4o5VauBQtnwfAI3uI0ebz/Ck8sbxFin1pnA5j/Rk64NlJjjnbpZr mPvaTK+WylaMXMXLK4RRf5eOviFvvHHoZfFK3DcPvg/3oT14iCbgla8AgZsV9YXxpJh56TRaGTG 9uEeRwaqfn5HuyfGqganC/2nJg+KxNa8ke7+eQ2bybTD7itxE+VcpWgNA== X-Google-Smtp-Source: AGHT+IHr7e6eqX9Z0gQvURdKQ1bdtAFQTJZejUyHCz6bKeZj+mC0/lLghPW0EOJgTJMIplS8zy4hNg== X-Received: by 2002:a05:6512:32c1:b0:53d:a68f:d901 with SMTP id 2adb3069b0e04-53df00d1b06mr7609554e87.15.1732931560699; Fri, 29 Nov 2024 17:52:40 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:39 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:27 +0200 Subject: [PATCH v5 02/10] drm/tests: hdmi: rename connector creation function 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: <20241130-hdmi-mode-valid-v5-2-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=14634; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=v8BoSRVhNVLNIqn0L1HvmQQ2nfTsZdUMUqZ1imeVKuY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/fLC3qTV5FPAg0koUKF7mCCVp4yjgnKY2Ob 7XbeEcO7OuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv3wAKCRCLPIo+Aiko 1W8+B/wK+y74BQCSvsvXrO6Z3w7xSSgmnVQ99HIWNd93CVXPYrCnNdWqf/FAeZisVnWQRjmqeyV L0N+uCP5Wt1zYJyCnIFQC4R5WgF8vMQ8v39fsp9Ab3f03lvV/5/BpvWcBC6FQdGTBx6ObXov7xp VOVE5CIYcE5LxJWlebKEE2e5J0cZTNEH9IyhHjYq8gERQmh2oAKbBBWHs7HpDuSZta1oid9nUZi cdWlFnP4EajV5XBJ6VleF4Ideqv6+Vg/KH7ZUCelcHS5hnxwnbxlw9r1GOLUIc+Gzuk/BCs+E0Y uh9d/yk0xHTcrLsNtUfZ36YteFQsA33xM6D/deRqQpwMun9D X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A As pointed out by Maxime, the drm_atomic_helper_connector_hdmi_init() isn't a good name for a function inside KUnit tests. Rename it to drm_kunit_helper_connector_hdmi_init(). Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Dmitry Baryshkov Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 202 ++++++++++-------= ---- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/g= pu/drm/tests/drm_hdmi_state_helper_test.c index 1e77689af6549f162eb3026c7bd2bbd59516ed98..60b1e37522837ee183c65413e3b= a6c6ec4fed341 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -164,9 +164,9 @@ static const struct drm_connector_funcs dummy_connector= _funcs =3D { =20 static struct drm_atomic_helper_connector_hdmi_priv * -drm_atomic_helper_connector_hdmi_init(struct kunit *test, - unsigned int formats, - unsigned int max_bpc) +drm_kunit_helper_connector_hdmi_init(struct kunit *test, + unsigned int formats, + unsigned int max_bpc) { struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector *conn; @@ -247,9 +247,9 @@ static void drm_test_check_broadcast_rgb_crtc_mode_chan= ged(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); @@ -310,9 +310,9 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_= changed(struct kunit *tes struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); @@ -373,9 +373,9 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(= struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -429,9 +429,9 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_= vic_1(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 drm =3D &priv->drm; @@ -485,9 +485,9 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(= struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -543,9 +543,9 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_= vic_1(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 drm =3D &priv->drm; @@ -601,9 +601,9 @@ static void drm_test_check_broadcast_rgb_limited_cea_mo= de(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -659,9 +659,9 @@ static void drm_test_check_broadcast_rgb_limited_cea_mo= de_vic_1(struct kunit *te struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 drm =3D &priv->drm; @@ -719,9 +719,9 @@ static void drm_test_check_output_bpc_crtc_mode_changed= (struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -793,9 +793,9 @@ static void drm_test_check_output_bpc_crtc_mode_not_cha= nged(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -862,11 +862,11 @@ static void drm_test_check_output_bpc_dvi(struct kuni= t *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -911,9 +911,9 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(stru= ct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -958,9 +958,9 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(str= uct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1005,9 +1005,9 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(s= truct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1056,9 +1056,9 @@ static void drm_test_check_hdmi_funcs_reject_rate(str= uct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); @@ -1112,9 +1112,9 @@ static void drm_test_check_max_tmds_rate_bpc_fallback= (struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1179,11 +1179,11 @@ static void drm_test_check_max_tmds_rate_format_fal= lback(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1242,11 +1242,11 @@ static void drm_test_check_output_bpc_format_vic_1(= struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 drm =3D &priv->drm; @@ -1305,9 +1305,9 @@ static void drm_test_check_output_bpc_format_driver_r= gb_only(struct kunit *test) struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1370,11 +1370,11 @@ static void drm_test_check_output_bpc_format_displa= y_rgb_only(struct kunit *test struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1438,9 +1438,9 @@ static void drm_test_check_output_bpc_format_driver_8= bpc_only(struct kunit *test struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1496,11 +1496,11 @@ static void drm_test_check_output_bpc_format_displa= y_8bpc_only(struct kunit *tes struct drm_crtc *crtc; int ret; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1593,9 +1593,9 @@ static void drm_test_check_broadcast_rgb_value(struct= kunit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1615,9 +1615,9 @@ static void drm_test_check_bpc_8_value(struct kunit *= test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1639,9 +1639,9 @@ static void drm_test_check_bpc_10_value(struct kunit = *test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1663,9 +1663,9 @@ static void drm_test_check_bpc_12_value(struct kunit = *test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1685,11 +1685,11 @@ static void drm_test_check_format_value(struct kuni= t *test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 8); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; @@ -1707,11 +1707,11 @@ static void drm_test_check_tmds_char_value(struct k= unit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; =20 - priv =3D drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV422) | + BIT(HDMI_COLORSPACE_YUV444), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); =20 conn =3D &priv->connector; --=20 2.39.5 From nobody Thu Dec 26 14:51:26 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 1481013212A for ; Sat, 30 Nov 2024 01:52:44 +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=1732931567; cv=none; b=mfTfb5coq89aPqn8A82BrFZvhMsTpcqSFnZFvZDISlmk0j+S2+bpOx2eujYfky40+1Vj7DLlO/2ZV/D4faj6wl3hb0wry97nFwiIoDjP6mSSNCUzpxDjX90a8sohQWUYowz7vQUJeCKuNLyEXsjM9MGrJqNuxQF1Tt+89h2xB1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931567; c=relaxed/simple; bh=SFx9qDoDtf8/ClhxV5ehooUfNSt8Uly/4cPlmvRLZS8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Fs2shs4hCdqlNPD78l/p4rvzoJnIXY4B85aBUQEPxP2l+FADU9BLZpQ7PlmBOSh6u6s5BYEeUAZhgO5Cr0TlN58sm8yt45Jbq/2RpW5VpnP0B6IKznTommsx0i3zST594fxPzlq+cI2zN+OCD1YXMk+19+sYDDdUST7aenYldBA= 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=ht02jFeB; 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="ht02jFeB" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-53df7f6a133so2580600e87.3 for ; Fri, 29 Nov 2024 17:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931563; x=1733536363; 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=4GXhZxLlG0np8t2RRMsMP/s3gGMuI1S/859XP5wOxy4=; b=ht02jFeB8FsDM7XHYjt35sd/CDk+5zPonCbYR0Ki1itJGSLhBsU5liRDkGsUZA/UZL aOKWjN1mvsr3i+hdCHku8g+tcppLk9zhiYFPQcq7L1LZPSwHxjxH77v0c/BtNGT+LFNk lmuS4ed6EnDW2Ej4XAPW/mKBPFTXR9yaJyQptO0PX8ZpVgDChqmXrMg4F2eNHeOhqxuJ jZzWepW+2PWIiTj9kEi7/9k6uHz6BUlhdz4jxgDixzlbCHwZGuvsUGnI7m7XGxWPLx2j XPZ1plMOCWYmqrw7fILDe6GT1x0vABiAnWoyTL6THqrI7uG+NTzXLNPQ4ZkFb5fL/mfA /ddg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931563; x=1733536363; 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=4GXhZxLlG0np8t2RRMsMP/s3gGMuI1S/859XP5wOxy4=; b=mSI6t1QjnmJ7usNjC7fQzFilMSm1MvFHjr0TPRWdzNqvytnNOpPOVV9/otK47L1yAC wlLnvA1sUNItjBoPaep2/9A2Zl1cguqMvfla32JzFF67BSn5i6yp1mXcz1gBcsjakpzS MquPkbyMm6llpQMXYc9xi5eabUubghHAPR7Syo94N4tszJbveJlFeCvlxVcpE9Mft+7B 7XEhswyJJdo3tu/ypUMSFi8zGi9BCupqVrFvE6HgiZyvHOFXzwJ8Tu756F09O33Rb1eJ ct6hYzV4AhkNXlMBu2owxyeFCESKuNbDa0EvdAZkKe8ZHXMcNTLMcDG4yDfCTnEa8nJY idDg== X-Forwarded-Encrypted: i=1; AJvYcCWd+evXy/BI+WELARSHE7A7rl4SGWc5DWliKlFrqpi7Z6wLIJI/4Idj3PKuGjU+JxrIGZcDv74Lc7+x/sI=@vger.kernel.org X-Gm-Message-State: AOJu0YxdbR/F4P8nAf7JeA6cmo8w1Rzwd2ssQu1Y0S3qyURcX9nNznpS ypkXn/KrC8/Lk93gH2nD4ssoG136gUG4BNqyCc8tEfbsV+H/RAyD1QjAvmzITKs= X-Gm-Gg: ASbGncskdxpxqF3M5jTXc6WwiNKN3cgcN2pWAMvfNrvDi4c0DSsoxjRPdfOn4J65C3N e5ZMEEuvgGeWz9/j+fEykr6xOzbmkZSR4ULg8xo129eXbFypCsMjiuUlI2aCsJSzSFE0lvfhKuJ zQOnaqZS4rfBCccpKzbXNN/AlMygMAITLXl/wwIUWYqprOHraEPFwC+5wbZXYoH4mdwpgAXvA37 S2CI8MYBCvRmkL8qNkND82A5ph1yUUpQEZQ44+dq5JjcuKljW7FGWk//Q== X-Google-Smtp-Source: AGHT+IHzCC3VLal2t09KyGXdTrnZqoBD6s9H1e6w27VJXRZNs+63jZodp+vebQZsEqxm+fisMjZw8Q== X-Received: by 2002:a05:6512:3c99:b0:536:56d8:24b4 with SMTP id 2adb3069b0e04-53df00a923fmr9270762e87.5.1732931563212; Fri, 29 Nov 2024 17:52:43 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:41 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:28 +0200 Subject: [PATCH v5 03/10] drm/tests: hdmi: return meaningful value from set_connector_edid() 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: <20241130-hdmi-mode-valid-v5-3-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6746; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=SFx9qDoDtf8/ClhxV5ehooUfNSt8Uly/4cPlmvRLZS8=; b=owEBbAGT/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/gMsVCqTL6OubCQChCuT6FJSmh8jZERRg6K mfxFGFGwIqJATIEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4AAKCRCLPIo+Aiko 1fWhB/Yueq7VUzSoNF1ykS3TOU4hZM/Wy5aQNvwGjGZRLL2XZ74rBCytu7GaWpVv7hE+pXMrui9 CTRaZIPBqf6Kn2MNM+N8abOOWui4Z/C2UTZXkZPowCqw33bWHNblznkVc9KnGbOKT0EtMG3nwyz r9ftIFGbIZ69qTaaZ828GCaEqe3Xt7wvlxW+40Sa+PWyptvIbmIHUMMo9PaYlGg/hpJGZYv6wy6 JXT3qIJaJkIii1Y8Pt6y+ESHaEH+qrXD6tPQS15YZEfZXA/46ycMW8c7o0hmVS/I6jdy0AVlMRU SYPq95rIpN4camq5/fFFTYRe4Aa4xO7HKZ2a+lg77K+Vdr4= X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The set_connector_edid() function returns a bogus 0, performing the check on the connector->funcs->fill_modes() result internally. Make the function pass the fill_modes()'s return value to the caller and move corresponding checks to the caller site. Reviewed-by: Maxime Ripard Signed-off-by: Dmitry Baryshkov Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 31 +++++++++++-------= ---- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/g= pu/drm/tests/drm_hdmi_state_helper_test.c index 60b1e37522837ee183c65413e3ba6c6ec4fed341..19384b5ff28100b96add35cee86= d40cd7d555f1f 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -105,9 +105,8 @@ static int set_connector_edid(struct kunit *test, struc= t drm_connector *connecto mutex_lock(&drm->mode_config.mutex); ret =3D connector->funcs->fill_modes(connector, 4096, 4096); mutex_unlock(&drm->mode_config.mutex); - KUNIT_ASSERT_GT(test, ret, 0); =20 - return 0; + return ret; } =20 static const struct drm_connector_hdmi_funcs dummy_connector_hdmi_funcs = =3D { @@ -223,7 +222,7 @@ drm_kunit_helper_connector_hdmi_init(struct kunit *test, ret =3D 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); + KUNIT_ASSERT_GT(test, ret, 0); =20 return priv; } @@ -728,7 +727,7 @@ static void drm_test_check_output_bpc_crtc_mode_changed= (struct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); @@ -802,7 +801,7 @@ static void drm_test_check_output_bpc_crtc_mode_not_cha= nged(struct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); @@ -873,7 +872,7 @@ static void drm_test_check_output_bpc_dvi(struct kunit = *test) ret =3D set_connector_edid(test, conn, test_edid_dvi_1080p, ARRAY_SIZE(test_edid_dvi_1080p)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_FALSE(test, info->is_hdmi); @@ -920,7 +919,7 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(stru= ct kunit *test) ret =3D 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); + KUNIT_ASSERT_GT(test, ret, 0); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); @@ -967,7 +966,7 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(str= uct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); @@ -1014,7 +1013,7 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(s= truct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 ctx =3D drm_kunit_helper_acquire_ctx_alloc(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); @@ -1121,7 +1120,7 @@ static void drm_test_check_max_tmds_rate_bpc_fallback= (struct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1190,7 +1189,7 @@ static void drm_test_check_max_tmds_rate_format_fallb= ack(struct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1254,7 +1253,7 @@ static void drm_test_check_output_bpc_format_vic_1(st= ruct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1314,7 +1313,7 @@ static void drm_test_check_output_bpc_format_driver_r= gb_only(struct kunit *test) ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1381,7 +1380,7 @@ static void drm_test_check_output_bpc_format_display_= rgb_only(struct kunit *test ret =3D 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); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1447,7 +1446,7 @@ static void drm_test_check_output_bpc_format_driver_8= bpc_only(struct kunit *test ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1507,7 +1506,7 @@ static void drm_test_check_output_bpc_format_display_= 8bpc_only(struct kunit *tes ret =3D set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_max_340mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_340mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); =20 info =3D &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); --=20 2.39.5 From nobody Thu Dec 26 14:51:26 2024 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 AE9D9139579 for ; Sat, 30 Nov 2024 01:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931570; cv=none; b=LuonU1Dfdhq7TSXlYR7NuvLKeNNXUb3xhUUJ3FypxCZ1ABErPaXspJaRM7cznWIsIZmOgWRGRf0E09sq4v4k+ya9iYLAqbV/t7E9GdCbEpYkb9JTEKsD2Nj2Jv2l/OuJT2KQgERiqI2i7jvpc6i2H8rfcBD2zsmNqBvWwjYlblc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931570; c=relaxed/simple; bh=24h86ZY7bzN0OoxVx8Xf6k2a8m9A8BoQoimDyco+2fg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rhmagyOEmybFCioR45hMU2nz1VUmvTQ87o88xars3p6wr0cS9Yf88JeYJBdrmPI9CaXUykfDn07xDs1w4cPODkzAkerQ7RRG2OveHsgqNNoM2dRbPsjv5/scTWkb+K3kBkuyupPqoV/wAiY+/GkVGxR8VhyaHk5DJpm0LqAjVmA= 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=HSiWu/B/; arc=none smtp.client-ip=209.85.167.41 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="HSiWu/B/" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53df119675dso2969571e87.0 for ; Fri, 29 Nov 2024 17:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931566; x=1733536366; 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=9ZLmc4ldEZMEINodQt+XcOaL2uCpfas5CxnR9KYEiKA=; b=HSiWu/B/ZDrNf42iZR9KCNFwKEQ6jS2bC/qXWOOhnuEk8TrPqz2bNCFlalI2r+JIuf 3O7o4BFUoyOeaEJ3F3ucm9m/4ihPWL3B7M6Z93wd2euAJqBxpO4lba3zvMd8hWY0azuY jQdi9OMejTDTXY4sc9/SnwsYQPCMBn3h7P5rJNBdLNECmReWvBgcnkjSoS6xbxxVoijw oUIv0XIv3oKztV/VF+hBNyrh6hqcFf1Gq7xrgsTYdiy9juSYYxvBrururTrA9Bzny0oD 38s1vs7/gbD93IDixWFd3J2fqJHGmbVgClsVyfao9kbtwN6T/GYhv+UjjLxZSvdZ+Me1 L2zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931566; x=1733536366; 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=9ZLmc4ldEZMEINodQt+XcOaL2uCpfas5CxnR9KYEiKA=; b=vMVjS313LXzVCc8roaI3Fx66E+XFWz9Z6+cAeoBEBZ1qzrPmRMrGuaip7xpWiSG2r8 teC9OOc24PQpiR4BBPQ4P4799QKvCtGw/Vt/p/QdJiHBERAuTn96uLgFYvMV3C2XO+jW bPiz4VVeWFCSnmfOExpbivnusvdeFMeLxH+YyFuOPX0sJpRiZdtixurCrv0ebcOX3lAT nbzDpuCHKsUElUpUsx8id3iK5CyF87d7jGUganAHlevCzVP7FhRQW8jpUO+zdPOX4Iyv 2plkkpOospQkimnnA22QF68nxyTj8Xpq1EOcJs428ZxXaFs2LLthguthWWklw3+pWVNU Gy2g== X-Forwarded-Encrypted: i=1; AJvYcCVMCZEqVOAgvpIzGu6W/rm/5M89V90ypLLMkfW3O4wId2z/47hgAc7Im0jeGmyqy7DGZRFMNEgeb6MTuJ8=@vger.kernel.org X-Gm-Message-State: AOJu0YxGVLZYucOJRL8PdUuLfkrSV+Boe8lNzqvZ9HRfy2uhhRRydt2o jfSnH7U1sFUR2rQLuDh83Hm9x2VjDjt0yVwdog6CnC8NCpKz72li4MLiamUrFx4= X-Gm-Gg: ASbGncuTFogEu/vHQsdghs+Jq2NgV7RI8mFtqjhvletYq3MGMYcvJcMGfmjw0YFc8EG g1AnZtCGpHBJaZVZElo3eSyyuHcIbMroRViUFM7eFD+DT2qI62ULpwL7kMVPAFtKf3KFkcFIRhq 9jh+1p3gGoWq2rhtst6KG0Cyg9Pq+RlTPRGUfdnpceZvlfqkTxPhZAGDWafQ0DrqZal4UGkpGf6 tZpmw8bm7zBUb7BPJ/cTUU8ISsm+/IEafTaQYVfKiM/HH1GAkAV2YJ44g== X-Google-Smtp-Source: AGHT+IEOFuLEJ9vpWWhQ+kw0FCr8rUhq7mRbiidKxbfiaszDg5XlFH7v6/saHBl9DYWJ56XUYR182Q== X-Received: by 2002:a05:6512:b98:b0:53d:ede3:3d5 with SMTP id 2adb3069b0e04-53df00d11c8mr8780934e87.22.1732931565710; Fri, 29 Nov 2024 17:52:45 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:44 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:29 +0200 Subject: [PATCH v5 04/10] 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: <20241130-hdmi-mode-valid-v5-4-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=15861; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=24h86ZY7bzN0OoxVx8Xf6k2a8m9A8BoQoimDyco+2fg=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/gMPsPrRLVtrQPZDm3RuddWefA9AYsqGQPB VsrZe+UgpCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4AAKCRCLPIo+Aiko 1fXZCACWw6YLkq/HrwCOD+APAUdA7sjH8ciYl7lU0ff38EV1zvKJGQfBgwxh9UvPp/OZSW0DGKl BAUFNfL6+U7j5wN1nzMf6u7WNYscxwurxCQkokROsLpk3OMgnn+fAYC9DDCm3S9/09TNf/uNpkh 1RkGaMx9aNr0xo4qVpfvM6VVQT9c9lEG7sN5QR0+snOfdxQbqkiaAN45FsVrGIPnf/N0rAsw3a/ 3k1vi6YebJNFcQaDQ6Bzx7Cout66YmuJoXTj9l6gjc+Oji5VrfChOG6dQ2AMCn7ZuKyvsQdOSle ODQ+g46EXah9stTet+5g4mVbe9LShjE0uN1hDeZA/gUFgxvV 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: AngeloGioacchino Del Regno Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 21 +++ drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 180 +++++++++++++++++= +++- drivers/gpu/drm/tests/drm_kunit_edid.h | 102 ++++++++++++ include/drm/display/drm_hdmi_state_helper.h | 4 + 4 files changed, 302 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/= drm/display/drm_hdmi_state_helper.c index feb7a3a759811aed70c679be8704072093e2a79b..80bf2829ba89b5f84fed4fa9eb1= d6302e10a4f9e 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -521,6 +521,27 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_= connector *connector, } EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check); =20 +/** + * 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(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + unsigned long long clock; + + clock =3D drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); + if (!clock) + return MODE_ERROR; + + return hdmi_clock_valid(connector, mode, clock); +} +EXPORT_SYMBOL(drm_hdmi_connector_mode_valid); + static int clear_device_infoframe(struct drm_connector *connector, enum hdmi_infoframe_type type) { diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/g= pu/drm/tests/drm_hdmi_state_helper_test.c index 19384b5ff28100b96add35cee86d40cd7d555f1f..c3b693bb966f1f8b04066d19f52= 0bfa4bf11c23d 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -124,6 +124,18 @@ static const struct drm_connector_hdmi_funcs reject_co= nnector_hdmi_funcs =3D { .tmds_char_rate_valid =3D reject_connector_tmds_char_rate_valid, }; =20 +static enum drm_mode_status +reject_100MHz_connector_tmds_char_rate_valid(const struct drm_connector *c= onnector, + 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 =3D { + .tmds_char_rate_valid =3D 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 =3D @@ -146,6 +158,7 @@ static int dummy_connector_get_modes(struct drm_connect= or *connector) static const struct drm_connector_helper_funcs dummy_connector_helper_func= s =3D { .atomic_check =3D drm_atomic_helper_connector_hdmi_check, .get_modes =3D dummy_connector_get_modes, + .mode_valid =3D drm_hdmi_connector_mode_valid, }; =20 static void dummy_hdmi_connector_reset(struct drm_connector *connector) @@ -163,9 +176,10 @@ static const struct drm_connector_funcs dummy_connecto= r_funcs =3D { =20 static struct drm_atomic_helper_connector_hdmi_priv * -drm_kunit_helper_connector_hdmi_init(struct kunit *test, - unsigned int formats, - unsigned int max_bpc) +drm_kunit_helper_connector_hdmi_init_funcs(struct kunit *test, + unsigned int formats, + unsigned int max_bpc, + const struct drm_connector_hdmi_funcs *hdmi_funcs) { struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector *conn; @@ -207,7 +221,7 @@ drm_kunit_helper_connector_hdmi_init(struct kunit *test, ret =3D drmm_connector_hdmi_init(drm, conn, "Vendor", "Product", &dummy_connector_funcs, - &dummy_connector_hdmi_funcs, + hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, NULL, formats, @@ -219,7 +233,24 @@ drm_kunit_helper_connector_hdmi_init(struct kunit *tes= t, =20 drm_mode_config_reset(drm); =20 - ret =3D set_connector_edid(test, conn, + return priv; +} + +static +struct drm_atomic_helper_connector_hdmi_priv * +drm_kunit_helper_connector_hdmi_init(struct kunit *test, + unsigned int formats, + unsigned int max_bpc) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + int ret; + + priv =3D drm_kunit_helper_connector_hdmi_init_funcs(test, + formats, max_bpc, + &dummy_connector_hdmi_funcs); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); + + ret =3D set_connector_edid(test, &priv->connector, test_edid_hdmi_1080p_rgb_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); KUNIT_ASSERT_GT(test, ret, 0); @@ -1733,9 +1764,148 @@ static struct kunit_suite drm_atomic_helper_connect= or_hdmi_reset_test_suite =3D { .test_cases =3D drm_atomic_helper_connector_hdmi_reset_tests, }; =20 +/* + * Test that the default behaviour for drm_hdmi_connector_mode_valid() is = not + * to reject any modes. Pass a correct EDID and verify that preferred mode + * matches the expectations (1080p). + */ +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 =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn =3D &priv->connector; + preferred =3D 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); +} + +/* + * Test that the drm_hdmi_connector_mode_valid() will reject modes dependi= ng on + * the .tmds_char_rate_valid() behaviour. + * Pass a correct EDID and verify that high-rate modes are filtered. + */ +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 =3D drm_kunit_helper_connector_hdmi_init_funcs(test, + BIT(HDMI_COLORSPACE_RGB), + 8, + &reject_100_MHz_connector_hdmi_funcs); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn =3D &priv->connector; + + ret =3D set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + + /* + * Unlike the drm_test_check_mode_valid() here 1080p is rejected, but + * 480p is allowed. + */ + preferred =3D 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); +} + +/* + * Test that the drm_hdmi_connector_mode_valid() will not mark any modes as + * valid if .tmds_char_rate_valid() rejects all of them. Pass a correct ED= ID + * and verify that there is no preferred mode and no modes were set for the + * connector. + */ +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; + int ret; + + priv =3D drm_kunit_helper_connector_hdmi_init_funcs(test, + BIT(HDMI_COLORSPACE_RGB), + 8, + &reject_connector_hdmi_funcs); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn =3D &priv->connector; + + /* should reject all modes */ + ret =3D 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 =3D find_preferred_mode(conn); + KUNIT_ASSERT_NULL(test, preferred); +} + +/* + * Test that the drm_hdmi_connector_mode_valid() will reject modes that do= n't + * pass the info.max_tmds_clock filter. Pass crafted EDID and verify that + * high-rate modes are filtered. + */ +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 =3D drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn =3D &priv->connector; + + ret =3D set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_100mhz, + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_100mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + + KUNIT_ASSERT_EQ(test, conn->display_info.max_tmds_clock, 100 * 1000); + + preferred =3D 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= [] =3D { + 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 =3D { + .name =3D "drm_atomic_helper_connector_hdmi_mode_valid", + .test_cases =3D 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, ); =20 MODULE_AUTHOR("Maxime Ripard "); diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.h b/drivers/gpu/drm/tests= /drm_kunit_edid.h index 107559900e977119d451b00a647f0bd6ab598f63..6358397a5d7ab0bcdea1c824fc9= fd382560f4b0e 100644 --- a/drivers/gpu/drm/tests/drm_kunit_edid.h +++ b/drivers/gpu/drm/tests/drm_kunit_edid.h @@ -61,6 +61,108 @@ static const unsigned char test_edid_dvi_1080p[] =3D { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab }; =20 +/* + * edid-decode (hex): + * + * 00 ff ff ff ff ff ff 00 31 d8 2a 00 00 00 00 00 + * 00 21 01 03 81 a0 5a 78 02 00 00 00 00 00 00 00 + * 00 00 00 20 00 00 01 01 01 01 01 01 01 01 01 01 + * 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c + * 45 00 40 84 63 00 00 1e 00 00 00 fc 00 54 65 73 + * 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 32 + * 46 1e 46 0f 00 0a 20 20 20 20 20 20 00 00 00 10 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 92 + * + * 02 03 1b 81 e3 05 00 20 41 10 e2 00 4a 6d 03 0c + * 00 12 34 00 14 20 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e4 + * + * ---------------- + * + * Block 0, Base EDID: + * EDID Structure Version & Revision: 1.3 + * Vendor & Product Identification: + * Manufacturer: LNX + * Model: 42 + * Made in: 2023 + * Basic Display Parameters & Features: + * Digital display + * DFP 1.x compatible TMDS + * Maximum image size: 160 cm x 90 cm + * Gamma: 2.20 + * Monochrome or grayscale display + * First detailed timing is the preferred timing + * Color Characteristics: + * Red : 0.0000, 0.0000 + * Green: 0.0000, 0.0000 + * Blue : 0.0000, 0.0000 + * White: 0.0000, 0.0000 + * Established Timings I & II: + * DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175= 000 MHz + * Standard Timings: none + * Detailed Timing Descriptors: + * DTD 1: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000= MHz (1600 mm x 900 mm) + * Hfront 88 Hsync 44 Hback 148 Hpol P + * Vfront 4 Vsync 5 Vback 36 Vpol P + * Display Product Name: 'Test EDID' + * Display Range Limits: + * Monitor ranges (GTF): 50-70 Hz V, 30-70 kHz H, max dotclock 150 M= Hz + * Dummy Descriptor: + * Extension blocks: 1 + * Checksum: 0x92 + * + * ---------------- + * + * Block 1, CTA-861 Extension Block: + * Revision: 3 + * Underscans IT Video Formats by default + * Native detailed modes: 1 + * Colorimetry Data Block: + * sRGB + * Video Data Block: + * VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.5000= 00 MHz + * Video Capability Data Block: + * YCbCr quantization: No Data + * RGB quantization: Selectable (via AVI Q) + * PT scan behavior: No Data + * IT scan behavior: Always Underscanned + * CE scan behavior: Always Underscanned + * Vendor-Specific Data Block (HDMI), OUI 00-0C-03: + * Source physical address: 1.2.3.4 + * Maximum TMDS clock: 100 MHz + * Extended HDMI video details: + * Checksum: 0xe4 Unused space in Extension Block: 100 bytes + */ +static const unsigned char test_edid_hdmi_1080p_rgb_max_100mhz[] =3D { + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x2a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x01, 0x03, 0x81, 0xa0, 0x5a, 0x78, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38, + 0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44, + 0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x32, + 0x46, 0x00, 0x00, 0xc4, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x02, 0x03, 0x1b, 0x81, + 0xe3, 0x05, 0x00, 0x20, 0x41, 0x10, 0xe2, 0x00, 0x4a, 0x6d, 0x03, 0x0c, + 0x00, 0x12, 0x34, 0x00, 0x14, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe4 +}; + /* * edid-decode (hex): * diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/disp= lay/drm_hdmi_state_helper.h index 2d45fcfa461985065a5e5ad67eddc0b1c556d526..d6d65da6d8f9ee46de33114cce2= d6fbe6098a862 100644 --- a/include/drm/display/drm_hdmi_state_helper.h +++ b/include/drm/display/drm_hdmi_state_helper.h @@ -20,4 +20,8 @@ int drm_atomic_helper_connector_hdmi_clear_audio_infofram= e(struct drm_connector int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connecto= r *connector, struct drm_atomic_state *state); =20 +enum drm_mode_status +drm_hdmi_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode); + #endif // DRM_HDMI_STATE_HELPER_H_ --=20 2.39.5 From nobody Thu Dec 26 14:51:26 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 E9F8A70817 for ; Sat, 30 Nov 2024 01:52:49 +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=1732931571; cv=none; b=UatI3rH3mnRQfBjrMu56wihLKfMxBERlIY7HLZp/hpp8MGaI8vZgbzUhVdPnfvgKDocZob1oyhIMlpIBLbg4WZKkeGnq3i0fpjWTdyDY9oYF/QNlFrTJmdlRZl+onhFRARcG3hgh3H61uDe1x/TV0DkHJTUIvx6pwVeVwum+jdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931571; c=relaxed/simple; bh=7WdeDK9PVMnPHS0xN6wrfKPJv4ESCzGwmvZnGPcMZ/4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WUUhla+9Mkang9fBKi+v08bLdBTM9yyREf7tIdWgIkSGCfS6kGbTszCUw+FIYQJkDVVC7jyceW3AX4BBEhEZxx29X9yyvpJhhMLJkWhkwW0zY5X25d8CdzbSMWTuVMJIx6gPe2lsReDecOHW0WZL9dnphSEi2/5eNLBqBrmjUo0= 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=dV7xEaK/; 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="dV7xEaK/" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-53df1e0641fso2829828e87.1 for ; Fri, 29 Nov 2024 17:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931568; x=1733536368; 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=YdWiUnW6vTgN40+31xk3R74ZtFvE1HPhsssihDLePE8=; b=dV7xEaK//HSPS4Dzj6rC6BAPOC2IF4PAyFQzpu0Eypc4Nk9L9gnHUF+QJPWzYcnBGc iFEqC/fjPw+Fbf8lZZGAWcBmarAQZLrjkqXciS16chIRQtM8ew+wIxu7D4IL812nogvy A21IPg+DL95h9/yTIUuBYOeBmOqyS5jNkPJkRyfeZVD39MF6mn7AgwVTsYiwLs1QPBGJ DFkfzOktJukwLX91jglaJH4G9RaG1S9dTByFLVCPO2kUdUOCiuSfd02Bcpk7t9qFGXb+ lWdMhEcUP+bRr4GroGdYdr1oQibCSfoqOQRd8qNYkka70BSg3y74qLgvzmyy9yXdZs1v BGJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931568; x=1733536368; 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=BNh0o3f/bWXq4PEMm3cSHQG4WdejbsOzGWu0TQ/JAElKOKJif+fakoscCC6HpIE8+T N05gFsX4+qqFnRR4jNz1bLhfgyEYhOS8Pl2bzvCPf3rH10LLBJFApIXqLJHReUqea7NL 78rCltN77ffmO/pms/pqPJcvpsgKjqw64btwyv0jnOspGMSTFFKrRIkZBujBdiUER+Ge OUpySg4aeQIU0BluaDb8LBsayXp7BZUSGIOU4h5TxpyUh18fB7g6rtbZAc0aLU6oM3v1 vXmBIW4yGmdogWU150sbQly+/WxwwuN8g834OXlcodUG8ing0gw6bFtrhKetowV3tjAR e2tQ== X-Forwarded-Encrypted: i=1; AJvYcCUO0V/dIa+31if5mjZc9ha/pI4XyPmRyEqpCxT53toiBM0fGqzZ6KElJ2O0sGxKzoDl0wjhVjwucLD+v9I=@vger.kernel.org X-Gm-Message-State: AOJu0YyInIubacC8PJ67jWvYc1utK+wYjlrrZkbfjATAG06A1O1Rnmds Nu4hWNDxXg4ZtSROoNl6CyLifMbBmdGB9/S+Df8+vs9FEdS3sM4vS00k1N7aIZU= X-Gm-Gg: ASbGnctLVew5f6Uukae8nXPkzs74Pf22S0QwFomsxP6AxOvjfizG+pZIZnhc02jfA7o Doql33nO9XXGyxn63wHTL0Up6huZDB3pOlREdwVTDviqyP97byrEGmh0q79QIxBML3zfC1ccONJ KzRf9aWrD+qzoD0uF7ssxdOUmksCsro5CtjiS9qa+ReGAyPsl+irST9SWPBQGR48tJHIa/2EdHr SJWR+w9uariMDce4ex0ewuoQohxr2iVRmi+wmiCytwnvy69AEcpkSjqYw== X-Google-Smtp-Source: AGHT+IHetZrvEByn4fAHRWKEq7LSlZrnAwfYhcjJyaHf3aEdtAmIagniVhOW57dJZppA3z77RAF6Dg== X-Received: by 2002:a05:6512:1247:b0:53d:e5c0:b9b6 with SMTP id 2adb3069b0e04-53df0106d34mr8877433e87.44.1732931568173; Fri, 29 Nov 2024 17:52:48 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:46 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:30 +0200 Subject: [PATCH v5 05/10] 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: <20241130-hdmi-mode-valid-v5-5-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.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/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/gM3s8fwgp7qQxHuLKIwkRxeHDxfAODq0bs 8MwPp9YbZKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4AAKCRCLPIo+Aiko 1bIIB/4p8mwZtQM6b7rWJ6f/3RrJdOFSVD/lB0+qokriHsrz+a1eIjtwS5cFImZWoTfABbjChFG 9bL3aHhp153Z6qRmB0jjz74wbZ0tim+a8QACdm70DR0qaxs4/HmpfPx399A0ZxyT24MreEgH6GT SIq6n5AETnEoWTkEcfkowDDKtLWggZQ1t8C9j1FkKDqPZx7h+bRIoX+PGcwIDcVLd5cC4hNGvGo am6B8uZXEeOE6xZdG45hkGyPog/MQ3pw19KTMqs9BjjoRcYkufrdv1X+Zy1tA6GGE1tfQ+iEDoF COYRba5H+tZGXE0G2E/PFi//GWn2JG40uSHj31ythluMJMYH 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. 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..54b72fe220afacc208b3fd48d51= 60031127ea14a 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 Thu Dec 26 14:51:26 2024 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 80587145B18 for ; Sat, 30 Nov 2024 01:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931574; cv=none; b=q9lC+7bZoCpcFO6xbMzIwwoKgzqRdjohOFxaAx+564awAyM05cyEO1st59pevVEGFvYxHUuzTRshjdNXHuST4jAuk94D/FGYHGEPxNk+NhkpKEAswdnRawdRh1rlIUqt5U+yWvs4qV5G3F2t1dEHnotuLYIJdVyQz3NL7nHFdLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931574; c=relaxed/simple; bh=At9SvTe5LA0QiGChV0O2Dfze46Fe9tZ8M4odvfGUE7I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OG1HXi+pshvopEbENKbsbGt1mm1qcGbbt5OdYItDe2VVhIrvVDFLU8NtU1oht83bclHN1GCdRFlEorIOL7oFpvKWAWBu8sRNjPOfVVAKphaiTerzSFpNtaTr/Df5KisOdu7OS3ftWZLCFyJ+OyNuTtgQvAyl7Q7Nk27P9Dv4xh4= 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=LhQRCZsp; arc=none smtp.client-ip=209.85.208.172 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="LhQRCZsp" Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2ffc3f2b3a9so35764201fa.1 for ; Fri, 29 Nov 2024 17:52:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931571; x=1733536371; 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=rqzd45OJ/2bjI5cuXyLBaiv2D5kR3sXVh9d8XfqZ3RA=; b=LhQRCZspxf4nuaPEoUXy57qRIZJFWy/KYyOM/oGnfvt7DkOQCQnHquSz2N3oOXYyAa RMIA34YS/fT/hcPuNdIUG6V7o3HpJ9vGsJ/yypeHJZLSR3xWBuZ8B1UZHWJiWMJGcU9w 7jb5K5U58AqivPkNrc64ZbOyg60g9qt/8yRvmTgMtqb6TC/eNmcKC57/W/QMMU8KRlUO XcIomouS9iKqFh2xrpe9PUVFVXnAL1C5SweMWfXCeECkOb7zz4gnOBVW6mkrPci/jkRx w656FW3TzYy3IxDJ4f91risEOqQQQPRl+QWHSCEm3sJ6/VTQIW4HdDQsDwNJmUxJikT2 M8GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931571; x=1733536371; 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=rqzd45OJ/2bjI5cuXyLBaiv2D5kR3sXVh9d8XfqZ3RA=; b=OM0u0aQhgo5yCt9Ix1L0zka8V8rrUbbH80h/N2HIxapRUZUXV9/d7ub5tyN5cy03YP YyelR/j1fZ2et+q/seKkwYnwcanT9fwzcNvw/dL0qMYc2ehMdVoazltxqJ8WIWHy8v0g aJbNjun2OQewARJXGSaIMp7ZMzFKTRf6QcKx1z2Wp52LvrZs/ODUJQZhktap5Vb82jWv /lOwF6TLXXdke/Pfa3875rjuekRi1m77cwLWj2Z139OtIHwG256BdRq9NrU0nKqZ3zuG AGNDsuPYAUjpT4U4gw97P6u3IEPZZmKBRc4RDKZ17FA/oyayj4OIU7zB7rD5sP7sszK7 TUwg== X-Forwarded-Encrypted: i=1; AJvYcCUqoMPzoFMmKW3c2TLCp3qDrR/9ZW0+6QyapQ78GJlkVCQAfDnO8+uzObMjBHTE3mvABNhQU/32DB9sJks=@vger.kernel.org X-Gm-Message-State: AOJu0YwYJu2J3axl4H3A/596PDo6I0/5wAGVdapBj5jGUXeYSpFGdJZ+ VJup9Kxz+v6I7mX9UqjWMjwI70qs9JPPuYh+Aqr4SgNJLtYTZADrkhULzfvUahA= X-Gm-Gg: ASbGncsudf492mUgNNiHrgwgfxgZDp+5elHDwIyKOPmBSdNQFaJ2e/2t/kDPKk6GAOT vb6GoNUjP9kWc2MWfcMvymkJ+SqJrvMzbL8PEiwp/jnmAUyxBvG6DThGDEW2WQEDdCdgkgf6sfL obRC0Au+MfU21iES31TLh9ONBqxWTsPuiYP8OHtT6sakhE4GMngXdM0Jm/b1h5MVxiNS5NyYn8M 12Yyh0mLMI91Fe/GHruSQorw/hbl5SYoWq5/qanZfL9KetuIKa24ioIEA== X-Google-Smtp-Source: AGHT+IEm8Yb0TxS+eVr/75rrNhY8EmahWTK3d4I/qjVsct4VbSz/US+qIlExC4PPMtJ+C61FxhlMpw== X-Received: by 2002:a05:6512:124f:b0:53d:ede3:3e0 with SMTP id 2adb3069b0e04-53df00a924emr13257471e87.11.1732931570640; Fri, 29 Nov 2024 17:52:50 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:49 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:31 +0200 Subject: [PATCH v5 06/10] 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: <20241130-hdmi-mode-valid-v5-6-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1740; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=At9SvTe5LA0QiGChV0O2Dfze46Fe9tZ8M4odvfGUE7I=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/gUrzKupzPQSPNAvUfGl7XQ6IFP4Mjuc6k9 OiwxKE8NgSJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4AAKCRCLPIo+Aiko 1UbOCACfmiglysJU/tIyjGlA11c+mgJ7cYK2eOEWh0ZSy72NW65KgY5a8FbZ9EVCQERqWc7dP90 abFOIQdTPse1qE2HvCyMqVIHoKKywUEf4E5vhK1BOu4ArILzt6nstUi+E03GQUFjvM2cTgf7lZC edUwdUGA5Lm0pJq04VtA/+pg5wi6+qb33fd00ohAnTYmpBWYYRLGm6ytcdhJuewk6P3AOo7hT27 VbGBcMiGZNp3E3P4Tvk6KoR0Nm7SOKWMpn6omYVsIhV19KKTtk2UPYZWDe45jm5te3OB0TScfc7 HaKxP4L24nxyZtXeCB/cUIMb9RVM/dcHbcZ6lkb25qQPXzn4 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. Reviewed-by: Chen-Yu Tsai Acked-by: Dave Stevenson Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index b9fc4d981cf4d682bedd978795cf7284d2650e74..297afd89036ba8fba571379f5b6= d63227eadb66e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -580,6 +580,7 @@ static const struct drm_connector_helper_funcs vc4_hdmi= _connector_helper_funcs =3D .detect_ctx =3D vc4_hdmi_connector_detect_ctx, .get_modes =3D vc4_hdmi_connector_get_modes, .atomic_check =3D vc4_hdmi_connector_atomic_check, + .mode_valid =3D drm_hdmi_connector_mode_valid, }; =20 static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs; @@ -1765,7 +1766,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) && @@ -1773,8 +1773,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 MODE_OK; } =20 static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs= =3D { --=20 2.39.5 From nobody Thu Dec 26 14:51:26 2024 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 D777B148855 for ; Sat, 30 Nov 2024 01:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931576; cv=none; b=di2OiigLW3w0U8rtpBdBn1WVYtHujNlrNhdKXYDe9NJrOj76+WPXFuV3Mlu2W0ISwB3vORZeY7qAXRf3sLD6Dovgqn/DZuznJGG6/GNglSYqjP3y5QIJNC2IFhMH58vnh28mJfqQ/yzPrcZ3ct4BU18uPere2UjnCKsfxYNmE3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931576; c=relaxed/simple; bh=V6uHu+T4+xW+xwMuVx/apScXj6PwN9KdCvTiBY/zzqA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OAO3n3pFdg5rxTxwzQRi7E2ZUEt+MuT73KDuxKtFBhrs2UMuLfmORRMsiJDhY2jiVVLSZqyTXF+9xTqecd2H8BtNNhTGYhWDyH/z3gIc87NMNIb0GO9uFkzAos9IV1eME9YYdpPup9T7gluj/yklMY+h8fJwlgBg3bv8vZoAPxg= 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=x4XYcGQq; arc=none smtp.client-ip=209.85.167.41 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="x4XYcGQq" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53df1d1b726so2909614e87.0 for ; Fri, 29 Nov 2024 17:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931573; x=1733536373; 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=bi+JDxO7zFRVUVNShSHXAVY8nfszGwV4/oGBGiyAqww=; b=x4XYcGQq6Qa3gP8pkDUxhmdP9HCVNiMDc9zguuvlu5JWh0reL8KsGJ0tzPFYTKxflF uwkyEGpoc9hffFYC6u3oE/NeD7RqYZNRU8D3fFe9a9Mauc4zeRzt0dE+vy0BsIi9cKD2 fIsCLpFRUhOO2qoeYdWobcRM4ZHQc9XkaTcYzze8Yrr+8kJ4IrEtvNdpHU+sfkI+YmM6 D6UQixwCWsHYyEZVI4wRcs+TyTYIYYBw/sew5uSDxc3ZyRsWlpHzJnBMq9E0HH7Yr4u3 3ZuchVCRHZvUGIafNUgDL/goInKqBN8e7+jBg0sb5gMoaWmkx9w56CnE21xl6FrlcDMd cHAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931573; x=1733536373; 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=bi+JDxO7zFRVUVNShSHXAVY8nfszGwV4/oGBGiyAqww=; b=YXrdsXcQvJqp89erSfXTwb0uDmUOgdoAb/qW8pMQ+2gM92xGndzU+e0WgNeP5sEHu9 /9TJblFQt84Gn83fTJhru2fEerw7iz5q8ZnG1VcZflMNSnyr0TqAkrwJL4Cu2WoSYg4A rUHqLx7aoZufKya5sj5XKfIolp+r7omKamhEamvebSrF/lQ2RdNb/aHR11W1k65cY5PM JxGn1xVmlVMM6jSkpvlqtQ02unsQCz+pdeePMXKtIDcLufMR9p/JQfdj+IyCy6yCWNyo NTWydw2SboXD/SmLdVR9gICOMRo9InVFTseg4sD94HWHSv3yQwn+bYZ76z8Vm3KUuqjh RZaQ== X-Forwarded-Encrypted: i=1; AJvYcCVK0Zx4Q2tvFumps1RsnPePgX6GM7fKNtY5KdQ9hE+TjKwxD+63Ae07dh83yv0rr9QCmRxzwZ9KxorJGZs=@vger.kernel.org X-Gm-Message-State: AOJu0Yyfy8ZnNi72YJ3fbA9ryRR8mcxZIZYnsrG40klVCS9zjAYiY/jH P6S/1zBI4kxXznSyWRswiSGBMONfzBDMGZLY2ZjJhYc9YI+18DpOnWAllpWa/zw= X-Gm-Gg: ASbGncsyPuNyMjHwWXqLkrhJv1zgMQGemxCIOfyb+gt0WtO7Wvmpws+Ga6tzMqAzkK5 P76SHYITbVz/egsEZwePr/saliwIfYZrh8jz6DV989gJEBv1Kst20K27dVv3EaLyou4hlbaa2nN fcsic17MX8AUYG3GMyYTqM8qaHe6FwiIhf5qKELj/t3KlvchAB/rhQ3MPe1ADCPhNbbkPLz4WFr JKwIhxvtzjuDAQRSp2WUp0bcRWzz83x43JMTIoLv7g1I34b4pZiRvaTnQ== X-Google-Smtp-Source: AGHT+IHEYj74nFURYbWP3Egy7gi3UHFs7eYCLy23sHhESjuboylGOmyFITklL7Me2c+2Ybp446w/LA== X-Received: by 2002:a05:6512:2309:b0:539:8a9a:4e63 with SMTP id 2adb3069b0e04-53df01046eamr8488039e87.42.1732931573080; Fri, 29 Nov 2024 17:52:53 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:51 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:32 +0200 Subject: [PATCH v5 07/10] 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: <20241130-hdmi-mode-valid-v5-7-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1872; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=V6uHu+T4+xW+xwMuVx/apScXj6PwN9KdCvTiBY/zzqA=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7pX/oMCB23f3Dl28T72F5rnzAu3MnESPs7t7BUhWRXw9 1Lk0aJORmMWBkYuBlkxRRafgpapMZuSwz7smFoPM4iVCWQKAxenAExEYR77/zqjCu2Eb83GP2fZ /I0qDXeMSL5+ZYbQYbd19606OYpCjUwuXJVSWeoa81rz0QYu07WsVn16WVMTGYueu147XR13uNh T6nVdSniXWePDn3mXvlrKHK50mhW0c3t02pUchYWCVXP7qrKitdadmLXiWI+o8cfyYlXF02Eyly 7cTX1bkJGqtlrte/5e5WlWG9zv7gkRnvf55p2Lfx++Pbnlt5WNd9oMfjsnb9ajO+81VjS/XP3dY SrHTqfmxbM9vTmF2xI8hFOWLHGOvlCeUKheLD/vQJrwwT1xHc6L65eUXfbzuar8Yva7pbNVep+6 KVt/9+9yTnXT9hR+d2mlSIHMxvcmVV+3q8leDvuV/cYaAA== 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. Reviewed-by: Chen-Yu Tsai Reviewed-by: Maxime Ripard 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/d= rm/display/drm_bridge_connector.c index 320c297008aaa8b6ef5b1f4c71928849b202e8ac..512ced87ea18c74e182a558a686= ddd83de891814 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 Thu Dec 26 14:51:26 2024 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 55BD873446 for ; Sat, 30 Nov 2024 01:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931579; cv=none; b=Boqhuwg+9X7Onil12wzHN+wGcNnkHHIuVsRdhOf20JQ6mFJTKck7mKw2XWAWTbszg6hzEAgcPmqxsOPfbcV0Si2iqjE27OeQEMr8ioaurBXt92vxfsBNeYkRZtOPiFo7WbEGFIemv1Tkntv/1+aVofdNQPU+IPOoI+g9JgwRrmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931579; c=relaxed/simple; bh=CHPPIcbOk/4oF+oFDkgVgA19LBW1SDNLoLgjIjG3wi4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Pin3QUbKAPSbe5/UGLPcmwHkMWxS03z7Ra21AV6gLexJjY9SWHXsP7UjSAmoGiYljMmNu3dEKW/Tcp3nVppTPn7PzMS9hWX2/St9ynXMDvL++ZGjFTRHGigeMTCkil0sZgOiyadVHw4coRdd6tO2UILGnrxr1gevDtxgGi64d6g= 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=uGtzDa3g; arc=none smtp.client-ip=209.85.167.49 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="uGtzDa3g" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-53de035ea13so2446677e87.0 for ; Fri, 29 Nov 2024 17:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931575; x=1733536375; 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=+hHECBYEofE1LVFfISufmiOFENr43Xg+pptUAkUKUyA=; b=uGtzDa3gQUI5/7JmPAAIGhqW47ZSnUsNq92UfJNm4+gOm7M08+CcqertiQZqX0lVCU rh7NDQnEnqINmNODudekZtvaFOg2h9STZNvgptE+3ltGEI4t/A3lDhDbB96NtEwypeuV mqmjpWgazWMalEng5y8E7m8xHoc2cYUEoOPArpgO55WRZR4ORTdUkfD/T0aoDVDfpHxD PAZmO1Ko+XLTUvke/g31GSVuIX5ZrSh2VvKX0zRcZege4G9HCMFTCJuZ0ebp9QAHUwam px4Y6qyQ4iJgpxlOZ2TcVQyVTgtUmDBBPZECJ+td7p+ey8a6sCibXKMRxDh379lBy70z 2oCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931575; x=1733536375; 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=+hHECBYEofE1LVFfISufmiOFENr43Xg+pptUAkUKUyA=; b=IJbdy4M5cFwn15D13o/HbE0GJTaroNu+lJDo10KomM2S6u16qRsuPHo93qWMyksXtb dDTPN08YCnEXoBbR3sNTLIQvfqunhlFcpYbVU08RxuU7HPQGgQdKODQNDdWbA2Ll3sLZ bbC6o71nj4xz5xSoRwcFMpurQ8OreL0pauunRHjsC5F6l1+M6x/02Jzdy8TStHgQuml2 sEPGiZiUTuiBGs3++CusY8svtpeQlmzs9KFGD4mNHDXCmpFaflxqNxTcRPs0CL6/Rf8A sUjiawq/ApdhtB8NwQzaW6SCOXVwbm9y+OEmmqWvH21TsBhaHag7O/uFmRV7Dc2mVpxI M7ng== X-Forwarded-Encrypted: i=1; AJvYcCVsI1YpgtlbEjsmU6rO60dZcGeY65sm7rgC3Ik0vy2O1t9/5jmzH9jgouMRtJEylfLUnk20FbTDfCQE5M8=@vger.kernel.org X-Gm-Message-State: AOJu0YwmmPO3xsVblgPiDkix0Hf1YjIPR1melLJqHGxxRaAx9DbdYyuv 9p16/rSrkV2M64UBEW43NKYc1Cc2f2+Wy6JfpgqZaZ6h3HiIgc74Nhfh7S7qfbU= X-Gm-Gg: ASbGncuUwAJVJ6VzM+j5zta/Ssjt9QnCFCtP50jWocUmec8QOlDg2/xapnuCcAWRkeV 8KSeUgZUKGUOcIzfG/Ne5ME8yXlwzoenJHy5DMn5GpoARLBYkZDxAdz44t7+2djLRiBfUDdMtFy SuaXrBBQpqQAWzdebHrS2PsHinCMXLA3kZJgAyPfUlb+EaSaOJ/Xm7vHbYkwQT7dHYAauDx7tGC wcO516hafBKJVXAiGvKz7DAPUaVRBIClDao3cPM6p5V8j5TXyO4beZrbg== X-Google-Smtp-Source: AGHT+IGpbKPr0jDpuxGiDeE7FvrQMAmAyXEng/ZnD9YgSk62wmodTKnHm1As1pVrSEzDd0Rvi+mmbQ== X-Received: by 2002:a05:6512:3b25:b0:53d:ed08:5712 with SMTP id 2adb3069b0e04-53df00d3c8bmr8073919e87.23.1732931575393; Fri, 29 Nov 2024 17:52:55 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:54 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:33 +0200 Subject: [PATCH v5 08/10] 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: <20241130-hdmi-mode-valid-v5-8-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1393; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=CHPPIcbOk/4oF+oFDkgVgA19LBW1SDNLoLgjIjG3wi4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/gZYVRxsPvBuVk2hROVkIaUSrjCIe8xd0oY EGWuQDCOl2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4AAKCRCLPIo+Aiko 1TwnB/95gm5vag8iFN5M1sSaLORbtyefXMqgXK+UYyOyMGH3WsrGBMV3zrqFa3hOpYrpMOPCJ0p 2qpzknExme8zQHyG/cCZzlAZZ0eO6hM0CQ4/s+rxguRsevb95fQ5hLPrn9R2wyESwkIQNRYRb3a 2aXx6WQ49NUOzerBIcauDv7aYjXAkWdIRA7hLYiNDTUg5XaxsEmn/6wFvWpYIa8jK6QejHWd7y4 sTqgUxNX89KPdleAyprS2KSf4PwrAVlhpqMiALo1t+TdddoHZRFuKOltrZOe72vM5ukHKooMl5i xPpLai8cV0tXWnmKjXAfd+Ca/6CUJ/aMT3RViERTh2qn2xln 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. Reviewed-by: Chen-Yu Tsai Reviewed-by: Maxime Ripard 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/brid= ge/lontium-lt9611.c index 8f25b338a8d8f95dc0691735ac6343675098f7f7..1ffbe473e4103dfc315a8cd3571= e9407bf518797 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 Thu Dec 26 14:51:26 2024 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 97782154C04 for ; Sat, 30 Nov 2024 01:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931581; cv=none; b=oY6U1Fo6yXO6fAk+FHTYbtZCQh1u9ohS4cZMf21xoBWDpmAI76nUrRnjbchSy2+GdT6034VT5WKvqrx4Bpf6ikxlWVrubzHIaPRhc6HRfAdOLLRsJcDJ9iQKXrMWZTYgs0sQdyFUTQFOVDrwVxQWuEtDFSQDSF2+mzmg14pbCo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931581; c=relaxed/simple; bh=UjNMLqX51SwfyB+kbUbjnJt95fAbmRoKvLYOPQ8ek9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lX7eSRcKuHfejcMGKAVxxX3d/xV0uzOiJNxmHQB/NvEzLqnLyt0IsSdwB8hOTepsLdf2q3+O21YE+FiKT9TyAMcAFPDhonsHXW3SS/1lNbYZh1RwHjUHtFJCieVRy1+So6v1EC0Ml4i19AY4ZkrI5FEHPrfe/Ni+R9idGf+zvwQ= 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=wdTfdkmv; arc=none smtp.client-ip=209.85.167.41 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="wdTfdkmv" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53df1d1b726so2909647e87.0 for ; Fri, 29 Nov 2024 17:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931578; x=1733536378; 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=n9wxCYXwjuFpbEm8J6hnlc7LqgHEUz/bPD6SI90IVR0=; b=wdTfdkmvmw4L0GQNEFTySHzCI2OGyhSvxv2GXWp9DwRQI+L8T2lujnIYEG3OoqJ0/g 39xS1NjKNUnev0Ay9YqYQO5ILkksqVRB055bJ8dI7Z5rCcRBX8e5Xs5cw/TRgWNfuDpg GVjrqd+/8Vxs1mR2RMw+92WwKayfZNGV0i9VwogZehbACdsfNLvRvcrErD6mQWJzf23H 8K66HqFOQJYXiAydpCAI8KgEdahg0yM1jxmlfDx8DXh7BvV3K3QiPQtkVWV4Mzg8NjGR Kmltk0g4UlPbmoTh3SFuCOtYmabEgNF9mJ5Xxnr/w5+9cJRsU7kjWUGlDLMFEIC0PfUv 7VVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931578; x=1733536378; 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=n9wxCYXwjuFpbEm8J6hnlc7LqgHEUz/bPD6SI90IVR0=; b=C1NXtQn4vnIx9Sjg7J9aQBOW3oDJmGalur/rJsEZYpPgf3To1/wEiyWnmagvWIC957 04DOZLVW0+PrqMrZkQMm06oWNMdNFnDB8gsoj5xzVZ1ztuHLTTB3RAtgN14vZK8w4r2w iQdOhDDRqPML+2qhqSfq+2Yn71INNKektpCo1KAnx6ABHze4VOFg+uUpnP2aelpuEgZT HoQpntCF8ZkutssaahhFiQ5Sh3fzWRYLGcc8JikRZyHrM4QPytmnQxCSOGQqkMFHycXS dxqK5iVp8S2qmDsAcfdkfcRc5rfqg1mhvEeTqLEsFd7zAmcn7AkVbASwznlu2FafwZEO PmMg== X-Forwarded-Encrypted: i=1; AJvYcCXWmLXDns1h5rTGJXcLxDoOpKF8GEg/Pei2Gj+7LtlCY75fATK77SmT+YXuQGd5283Ewz2gjUaLcF6Qey0=@vger.kernel.org X-Gm-Message-State: AOJu0Yzxb092YEQrjeMA4oV1QzFB96mZcqq7W6TMyf5j0M3PvmnYRKNU wJWuxkLthdMHa2uPpheItQSSS7qxdehPxoS2i99Ddmi4So7CA9vuFzC0Qb5S4fa+aVQCGyNOeu2 w X-Gm-Gg: ASbGnctaI3zOwI0zdLX6PBI7fzEbGQ4k7XVlPemhsYiSRuj+9Zdto9R1OitR7lSQjnw vpcb/s1ApteIn9bu02UlaIokV3avN75YDlyRm+6NWLZhTnP4jlW69CURjVQaI6XfZCMpOZtj8cY BFE5dL4TSuIdfDNtNjIGmLTVgORd9ulo/rkC4fQ1MQ9GigG3rxDVeoU6eVFv+7CnSV9kDUz37Wr 4CfLgmG3y2Bt2sQ1aJVGFTQMbKerM3NKN9weamPqJMY3QG3FJTkwsRiLg== X-Google-Smtp-Source: AGHT+IEPMkwzovF1BGtYWQPhSNDkhj65yoNCvxf3xV+YxR9n/u9tv7nbpK4B1sxwKYxaX0pKkPUYkw== X-Received: by 2002:a05:6512:3c81:b0:53d:ea1d:50fc with SMTP id 2adb3069b0e04-53df0111f03mr8755501e87.48.1732931577781; Fri, 29 Nov 2024 17:52:57 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:56 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:34 +0200 Subject: [PATCH v5 09/10] 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: <20241130-hdmi-mode-valid-v5-9-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2092; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=UjNMLqX51SwfyB+kbUbjnJt95fAbmRoKvLYOPQ8ek9c=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/hP4NTjv4z5OlKc/siHNPmPX53A9tMpMizW QagCkkZEseJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4QAKCRCLPIo+Aiko 1YEYCACSjhD/Ij07xD1HSZ7Kb4z+Son1xvlSmJAJ4SpssXNb9iPUFIVI8goXplbGswSwyMT7gN/ TJA4uoW5pm1VZfjXG6tfbVQkLp1egYiDvrum1DeygQ92wEt56uRPyVIx4IdIfPtB4T4NeaaxRHz LQnkHZDgA5FLhdyenT4uGiwtnYN42jAeIQOKN9kR+a3UWYD+yYdlR7SqZ/7LE57ljVXynJbKs6g U1MS/hQbvYoXlzbGG88vk9XYuwEsCee0SN0HMVpBvPgf+iAWlBzry2fAO18n4a3PcxUb5yoO8pZ BJV4wpwjoTw7LieiIOIG62SIWjAAknBD03dVAhxa/2O9Jx3N 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. Reviewed-by: Chen-Yu Tsai Reviewed-by: Maxime Ripard 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..c686671e4850a1af75b82995185= ffc3cbb22a447 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 From nobody Thu Dec 26 14:51:26 2024 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 F0C00156225 for ; Sat, 30 Nov 2024 01:53:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931583; cv=none; b=rv2xVqqp6U8CNjHaCwhVUHyxij8pagm1ZmTN5vMwsAQzOKuujwuJ9aqbqLq7HtA/FY9Ds8ZbTmCK3El9ubgoU66cLrgP/eqnWAvV1kF57dTtOV5bI9ueRPm22WR49S46rInBjsIcmfjW1ApcGcE777g34NM1GWFyPloHmS4SZxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732931583; c=relaxed/simple; bh=tt33sNy4EHSANTDHQAExXai1314OqzFqkWnpPj2YPOw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QsVo8++E38NYNJAyjKkJ5ZoLMBCslyPrA+GFy8wCmv8lXXVvLxvAF6wJQBHz1/xAM3thypGVwZK7yXBbv3ItQA4x9FCJwBqAhcxJPZXRjS1pX+WwhmawlzGTSt4Ut9hB19u0j/jUxC5W7cNtqsSULm2XHuYfUrM7v5KAmQYasFo= 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=oxHGPQ6C; arc=none smtp.client-ip=209.85.167.47 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="oxHGPQ6C" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-53dd59a2bc1so2808234e87.2 for ; Fri, 29 Nov 2024 17:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732931580; x=1733536380; 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=z1lXYCxrn128DpMjUx/X3ynnQZTeAwK/ttm0jSS1k6c=; b=oxHGPQ6Cf3ZCTo+HbkcK9xnlIT4gbtPLYJmtftZLCPrOUvULGA7E3cwqi1jZMmXo9T Mi8vrftHnB+CkuU6TuEhigQhQ6Nhop3oIhdnOMGLBqW4VE3vq7DdQ/dJnvROkIAByhZk hTDMAEujJvz7gpv5RGOLoZCdrRSKcT2yjmy8ZQzEhu8En4xEI5B1F1D0W/QANvuAom34 LyIeXDMvcXuFwjfpnMQn57NcgFNzrmg7jfP268zYVZdZhNKfMpxS2AWYhunBMbGTEWaf PJYVde9qvobrY5y5yr5VzE+/o8jUpthzOEZWoXAwRiKHomIfpyWanX7ih/gQa3S3h9ac Oztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732931580; x=1733536380; 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=z1lXYCxrn128DpMjUx/X3ynnQZTeAwK/ttm0jSS1k6c=; b=CoA9OiSSZoR1lmtEgMM5DvAIoZ26LFghLYocuKK08ChVaIwdu4aJ45KvhMby0ImiUX ou3DlA+Lb4/LgAvZC7q9q7Sf+T9/ceGzed0+MJdhVvhSffv4LMPUWoA0FzPox0URre5c inboYe1p+Zb6mqc9IbMKY9l1KlpQCYzsUmKtkagF86HApsJHSeXCvXTSu8b7BJljmaWF PVaTgzRLU7HLalSf19HrjNCMI8jQn27lHzko3WkZS3vtSEglQFnuP2/GhDHn7l9n9tWs FXTrBJTVVO8R4LyTN+jGO88vK0DF7nN1iJJKy+LlDhP1awJBdtePboBaxF3wMaob2cqL TwqQ== X-Forwarded-Encrypted: i=1; AJvYcCVdyRhuGPQO3d0RynuHbj55jxNgKqB12NmzlujdG/vFcbQXO7vvzlgXh8MjgV50wGBfbkubL3mkYH+0SEI=@vger.kernel.org X-Gm-Message-State: AOJu0YzbzYRwQ4JRdan+w6Ore0UAkVirECFDiueZYuHrx2tjJ1+jkiWF qncf12/Oi3S4tl7cNc2cwrXVMlJ34+tyuIbBUu7xfniZiw9C+wp2oVaGQqfgrSc= X-Gm-Gg: ASbGncsgDrQc/f+JXQyML5fLHSJoAh5C6qoNs35qU5PLAXmZJLEJU11od27G0byNKiC 2RUxhzI/rAaQpjVsxlXQE9kT0ZrAy4w51MiYfd6R3pJKG8u/L2xr7YHJRSWkbJKhlkOyhZ1+6R+ 6HYd39f9F15gBsbqkECkUjj2rPlu/86Roju9n6qjYCbgpzMtvH2wJay/UP3f6BxnFvH2EywZGMf tS2CyZWldRgFjLjEr1NhFPuWunZCo11kjTHm2svXiWUaA0LyTJRvyaJZQ== X-Google-Smtp-Source: AGHT+IF1zZCeJZP0c56HDhB3dZvzfBBbMK+T1fbyelhZdZGvyXwekGQxsUf0KFWRtcl6qeCukozDbg== X-Received: by 2002:a05:6512:3ba2:b0:53d:ab21:4e17 with SMTP id 2adb3069b0e04-53df010e3dcmr8347283e87.55.1732931580177; Fri, 29 Nov 2024 17:53:00 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df6443172sm636408e87.84.2024.11.29.17.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 17:52:58 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 30 Nov 2024 03:52:35 +0200 Subject: [PATCH v5 10/10] drm/sun4i: use drm_atomic_helper_connector_hdmi_check() 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: <20241130-hdmi-mode-valid-v5-10-742644ec3b1f@linaro.org> References: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@linaro.org> In-Reply-To: <20241130-hdmi-mode-valid-v5-0-742644ec3b1f@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.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2060; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=tt33sNy4EHSANTDHQAExXai1314OqzFqkWnpPj2YPOw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnSm/hEd3SJUPYNRrY3fgh17VdYvds7f7Q168Zy EaL3JawgciJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0pv4QAKCRCLPIo+Aiko 1X26CACq+Vplt9h/bOf8vjWm6vdUiW7JOHiBTGnHe70WgxSHu/ZuvlCePWg1uh99nqgs2ima6WF a9lLDOxqI+EJiL4HXVW/9rMgRI9+kPpvRo4ZpFhSzWDzSDLhXw69MnpuoryWhAMHZUyDDqAaP6O eiqfS2m9WWGLc9eup/Hiiuc2DkZeZRIUpCxUytQsfiM08yjPmolqxG1B6UJFaoNBNQnoAiB6NKV 6yENKHrcdPICm1HbAhl90zh1cQYxOeCxuPr/++Vj6Lb/96pS3lioxQ+HZxLy35xyxCP5nSvsOIB IF09MJu53IVZkYd6054wQHgHWjrTHeEygEM+tXSOP4m5zQ6Z X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Replace sun4i_hdmi_connector_atomic_check(), which performs just TMDS char rate check, with drm_atomic_helper_connector_hdmi_check(), which performs additional checks basing on the HDMI Connector's state. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i= /sun4i_hdmi_enc.c index 54b72fe220afacc208b3fd48d5160031127ea14a..b05fd77870b00aac97d003f3fb9= c2b98cb73abc0 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -187,24 +187,6 @@ sun4i_hdmi_connector_clock_valid(const struct drm_conn= ector *connector, return MODE_NOCLOCK; } =20 -static int sun4i_hdmi_connector_atomic_check(struct drm_connector *connect= or, - struct drm_atomic_state *state) -{ - struct drm_connector_state *conn_state =3D - drm_atomic_get_new_connector_state(state, connector); - struct drm_crtc *crtc =3D conn_state->crtc; - struct drm_crtc_state *crtc_state =3D crtc->state; - struct drm_display_mode *mode =3D &crtc_state->adjusted_mode; - enum drm_mode_status status; - - status =3D sun4i_hdmi_connector_clock_valid(connector, mode, - conn_state->hdmi.tmds_char_rate); - if (status !=3D MODE_OK) - return -EINVAL; - - return 0; -} - static int sun4i_hdmi_get_modes(struct drm_connector *connector) { struct sun4i_hdmi *hdmi =3D drm_connector_to_sun4i_hdmi(connector); @@ -258,7 +240,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, + .atomic_check =3D drm_atomic_helper_connector_hdmi_check, .mode_valid =3D drm_hdmi_connector_mode_valid, .get_modes =3D sun4i_hdmi_get_modes, }; --=20 2.39.5