From patchwork Sat Nov 30 01:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DF4FD735EA for ; Sat, 30 Nov 2024 01:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rL+Q+A1E5WdeyWGlnmxBrdioN3F1q14QakvZcTSmWyI=; b=0jkdlLyhM48NhVvV+IwrP1OuVG NhRINH13gT47WIhmrV38PiL4ueNjebr5/N+SmJ79/uWJK4diqeyVczX1hhae4jqjkbdwUU2c+NXEe wNeuEH8IUaGInnZfpuu6UY69+v3MHifmPOwD4Lnpov1o55Sve3v5Siq40HQXVqxg9QxY1jGJ5bpm3 jhJ2AMvh5qQzIUkuHXEu4bPltU5F1kI8TXEciFEawkYSSSsumnoUUgrTS+Nae8hmDditFgdA7Gkbp US/THpsMVbqDIwFrX3yEjeVs9mqJwyJwXjXUePXPHsGBslC8mW69VWfrFLI5AeTcZQy7f5ld85mdX ESxdG/Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCgx-00000001H0W-13C0; Sat, 30 Nov 2024 01:54:39 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCf2-00000001GP8-0XDi for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:41 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-53df1e063d8so3074807e87.3 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rL+Q+A1E5WdeyWGlnmxBrdioN3F1q14QakvZcTSmWyI=; b=gNNs8hgqa/BeR3GfSO9W49P1QEq9j+6YugG7DOhkH84dqE1KmzmnPAWd2tdzXZEHgD bLEhU6BmOUCP9J5QvJiiLnRgnItOjrr0ihwOMmRj2HEwq+/doOEKPoQ5No3QLL5vHoWm amWD5PWwjjeD/nnZ4EuAgNTqqeiSt5lRnO5AkG6A6018xKNhDZ+IdhRsJNXMK9intFOE Q5kwtTHlBfI/BrcVQqpjeAwmjgN3HCwBe2RV2LRuRitfgXgq+H9isZFw2BIaVX4ZDPrE Be5PvqCSTzRfVefLWaQxtNYxVlZvYQUseaUj3wCG42RlmffTKZV1j0Mk4u6B7D6GUCMf W9gQ== 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=llnpBfqJYAf7071We3f8ZlB0XQlte7gHPc5p2ejW3fYCuC0AHUufK0LUHaS6pRQKVh A+0MJe54ao7owE7q0iUqZAAAm4ET8xgsbyx37j3Jq5Es0hWlP64eDk7CB50dc13/19DW FgIsa+VJsve2gdAIB8mgYJlt1V5sEjgJXVRlvJxZXR9ha4U6N1xeeEp/20Fn+oMffs7Y sWAuSm8ZQOwnLqXEM0Tjzi0iJne1n8MrSzHStA8loHxTm+tA5jWDSJOAbMHksOgUAFzR x3ehkQBQK8RpyO2bJg1msJvM79SlEdoMbpge+ja23tLLoywak8xfJonjdlFfnjGQgK/Q wlIA== X-Forwarded-Encrypted: i=1; AJvYcCW9h6vWQrEQLus/0cz5DYnCEaoaeFHQWAp2edJ6qF38CzlbSVK/1TWVSilo1CyTNPcvOo4bjD/CMIbXcRW0ZTDw@lists.infradead.org X-Gm-Message-State: AOJu0Yx54BYfg95pVxtPipmEljmnJpxeJilmxITzBZJb/W7m+TPhFuI8 gxgbiOzI0mTGr6wmuqO7EK2zwpufMTW26nFFVONPSlxEarS77ad90cuVmPeXacI= X-Gm-Gg: ASbGnct3T9zaNCxiYy5u9A8RcrfCrcceG8VY6IPGOTP6r7FMXn+ZSAQ+oT9CfbzSOwd r1ilR/95l9EhIoqMd+kgfX4t/EBa+hkHKPeoby9hVVT1shnJAxqvZrGmc2G0OfdbKW3j5CdnD5B 3ZmF6sECqDsFoXoy4mo2EjXNeLHxTg0BPEoMN5Nrs+IZudRjyq6MixEBpSdOCWTyfWLT7TtlsBh eJ2duiVvZwdkmRJEoaX9Q73mF5jnHXANTThSzlDrv2vm5YIeDxwZVI1hA== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175240_168779_790D4960 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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/gpu/drm/tests/drm_hdmi_state_helper_test.c index 294773342e710dc56772f839c2db9c2e487bbc1e..1e77689af6549f162eb3026c7bd2bbd59516ed98 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(struct drm_connector *connec struct drm_display_mode *mode, *preferred; mutex_lock(&drm->mode_config.mutex); - preferred = list_first_entry(&connector->modes, struct drm_display_mode, head); + preferred = list_first_entry_or_null(&connector->modes, struct drm_display_mode, head); list_for_each_entry(mode, &connector->modes, head) if (mode->type & DRM_MODE_TYPE_PREFERRED) preferred = mode; From patchwork Sat Nov 30 01:52:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52690D735EA for ; Sat, 30 Nov 2024 01:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b4B0Y8eeW8nijFHMU2wdPBEmou1JUmUHuwSM02tCW6A=; b=J8EyOwBOCWz+FnQUEVkRpRFTbU kPWUguNjmyXGsbLNfVvKuEBD+6HPCb9UGGRo5R0035sl3MN5Lw/SIIzXorx2eG6PydsmAUU42MaAX Vl2h68XK0i2U/jaZ4h/WBGk1EqabtZqP0jQW8EFzwCBGLMB7EDQvtQcEIQfulWqiC/irav39a1LlP U+3zgAaddXu/mWi4H7WoPqGt7BsVTXBKg5FB81HOHpImkaoW6vee9wRIdk+igWH56G7IK4o5tNmh+ 7oO+J1XUw4W8MMo9x6HZU+sMHi7Erj86p6JecAM8EXBikLRcq/ShNc6fX3/4cdPCCg/pCnm9qCkiV St//JJvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCht-00000001HBO-3u8C; Sat, 30 Nov 2024 01:55:37 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCf4-00000001GPr-2X1p for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:43 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53df1e063d8so3074843e87.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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b4B0Y8eeW8nijFHMU2wdPBEmou1JUmUHuwSM02tCW6A=; b=lLdh2fA045NOuljY2wAW2PvuQChHrePWTRC7fx+b4d4/Imjs0f5rxmnJOXQdHmFjsT xDf+FFSxt5N5Szn26d47KPR7htHfl3s5TJoKIIjmod60PGWSLWbvQHz6rgjp+IxEKUDE hWm+ypyydf6Q9NGmyIcrx06m2/HhSnOM3zIq91TmPVKaK4O0hHTJqVyaAaeCl5P9FEEX bTxZbLJM4Rnal3Y5f9227HxTmJLpTGrEGaAqLmBVPLQqhis/g98Wtzt+P0csMlMc2Vmh VIA/uch49FxMSMebHeGEfSnErG4/S8yLVw1jv/DSorBiAdTme+zqyLz+C0Z6BdqjsBUq MOZA== 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=koMxBBl5KzOzXBsWXlkzf96hrJwERpR+oLyB5X3/zPv9llAUTzof3+H3iH5KnWdIhQ cDfIG6L7BlbMskrz3Ys6mcdSes4b9S1A+WtWgBJCEwhTHPzwa6Apt/rrTJVUM8USaAzL ZdLw0M5F2OwGNnRUFxvwdxPFHIzIoVI+7IYrGrTeTuAAe+sBXlXNEgjBEKzruraOp5JE BCgGUuezuldavbHBAC96cDBDOmlg/+lysAYyKMdmdtuzavVA8huej4ONl5reCWAmiqAV vxMykXhRGtEXokx4FQDMGx/9o6VHchV57ze62HXg/sASN00raqZPAaYHqHmR6Fmg3ckF gwZA== X-Forwarded-Encrypted: i=1; AJvYcCWk6wsHuLLtPjhds7zKC1mZaRolsGOnedqeCwvYkkbNgbTD1iRY6Zoja9fa5Nu2JMj0t/5IvTWaXIXqcesiMevm@lists.infradead.org X-Gm-Message-State: AOJu0YyXpkYyns33zoofwdOiv4lA4dWSmRXrK3Htousvimm4R0yQQcK1 M7RS8xwAddQUCdTHJO5LqlW005BgkxcERqWqj5SNfoHYz2hZ2YLMja0yu6FgU4U= X-Gm-Gg: ASbGncsKeNYUfK7GxfUPQkBzQLAnzCN8ThPuyqfayr1N2HR1noDZbcoXXAEdMzgQ73A aA6aDY59yU2zanCo7b9VJwtsIPffRH0L2rzvzQapJ7dCq7LeJouXqARY+yhdu75tEHQrB3Z/9Jm 8kPAniWHNU0kPriGCyXwWvVIv3JU/8W9+UDUT+/R25OA8mHdnNJMMIaeqAzu16kTt/QvFmTR8OO J/GleLH6Ifg5u+u7xxKE4K4XdLDbmIiRrRRQx6eTNRT1CEhQV+Ke860vA== 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175242_651199_45FC4B25 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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/gpu/drm/tests/drm_hdmi_state_helper_test.c index 1e77689af6549f162eb3026c7bd2bbd59516ed98..60b1e37522837ee183c65413e3ba6c6ec4fed341 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 = { 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_changed(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); ctx = 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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); ctx = 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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -601,9 +601,9 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -659,9 +659,9 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -793,9 +793,9 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -862,11 +862,11 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); conn = &priv->connector; @@ -911,9 +911,9 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -958,9 +958,9 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1005,9 +1005,9 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1056,9 +1056,9 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); ctx = 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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1179,11 +1179,11 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); drm = &priv->drm; @@ -1305,9 +1305,9 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1370,11 +1370,11 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); conn = &priv->connector; @@ -1438,9 +1438,9 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1496,11 +1496,11 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes struct drm_crtc *crtc; int ret; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 10); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 10); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &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; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB), - 12); + priv = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 12); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -1685,11 +1685,11 @@ static void drm_test_check_format_value(struct kunit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 8); + priv = 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); conn = &priv->connector; @@ -1707,11 +1707,11 @@ static void drm_test_check_tmds_char_value(struct kunit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_atomic_helper_connector_hdmi_init(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV422) | - BIT(HDMI_COLORSPACE_YUV444), - 12); + priv = 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); conn = &priv->connector; From patchwork Sat Nov 30 01:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62F2CD735EA for ; Sat, 30 Nov 2024 01:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4GXhZxLlG0np8t2RRMsMP/s3gGMuI1S/859XP5wOxy4=; b=Xwae0R0uhkhja7KRBIsCk2YkKz y+LO67eisKyY0ZNW9+XyI4B0MhBfmcAoPsUqkE0i2KJLmg67EoGbPQbCyxIgJEmWmcXXCkwFvL/4W xkx+Be1MEB7zILc5hvYGCiHiUlV+wavXWWAwUpyPv2qNufMpgm7RowU48AIJNOYxyyX1zHtHAgsGX 6qhz3JzGivHKbIe4fjxu8HO4qmAAscN3dakZd9nowzPmKM6Ilyq3K36QzB6Vf6+sOXL4BvB+HkzWj OWsR1mK+bB0hQy6p+talQVHCne8/hPZR1Dm4APTPmA3qZaIJl+uTlBjn4m0CPcqTeVVySJJ+vJbyC lQfQEV+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCir-00000001HP9-2bKA; Sat, 30 Nov 2024 01:56:37 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCf7-00000001GQa-08yV for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:46 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-53da6801c6dso2377711e87.0 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4GXhZxLlG0np8t2RRMsMP/s3gGMuI1S/859XP5wOxy4=; b=HOwPvVPOumf7fwH7YdLLbT+qaHRbxY0Py/l3637iZIgIAe3uOFHvqathBSRjqZ16Hb pp/ojYMtEs/i1RUgYkNHDGP3QlHdMWB0AeRERrMsUAHLZPNICoy1rcPW8Fi86JKxxN5+ K6/vxnGN0eXpt2lhLHmre6wKw69EMGvIapv4//iK9oFu7m3VKc1Oa/IisLx3elrL4T3Y KiaKy11CxLl9tIdsnMDQzZ9KGz9AzyPbw0A+PoRtCM3GxIjdoylDGbxtnLDG0EqcT4F5 kOd1jkGH61sNjfIhCxSkRXwlGmsfgQqu9T9I1l4nJ6HAQ+w5piDJoraCHMcMLY6sFQHI X3og== 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=LCXfnUWAFjmx7cvdj3sC+IDXMnNK3VBcLONqA3cfoqbAha5RkhfKa5zLhTKXTprarV ELYOFkRVKwN4h/o/BANv+N254YUsq/uUiny33C5uHM/fiBksMCgNTXAHzZZyJKWORGRU eW5uN8JbZz38KzU4mpO4VyijE0IqdYlEzJjWmtZdmGXD5r9Krop10o/h/m5mLmxhnd4c iv7o2449UWyD2f2Yp8+JYMInpEstzxJlLjIsmEecnjp5by12lZR2Hocx2EHQfpMusi30 ukJSMrCrXDb22rkuk4fCmxMiwzRqcngY30spzR75NP51VGz4yMmyzSSm16H/Lr70Ssoi jNGA== X-Forwarded-Encrypted: i=1; AJvYcCU67BlM3brL4ZCQ3R2yd/VOFQZKf0A1aLO9KuHBX/IjxcOg9RzJCZ07GmLJaP+F4rcf3zAj98xORfvtZ8tbfjpK@lists.infradead.org X-Gm-Message-State: AOJu0YyhS4ORbyOZGgDPpmHmdqgrXlvr69XLpG4MdlTj6e1ingV49tPw WjK65LBF//x/ab57WjOJLCC92dIfTAxbBP8YNdSmip0WU83/+ZWVWeXnP6aS86E= X-Gm-Gg: ASbGncvVXp7R2ABMQEDrIZ2Te8s0AoA4nCHteXV/JKSPH5FsrkeUoy729zNgOSPUV+L jLcATP4+o7qMX2LQIStrlUxQgT5svcHDbmO6uO6ptI2sa1WDl3aOINdvx7anLzC98ZrAjnKuibx ua4zvzcH98OWW0Bele7wH0fMKQu7of91hyGZXU+wIjcI1PkYNlt7v3TZA8cCZv9uuZlcrurMqkN K2LyYk4juG8Fq7HZI8SkfMDqUF2L/AhG00iV0EvyiCrgq1BXsnBbWiRUA== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175245_086999_F66CA595 X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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/gpu/drm/tests/drm_hdmi_state_helper_test.c index 60b1e37522837ee183c65413e3ba6c6ec4fed341..19384b5ff28100b96add35cee86d40cd7d555f1f 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, struct drm_connector *connecto mutex_lock(&drm->mode_config.mutex); ret = connector->funcs->fill_modes(connector, 4096, 4096); mutex_unlock(&drm->mode_config.mutex); - KUNIT_ASSERT_GT(test, ret, 0); - return 0; + return ret; } static const struct drm_connector_hdmi_funcs dummy_connector_hdmi_funcs = { @@ -223,7 +222,7 @@ drm_kunit_helper_connector_hdmi_init(struct kunit *test, ret = set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); return priv; } @@ -728,7 +727,7 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) ret = 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); ctx = 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_changed(struct kunit *test) ret = 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); ctx = 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 = 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); info = &conn->display_info; KUNIT_ASSERT_FALSE(test, info->is_hdmi); @@ -920,7 +919,7 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) ret = set_connector_edid(test, conn, test_edid_hdmi_1080p_rgb_max_200mhz, ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); - KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_GT(test, ret, 0); ctx = 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(struct kunit *test) ret = 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); ctx = 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(struct kunit *test) ret = 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); ctx = 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 = 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); info = &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1190,7 +1189,7 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) ret = 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); info = &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1254,7 +1253,7 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) ret = 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); info = &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1314,7 +1313,7 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) ret = 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); info = &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 = 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); info = &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); @@ -1447,7 +1446,7 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test ret = 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); info = &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 = 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); info = &conn->display_info; KUNIT_ASSERT_TRUE(test, info->is_hdmi); From patchwork Sat Nov 30 01:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB687D735E4 for ; Sat, 30 Nov 2024 01:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ZLmc4ldEZMEINodQt+XcOaL2uCpfas5CxnR9KYEiKA=; b=b4frPSHqxBUOZ78YEG1vmdQsdl 3reAz/9g5mZ/oCp86Yi2nbCwaDMBCxSYDU4CSfS3lCWqMxq1vp9WoM+GaF1HQhlZmFvQjOlzge3yB OW0IIFSvU2UZU7FSA60UBriqFSMfk4rDSe2555DF9DUrCVI0rwmcpzI9RrbiJr2H7gVUbPaHIyS8T rRrmljKsWeVAbOuX337PFCjdiSbeqMWNQGKwTq5rUsmOoYXhVhPr4v7OiCKyFRUaJxCnVQV/8IvZ6 WkJK8hyHozGzHcStX8ej0HrV0JAGfBTf9Budi656YYHV14nbtuih6X0JWhNms8RGoBxhbZ9UQ6csg RjLUFA6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCjo-00000001HVH-13CY; Sat, 30 Nov 2024 01:57:36 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCf9-00000001GRx-18dK for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:48 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-53df1e063d8so3074891e87.3 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9ZLmc4ldEZMEINodQt+XcOaL2uCpfas5CxnR9KYEiKA=; b=cX+bwBQq1fhPhy9kee/7zXXSc3RbQL2edv/45Trck82UP31O3fhkJu4mcchZ8pTmMM J0RX8FMdwD5q7Md8eU5gOoTRq6IdJuWENgcq8lFG7YDAX4D7gMVXDc8U51BsjE0DdFtp Pl+Rq/cgWlBbjO1T8Owu+1fkJaFo+AKoe9/rg/iZhhBb/yCX1OCou3JkDtp2ITrFBmKt E0Kny3Wp07FboTdRbl7atLms44cduv/9VofoToFsZ3IYejAH/+lg8TKkgiBOWhOCctl7 0SZfRodfk2grolk6lCphbeobDz2hUkRt8u+urS6cZpauwEB07ncJci2qSZVrDO8mjrhj fOZA== 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=CGnyCrMmq0YFu1bD34sTPClqsWaHHLEmgsl3/5nHPK8ZbiHOrhNEXDsk655EcOwwrn 58L10WXLkZGUOMV9+hqvbMzvYKnWb+3VJfC7zZitdV3KHJZbtQBKJs87s1bVbO6Vl+mb HaIOAVn+WKgIRTcBIm130C9uT0uaKXhc2pB4FnNT768EPr9Yn+IxJi6Mn4Qp6qhzlesS Hmr0+bA+yZIEzX8XO9F2/SS6LQj+nrLYZfIXW4HzVhzMfFBP0qcHyxOYoFqAvtunFgmC NZ6E0sELgVCtsQZgKsZHMEEL7FGLbKYDXLKGx32Y5NtpRFiObFzA104+tIAL+JpFh2yZ GlqQ== X-Forwarded-Encrypted: i=1; AJvYcCVxi2uaHNOEtnUZf9Iltj/Mk36go1R05Ts86+WEtwCCp8kCR88UMhQ3XzfhzvmlEewQAoP6D8Wrg5UtXYFmHGoA@lists.infradead.org X-Gm-Message-State: AOJu0Ywd4UjT3bPvrAiTXtBc/mqJrdjdxf11+t/yNiFMHEXmZ+UrFwyH wkwzZX+X3G0oBjPYpcbKOeuoUEx4cUt6BxO22j6aQGPkmDuYm7OumnN12vbfDlI= X-Gm-Gg: ASbGncumv1y1xunkgObHdNEzOUEtZnKS4Ilnl5WWUldaU4tdO2QbfTDs5Ilcf68IHqi sfj+P6enipmu+bEl5/Kv+F5CoNA6QqsZ7qr1EV5DkksARU0d9EnB2rZCc/06s8vWKHnGeH1VReT y+o+wJv8reY+xbQCMCg+6D3qXQB7SryhiaJGyLgAewxwSeSbquwIwyf3jdoOtOaj4PM4c4mIVYo Vr8SojXJryZx1+WhOdOJrxVxRY6XYCHQsBBs+K9MjUc8vO77GL/l6tjag== 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175247_481535_A12402D4 X-CRM114-Status: GOOD ( 22.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add drm_hdmi_connector_mode_valid(), generic helper for HDMI connectors. It can be either used directly or as a part of the .mode_valid callback. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_hdmi_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..80bf2829ba89b5f84fed4fa9eb1d6302e10a4f9e 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); +/** + * drm_hdmi_connector_mode_valid() - Check if mode is valid for HDMI connector + * @connector: DRM connector to validate the mode + * @mode: Display mode to validate + * + * Generic .mode_valid implementation for HDMI connectors. + */ +enum drm_mode_status +drm_hdmi_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + unsigned long long clock; + + clock = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); + if (!clock) + return MODE_ERROR; + + return 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/gpu/drm/tests/drm_hdmi_state_helper_test.c index 19384b5ff28100b96add35cee86d40cd7d555f1f..c3b693bb966f1f8b04066d19f520bfa4bf11c23d 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_connector_hdmi_funcs = { .tmds_char_rate_valid = reject_connector_tmds_char_rate_valid, }; +static enum drm_mode_status +reject_100MHz_connector_tmds_char_rate_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode, + unsigned long long tmds_rate) +{ + return (tmds_rate > 100ULL * 1000 * 1000) ? MODE_BAD : MODE_OK; +} + +static const struct drm_connector_hdmi_funcs reject_100_MHz_connector_hdmi_funcs = { + .tmds_char_rate_valid = reject_100MHz_connector_tmds_char_rate_valid, +}; + static int dummy_connector_get_modes(struct drm_connector *connector) { struct drm_atomic_helper_connector_hdmi_priv *priv = @@ -146,6 +158,7 @@ static int dummy_connector_get_modes(struct drm_connector *connector) static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = { .atomic_check = drm_atomic_helper_connector_hdmi_check, .get_modes = dummy_connector_get_modes, + .mode_valid = drm_hdmi_connector_mode_valid, }; static void dummy_hdmi_connector_reset(struct drm_connector *connector) @@ -163,9 +176,10 @@ static const struct drm_connector_funcs dummy_connector_funcs = { 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 = 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 *test, drm_mode_config_reset(drm); - ret = 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 = drm_kunit_helper_connector_hdmi_init_funcs(test, + formats, max_bpc, + &dummy_connector_hdmi_funcs); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); + + ret = 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_connector_hdmi_reset_test_suite = { .test_cases = drm_atomic_helper_connector_hdmi_reset_tests, }; +/* + * 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 = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 1920); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 1080); + KUNIT_EXPECT_EQ(test, preferred->clock, 148500); +} + +/* + * Test that the drm_hdmi_connector_mode_valid() will reject modes depending 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 = 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 = &priv->connector; + + ret = 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 = 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 EDID + * 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 = drm_kunit_helper_connector_hdmi_init_funcs(test, + BIT(HDMI_COLORSPACE_RGB), + 8, + &reject_connector_hdmi_funcs); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + + /* should reject all modes */ + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); + KUNIT_ASSERT_EQ(test, ret, 0); + + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NULL(test, preferred); +} + +/* + * Test that the drm_hdmi_connector_mode_valid() will reject modes that don'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 = drm_kunit_helper_connector_hdmi_init(test, + BIT(HDMI_COLORSPACE_RGB), + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + + conn = &priv->connector; + + ret = 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 = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 640); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 480); + KUNIT_EXPECT_EQ(test, preferred->clock, 25200); +} + +static struct kunit_case drm_atomic_helper_connector_hdmi_mode_valid_tests[] = { + KUNIT_CASE(drm_test_check_mode_valid), + KUNIT_CASE(drm_test_check_mode_valid_reject), + KUNIT_CASE(drm_test_check_mode_valid_reject_rate), + KUNIT_CASE(drm_test_check_mode_valid_reject_max_clock), + { } +}; + +static struct kunit_suite drm_atomic_helper_connector_hdmi_mode_valid_test_suite = { + .name = "drm_atomic_helper_connector_hdmi_mode_valid", + .test_cases = drm_atomic_helper_connector_hdmi_mode_valid_tests, +}; + kunit_test_suites( &drm_atomic_helper_connector_hdmi_check_test_suite, &drm_atomic_helper_connector_hdmi_reset_test_suite, + &drm_atomic_helper_connector_hdmi_mode_valid_test_suite, ); MODULE_AUTHOR("Maxime Ripard "); diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.h b/drivers/gpu/drm/tests/drm_kunit_edid.h index 107559900e977119d451b00a647f0bd6ab598f63..6358397a5d7ab0bcdea1c824fc9fd382560f4b0e 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[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab }; +/* + * 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.175000 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 MHz + * 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.500000 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[] = { + 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/display/drm_hdmi_state_helper.h index 2d45fcfa461985065a5e5ad67eddc0b1c556d526..d6d65da6d8f9ee46de33114cce2d6fbe6098a862 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_infoframe(struct drm_connector int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector, struct drm_atomic_state *state); +enum drm_mode_status +drm_hdmi_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode); + #endif // DRM_HDMI_STATE_HELPER_H_ From patchwork Sat Nov 30 01:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0B7DD735E4 for ; Sat, 30 Nov 2024 01:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YdWiUnW6vTgN40+31xk3R74ZtFvE1HPhsssihDLePE8=; b=VyyzSBMG1eNpmQbUuKpWKFUa1k shPdGaLvDa4YJnbpjkQMMk2Jbfu1WjsuZUC9KIoc2t8R5OHs1rcOcmOTQoDtMNr8VjSBKkuzalLb1 9miEk/3dQsrbecle+FLBBgkpR6kqN+z0h2oHJVBLPg0aNAy7zXCbzqlT3UM0W8GgNX18PvgtWbTc/ MqYj+iibU+q/T8UGnhR5gUPYsrXYckzQwOOL05rX716LIObYkjMara6XeobHwIk6W/KuQA3ARr1Gk rI4VsvAkjQxpLvUc/qfqYFNPoOutmOIaJf9H6mMQF5YnK8nutPO586W/+kCXC+Pfvd5XPVsfB03jy M7NT7yyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCkk-00000001HdQ-3blE; Sat, 30 Nov 2024 01:58:34 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfC-00000001GTt-0CQg for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:51 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-53de035ea13so2446651e87.0 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YdWiUnW6vTgN40+31xk3R74ZtFvE1HPhsssihDLePE8=; b=I955RPpCdKeDD+z+KOuHBfmR0yLToArHt74cWrZ/9VcYOMwZRlqrRC9MQeLr6WIGV5 jCH2gaVBKcvpJQwb79/O9j3DwwXo+uSyfhPeqXpQTg69XmWbkb9ZsC3CdscEU+Ekd/VM m3wwwyQcnl8ZKAWxkOgX7BnQeuaWNGO9b+wGBSTnwtBtVOkfVITCY8EZwp2hKIpQEvfH T1XahPhv7jul8T+Gza3pg0LtSvVpmEjtGRInmpH25xITyLmDi8VLLAPvw5dixKQq1lbc 3PaxhPK0GxsKewexqURh3C77jdvUnYB/LrMeXIEXu6KFY33dDJpebUergdgdLay4TC9y qKaA== 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=tGE4eqvWWQDx0cCFN4rPzQ/dMyLg/snKvstkIJhhKAtkannAWZbXPRkJEHoK0cuLaM /nEAxGwA7NfTTK0m9uI98jQ7W1L9lZWyWG8khkQ7hY7/+Esw8XyM43+KbJQUOttHf04f inTCZw6hfC4Sv7skb7bO3ydLmWm8tiaIwCIPNvsT2pLT7g/SC6ZhU9LHRQhWywTebioD rz83k0X5nQrEJRAuUwyGwkO4vYyH0VTzFFd3LOwpdOOiJbqHYlfTh0vibqsn0RdIMW1r oj691VUZjy4gDTwIimQroCjuVg66x97ExyY6VBTLDK24L4SV0MmgxrhW/c332CBeybNz nJZg== X-Forwarded-Encrypted: i=1; AJvYcCWw8TXEqpOyItlYEZkQMQRoX3lu/nEP9/OrFZfq7QNFmk+y7haOXMH8JLuzFmVrGGeuao8Bveyot2kkaIRWXmFs@lists.infradead.org X-Gm-Message-State: AOJu0YysA0GNW9NIYdTRr4V4oUfzyl01Xpvm0LXG9DxCBIX2jXb7yZMP NBXVP3gjGGMvm9kivO9KFm/DjP3PGJbFHDqx/dQQ4QKj0HvLChTLzvn8shKWhTk= X-Gm-Gg: ASbGncsxx6ZGTz9uGHLEq5/mEvbA6jnWSEpEuTAEddz+BKw2c7DlvQmcE2sbJXFiLpS 6xZjCsoL9HB41IuHdz4wh0quiLMAAb+sv0Wsu2fIiR3DaH6Ix+9/sxxOKJQ/MqMmJ0siQR2xQ6g avzWKD/qR+CNAgJlQ6XpFa0JkwNPywFMsAjcXSMVEZ6mBB4ZTheqJtYCBTEyrOH2Fq85zzSTHC3 T9AzXaLqFpVdApKJHkUorHc1bZ9BjJxWJmdzg9h4k+syxfKF8xAiXCrqQ== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1574; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7WdeDK9PVMnPHS0xN6wrfKPJv4ESCzGwmvZnGPcMZ/4=; b=owEBbQGS/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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175250_086774_41A4BC8C X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Reviewed-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index b3649449de3026784ae2f3466906403a0b6e3b47..54b72fe220afacc208b3fd48d5160031127ea14a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -205,16 +205,6 @@ static int sun4i_hdmi_connector_atomic_check(struct drm_connector *connector, return 0; } -static enum drm_mode_status -sun4i_hdmi_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) -{ - unsigned long long rate = drm_hdmi_compute_mode_clock(mode, 8, - HDMI_COLORSPACE_RGB); - - return sun4i_hdmi_connector_clock_valid(connector, mode, rate); -} - static int sun4i_hdmi_get_modes(struct drm_connector *connector) { struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector); @@ -269,7 +259,7 @@ static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = { static const struct drm_connector_helper_funcs sun4i_hdmi_connector_helper_funcs = { .atomic_check = sun4i_hdmi_connector_atomic_check, - .mode_valid = sun4i_hdmi_connector_mode_valid, + .mode_valid = drm_hdmi_connector_mode_valid, .get_modes = sun4i_hdmi_get_modes, }; From patchwork Sat Nov 30 01:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4523D735EA for ; Sat, 30 Nov 2024 01:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rqzd45OJ/2bjI5cuXyLBaiv2D5kR3sXVh9d8XfqZ3RA=; b=e96vZB885ogYZfsf6MmtLZS3w7 LOFkAs4GSwm2yzF5vV6W1r46aXKCBhoVeVDmHiB8owkhF3ARzW+OvC5z8svhZR+H8n68iSyev2R7f dDbkXAu+mpjY82Gza5j/CcWQuJMMiQZdKSKYen0GD2xO+dJnDTtEe4U/WDQghYeYeA+5lCtF6w8N/ qo9TeWkuLBwAkG3WdtUKwETxNMKCFiGJZlO7oGNKnnqnNsx6BhI2mZPxdzgX3yxFFh7uV2Zx7P9EV QCU8Oj9MZwEqH203ofY4Sc7aRLw1XM/Uu1otSa4kvdZNmHbsGhdwznyN8B5nI1RduA7dTHgPEz/O1 9WGMMY0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHClh-00000001HjU-2YOk; Sat, 30 Nov 2024 01:59:33 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfE-00000001GUw-2H3f for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:53 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53df67d6659so3996534e87.3 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rqzd45OJ/2bjI5cuXyLBaiv2D5kR3sXVh9d8XfqZ3RA=; b=sAo50KPwrdamWaOQnZRB5GOrh0afqoxhcfbFibcLAdKGf4gt9MKVBBbLl++GW4+Y2j zw9oeQcinPtG2mUDBpDsBe5395qqTgWxDY9BB+eH7acolm0knzNt1cz8riyoTZsbE03r bBTSl9vcnZHAVwBX1AFbbYiBOgV0CvJvfdALaToANTdbGEC+MSUd3k+0GHfEx5zsiLcD lmM9WUu/tsu4ChslGT6vB1YcWUKcIyuplL7NXzUcJXwFFCHo9GDEAEg8w51wHNvYI41H my+dWEBvmrQDY8Cay6YboQcexI+koDshkZ74VApOoBT/WWGtX1jXaKeZfYGDvqVJTB44 8AaQ== 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=hpQHIeY1V+TGC7JrsZUaAbtvrj5LkYGwg4/D1XhWmO0gfs8xObiBLVTc78nnmq96tZ UKaxHZpzKo0laHVHCS3hFms+h/uT8Dti9NdXP6l0YISF2UvjwJvdf1JlBzkYX9oSr336 FnnBMKEr9Qac+NN5eJhnocGfXGISEWvp7zUQz8C1jsxrp/c/FjL8laC+SnEfcYXbXxYK UDQp0aFqfnNEHisxkiLxuf4sTXdV4tPslE9vVl+rBS6C0ZjYqdJRUcq4bKFHTGQSUl3f BG79EjBEmSX7nIVUZs3/N834YXVmzSVzxPMkxjb8tbaHiAYl8vuQH1JrGd5fKHN33GcW iI2Q== X-Forwarded-Encrypted: i=1; AJvYcCXKqErmulZTbQ1RFjwn033K2kKqsn8JKwc0kTwAxNNDHKuaHfRN/okdOdwmJr0rIY4A/igC4LM5JhuDyAjqZPME@lists.infradead.org X-Gm-Message-State: AOJu0Yxsigix/GsgMRcAIr+BAt2zSaQ/d13QQ+NBiiwfmYCpgjCbqC3j UAjEMeQ0bwxaAqogzzBHGlqKwIMzVcmv+BEKqTF5U8gaS24gTzZLs/w0mAZYKW0= X-Gm-Gg: ASbGncuMJVapl6I8viAIR0rJAKtc+WUhsHChMcKb//ta8XV48aGrQQ5Kdfz3XKdYxIQ UwH1yDFYaLXIvMapzNCFHn9+w+BOoYNyBEu8k48qBfgmoOeyDaNrlj7BDWMwUDswq823HF7hRJg WKfRYlzuySrh1gAyMK1EFsRawJhFopDXXxqfHuE3YmQO75MWdU+odc87oBecrSq44mvMhPH658l PL8bFaPLPe+TAxZ54CfzMYC4uUeWywPBAY2cbz4zwRklB2i1nY2VMQ6MA== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175252_581468_490278AB X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. 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..297afd89036ba8fba571379f5b6d63227eadb66e 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 = .detect_ctx = vc4_hdmi_connector_detect_ctx, .get_modes = vc4_hdmi_connector_get_modes, .atomic_check = vc4_hdmi_connector_atomic_check, + .mode_valid = drm_hdmi_connector_mode_valid, }; static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs; @@ -1765,7 +1766,6 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, const struct drm_display_mode *mode) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - unsigned long long rate; if (vc4_hdmi->variant->unsupported_odd_h_timings && !(mode->flags & DRM_MODE_FLAG_DBLCLK) && @@ -1773,8 +1773,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); - return vc4_hdmi_connector_clock_valid(&vc4_hdmi->connector, mode, rate); + return MODE_OK; } static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { From patchwork Sat Nov 30 01:52:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1ED48D735E4 for ; Sat, 30 Nov 2024 02:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bi+JDxO7zFRVUVNShSHXAVY8nfszGwV4/oGBGiyAqww=; b=3z6hZbYHXcxKFdEpWKM2iL8Qsn VJojzgIz6ZRqLUWHx/37TPDBgW9buCGYk/cK9ipdCnrJvNydyhxNnT/Jf8xxiGaCQuQTuI0IotUrt e0zLGtOFcGu4xTTcB5vPMJvAXLV8zn4rjtD4U22YkXVyf6PoQ7ZzMF1DK1Xi4ZICE1nlHQBEt11R/ nBKHSjd492sShlV3PjMq1LQV0hIGYJ9SHCJfkptadPuRfJqTqRwugIZuWXy77bVMugCm/xPrqclr4 vvDEhIC68tD4PmKSKLYhhmgiriyxp1YfnKpSeEVmv9fCPzCPlROrQwpQS/Y2VupyF7892FQ171ANz zBhMAFAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCmf-00000001HpX-0plU; Sat, 30 Nov 2024 02:00:33 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfG-00000001GWN-2IZ7 for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:55 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53df1d1b726so2909613e87.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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bi+JDxO7zFRVUVNShSHXAVY8nfszGwV4/oGBGiyAqww=; b=UzIedcNNsStE6HjVnr2z29JD1UMtqZaqFam5kjzj1d7BMUIKs05Q+GAjCtV8lq84Px MBY4jGGwvNXMqG8XEM82CpiOCyP7EVdp7h9FcYpH6Qt93h35RZ8kOLuOvXhwPgvXsYui M30erzJ+pZR49FrL1urQ9sek/pPg5ArnMDHFldpuyZsUgt2kpA4AP76g+mQFIMnkuU8F f9WN11rCkKASEJg8PfpZbyEdPinxJkNXNejaktyxQ3L6IoLWSRWVhn9mavnlvkkv+787 oljIaUWfPADxaReS1Zz40nJcykkAEmKeKSKjWrNU3i/N4OZ++8EITaKJ/iOTNzWgSS9w CZ4A== 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=bKjnag5d2yuEbA407drno7ZVEg1lvzaS8u+Eoub9mmPV9Lv2CGEqYwdbk2heuFDdlO ZH4VQutlguZ2iE+SNsnj5B+2j2O2O+1oSQdBjZfW7Sr4eeseXNd6PnQu82lkCRCAQvFV wMjGj5SqSzbam/5FsTF+/crd2RGMd4FE3T4SckngHI3M9xNtJe2tveXEMwjpaG5je7GS eYLW0J75ughfFqJCK4Dn9sgi3LbttRkQnxDXYC+LQJ+J521G5zDrM4mBZa9doxVodHXX gcfsLRWfOTWG4E5WwUvtLGmDYE55/4nCelmUhwnH8Gz89dIRBBmkJtTVRuoGaggbzY48 0/Sg== X-Forwarded-Encrypted: i=1; AJvYcCVXkPSjqUQAUm4DvxpqazRCCygi3l9EP/BXldtWSqXLHXxxNSOSN8u1MAAfUEf4/3QvR1nSFQmcB28OCcUc5Ni0@lists.infradead.org X-Gm-Message-State: AOJu0Yx/2TF3zaAdVm/AD4BEMehkNH4i5z39WHSFXUD4Pc/m+XJns0oT sXQF9PjbwqWLMo028aot7O59avYGj7QkMYBOAlGF+lGAUd13THQ2TyE8pi5cELU= X-Gm-Gg: ASbGncuD565eSZ+p3/UHwNfUB4875XZ2suWssOekajRgUkO55cior45xPyyYdhmj4ee /zKAa27FFMYJBxay2xuu1tU59u7qkNL6y2sWNC3ohdxAgjIZxYvgGVWqN6sf6Y31hHfV/MvyUqc rYJkmhmXQBwVWGnYKhbuebMWhvTQBF9Gu10j5KG+XqVMStoJcBozI1+b/8Pdi2hxBrRXl+adn31 4nDFPRxb9ZZ2cd+Lg7mC/mDlWj2V/a5qgHvhmTBKqIPR6z5y18NPnM55w== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175254_592234_08FBFF05 X-CRM114-Status: GOOD ( 14.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use new drm_bridge_connector_mode_valid() helper if there is a HDMI bridge in the bridge chain. This removes the need to perform TMDS char rate check manually in the bridge driver. 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/drm/display/drm_bridge_connector.c index 320c297008aaa8b6ef5b1f4c71928849b202e8ac..512ced87ea18c74e182a558a686ddd83de891814 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /** @@ -299,9 +300,22 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector) return 0; } +static enum drm_mode_status +drm_bridge_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + + if (bridge_connector->bridge_hdmi) + return drm_hdmi_connector_mode_valid(connector, mode); + + return MODE_OK; +} + static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, - /* No need for .mode_valid(), the bridges are checked by the core. */ + .mode_valid = drm_bridge_connector_mode_valid, .enable_hpd = drm_bridge_connector_enable_hpd, .disable_hpd = drm_bridge_connector_disable_hpd, }; From patchwork Sat Nov 30 01:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8BB0ED735E4 for ; Sat, 30 Nov 2024 02:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+hHECBYEofE1LVFfISufmiOFENr43Xg+pptUAkUKUyA=; b=TbAPUxNW4wLaghKsW9NWfczCuh g3/I62hnVmqo3mWrJnozMCHFxwefQI9s+IyxCmD0i3OoIy4TgDZELPn/EA+cUj/Kn7xjx8JOXNy/8 oChTYEJZe7HhcU/EuaysvPgbTnvDWtemBgqgd/R2n0th+ci4QmLBeHItrxtNSCl9dJsJAAL/mPzj3 9oMhh9pYCQnCh63MkpzPE5udd9C3Tpv+L5sLN8zK5KKsuaI8doWD+R59LUgRoeK3oxKyJqrQ1qre0 xh0buCiuoZcxy8PAr8v5rL5d1rKo4vZ/dFt0/zDX+YS9TUusVul9Hfkirxy5Cz2E3QlsX80UEUNWa 0EoKsRYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCnc-00000001Hvz-0OrQ; Sat, 30 Nov 2024 02:01:32 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfJ-00000001GXd-0xGZ for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:52:58 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-53de035ea13so2446680e87.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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+hHECBYEofE1LVFfISufmiOFENr43Xg+pptUAkUKUyA=; b=vZVfJZkXN0ueZNrClIC1SCRdoh08Oo71gouW43dRyrvhpzoIlitjPyzAGOiZ/kueTk AWZxAyigIB8pGv7DUJiheb+UEpluSutOHH45pSXqzAmnyeS6RtXNGJOveTZzwEm3neyN 1ZsVGnrxdoszO3JUhW5mlaGMb9RMN5Ajtu+WXYm8tY/IQuFSQOblEIzlW0a4BWHCzset RGV42rvYM5RCu9sfkIPXqGXseE0CHgA+NYq4cUp0nVZsS+fTqNqx2OlbG1IPtg0o35uF I3Fs0+ez0y5pFKO4i3NFDM1EVvbWiVwAUar+OYeQsPLttU4NdhFzxLVehuMUfIijTzQt WoJw== 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=lxwbRtObBkxpi28ZCGbvoaML6jtXttA0cTGa0Po5k1THgdTFuQL0tJ27GVQnKJ1l4k oL/eOjZG9ILaFBNzg4QElf9YU5kgATX9ta/j2ULDE8pc6IWmZzBSneSrJlYrr6iiKQtc w73rB7vSq9Ml+98O2G8hnsz0GKmqAK5MVqgjTQJqKLgEUeTxGM5Dlg/Menpbd48acOs9 SvDgQ8UAu1VZga0lyRf5rTyvy/crtlX0DTvR0xhwDxAP2yrBaIl5gJfcmUBUsUl//HGP H1xqnjeFr1oxkFPQQ72JY4UJ2BLb8ccluGrvQ2elwB8LTYk3vJ40mXBwf0dHtoUx20T/ flCQ== X-Forwarded-Encrypted: i=1; AJvYcCVjdVZdKBvDt83pIkEZStMr3tFCLk5GkAaCKcYhTBlvjq83g1YD2upffQFZStpGcdWkvt4kw0gftg2TWwtxurpy@lists.infradead.org X-Gm-Message-State: AOJu0YzLXppDeyncpNgCjHAS9Sil9v6MvrlKCMyr0VkK9VOQo46X5JDX KoAqljO2PzyFpM2AVZpsxguTZeC0kMhs6ZC7Aq4dvwoBz+wLopF/fx9MuS8rsFY= X-Gm-Gg: ASbGncsrJbn7cS4GNU0SMGLh4gRcnohb76KqqqSNK1RRTjljnJkWD74z/EqB+t643xn n7CIBwXgzQ8z/CQ4omJfkruEMhgnY6mPP/1lFAoyKhmVK3AT62JhSNMX2d8Q+b3TZH7mp12+XK8 SMCyZLcLczjylj8IGWGwoQoV3AQ0GgCZKflpZJl2JeO3mjc2k67Vl73Spr0nFcKRSXcci94EQzd OWsIbXuTBntyCboVZKmDveytj77RDhqtPw31Pq7egjtyPlTSVw8Pk9Kcg== 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175257_265004_FB2D9F08 X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Drop manual check of the TMDS char rate in the mode_valid callback. This check is now being performed by the core. 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/bridge/lontium-lt9611.c index 8f25b338a8d8f95dc0691735ac6343675098f7f7..1ffbe473e4103dfc315a8cd3571e9407bf518797 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -757,7 +757,6 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) { struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - unsigned long long rate; if (mode->hdisplay > 3840) return MODE_BAD_HVALUE; @@ -765,8 +764,7 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, if (mode->hdisplay > 2000 && !lt9611->dsi1_node) return MODE_PANEL; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); - return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, rate); + return MODE_OK; } static int lt9611_bridge_atomic_check(struct drm_bridge *bridge, From patchwork Sat Nov 30 01:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6625D735E4 for ; Sat, 30 Nov 2024 02:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n9wxCYXwjuFpbEm8J6hnlc7LqgHEUz/bPD6SI90IVR0=; b=deZjkiQB6XxWI0U5OTmJTg9YLt AI81XK3T/b7discEZ/ZTgZzuVNZqWaJnRXpiE8q3kbRq/7HCgifJKpIhQEIt40LBxzW6YFG+65MQa OexfeDCmoaJHE6bjt8q95IgydUe7S7fou7l0q325WFCVhGYQYP0K+gcQK7NvAlypoCHECqzAs0c/4 10XjbNoZpSJFfRp1uZ6gZJ+b5reNLSwwT6c+iD2DRYz4k6w05u88zYNsZtaBWqaP+VlZrAwddJjeK Dig44APqi5+PcobyAhMxt31+1CD211IpJISiY3abcj1zYKmemPA4i9ShknBReQX/dy6R/lFlub5We 7VAY+AYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCoY-00000001I2d-2wp4; Sat, 30 Nov 2024 02:02:30 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfL-00000001GYl-14NV for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:53:00 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53de771c5ebso2831951e87.2 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n9wxCYXwjuFpbEm8J6hnlc7LqgHEUz/bPD6SI90IVR0=; b=CsBlJiNpH6T2HCmJdJWImxCJiHChHw4pnplGYw0sxfhmM5HdGk0aXNodUBBsgBIZZR pZ67Uoj9WFhnDxJ6GzrZ5YSLDXUWPt3yiDvzsUS9Jc5sz1zJdLB5VSKkv+k9jt86WQ6w Ws3gfnHTDf3iczVGB4vcKbWCgLvCuLZNsxQcWtDkvfNX4kaudCGB7WsrUyFP4NOeNORC qczy8DHmCAlxdgeWtZM013pn0YS5sDqSvhb9cbUaQQy8nuT2Hv+YJGSFr7bHkylif1dg fCmLlXc+nHjk00UUOxtTjnr/ZoDxsjJzSx/syKCoNvSS406jxwN/eZEch1rALRXch8lr h8sw== 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=ES1ZakwDg/A2svpzixBpC/rQgRFV05O+xwkf2JR/M190F5tcbiPXfcbZOBPlOPH0fY Q+z2KLR6HeDU/az6T6+GyL/4hZ0uG4y9vJvdBHvDQW/aLYZQhA+MRdrRDBvznn+oTlUv q4eybI18tWbjwB535hMMyVjc0yN7TBnoBrT0Q69JUlyVgFq/O39nXVVYHRIziBQMcNLq VOKViXHpYENdmb/9uCQbxMpEIby6XwobtVLN7fBiF5j9j1+XX/PfZYYo8E+n11fjlF6K isuI6kEJCz4hM6kK/1p4mA0tlIt1VZj1B01yXCeUdW5O8ez7pOohIBI53dS/qYvwrQ66 HrMQ== X-Forwarded-Encrypted: i=1; AJvYcCUj/C6VH/JUG9x9p5KTitr050hc/q6hB43oK77zctZx1mAS9xkskv0JaHj6LLcxtyH5KAL6WsrY8DipBGKSgHol@lists.infradead.org X-Gm-Message-State: AOJu0Yw/RwN4u/Y5wZWIAXg8bIkbh6oGXPYLYoChnd0b0BieloSAkGpq qbA6bUwsa5KK7XYqC97MyN3N0q/qlND9YEhUNyEYOvxTY8CCP/UjmkVcR43FXt4= X-Gm-Gg: ASbGncsKe7ENRYRD/lqf5TT1J3FoswNENwAf7rz1ctBUinQpSNXIUFxb3rxKpU1pCTT whUTraejOganx9xWLX0N2tenPxFgMybrdnkXXDZRsEJz56gsyUBA8Dq0mIW++2fJYUKm0YbITSZ JCdvsyGYaR4gX3VewT9wjjyrp3md6gmiQuAvF6rRRfoziSaCuVDF3YP2UkUah2cnY3Qjvg+uEWJ zXLZxS4vtk4punRhPOC1JROYAopJUI0mv/VcsiP/lL54t7UmlK2b3oGGQ== 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 MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175259_301997_ED70D344 X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace .mode_valid() callback with .hdmi_tmds_char_rate_valid(). It is more generic and is used in other mode validation paths. The rate validation for .mode_valid() will be performed by the drm_bridge_connector code. 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..c686671e4850a1af75b82995185ffc3cbb22a447 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -442,16 +442,14 @@ dw_hdmi_qp_bridge_edid_read(struct drm_bridge *bridge, } static enum drm_mode_status -dw_hdmi_qp_bridge_mode_valid(struct drm_bridge *bridge, - const struct drm_display_info *info, - const struct drm_display_mode *mode) +dw_hdmi_qp_bridge_tmds_char_rate_valid(const struct drm_bridge *bridge, + const struct drm_display_mode *mode, + unsigned long long rate) { struct dw_hdmi_qp *hdmi = bridge->driver_private; - unsigned long long rate; - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); if (rate > HDMI14_MAX_TMDSCLK) { - dev_dbg(hdmi->dev, "Unsupported mode clock: %d\n", mode->clock); + dev_dbg(hdmi->dev, "Unsupported TMDS char rate: %lld\n", rate); return MODE_CLOCK_HIGH; } @@ -510,7 +508,7 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { .atomic_disable = dw_hdmi_qp_bridge_atomic_disable, .detect = dw_hdmi_qp_bridge_detect, .edid_read = dw_hdmi_qp_bridge_edid_read, - .mode_valid = dw_hdmi_qp_bridge_mode_valid, + .hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid, .hdmi_clear_infoframe = dw_hdmi_qp_bridge_clear_infoframe, .hdmi_write_infoframe = dw_hdmi_qp_bridge_write_infoframe, }; From patchwork Sat Nov 30 01:52:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA24AD735EA for ; Sat, 30 Nov 2024 02:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z1lXYCxrn128DpMjUx/X3ynnQZTeAwK/ttm0jSS1k6c=; b=JmyjcdgTfCMV/w96FqbtTAcDs4 aFdXZ4BT+1a+o7HA2HI/E+MUIpc1nDbGa5u3OIPPJ/5sPQq/vWjiY3n1DMBRCH0AMFo0IF48fvk5q 0SE3t4LinmOK63vHwcO5ZPSFxd0/hYbOK1QJLc8KQjwbsGhkztJCnEVg6bEElX9BLaSurayQBl+md sL7rjltdaozDnOG66CPnlq4lqpNppwnqGyzbyYWUP0dVJ//Ag8LfJaKrizw5PjPn/Bvhjbf8flqYM eiUEw92yjbzHGL5uj7NSNwC0S7jkOJtTz3WCfBahfd2ile0hEsE0cpazTFdn/Cqcm63HtYskDKogT +Qqp24QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHCpV-00000001IA5-1DHi; Sat, 30 Nov 2024 02:03:29 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHCfN-00000001Ga3-2miW for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 01:53:02 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-53df7f6a133so2580689e87.3 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=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=z1lXYCxrn128DpMjUx/X3ynnQZTeAwK/ttm0jSS1k6c=; b=bxz9ijLUqviKdsKGsMTYT/x7LvqFIa3M6Jifcl4wgpWIyWDK9EPbQDsu6DFXyOkLVg N0XHI0GMStNf+6zhheMarmRYgThLBvWXKZQXZhOS9xoQDTHVrUcsJQh/go6KtP/nbtbK gwr3DwcRQdtLNQsocVv3BQnWnltsxZOxz4L/MjArtTRCeHKjzf22I8y42nJf+L/bIKtb IrVTvULWg085IqhXZExJzdtC/SmSrm2FvPE5DP22Xmh8rCjYafMdkXsfv346tiS4ttfD B1zXci/qZLz0o1rSea3xD2FLBIFlnbAgOOwhPYBrpty/08xSS8BEc3wizfans8ZJi6r6 rCxw== 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=Lt1pH/tbpnhZ8eSGyKbE3ApaRfVrKRdrQvhNWKPpyRcB/Pfafp+WbsONMR6K6W08Y6 oMdYj4qz/1Oj+jPMXAjM5IkU5OY76E0D8TWkpRynMz+M+3b31LfmjC6bzHF1qVfxyIj1 GeCzvJxfoYrztmEzaTgVK/8YV5aMCKNuf7om55ElDo4RBFEgy+XPzoQ45AOsSsjNBs8j i6+oEPQFcp5Tl0oHz7WV2eHqWlRkGdVQWb9PI5HYNouc5tYksmbqUQT8n6eAHDfwI07R nPRJvdSLJmSRM/gannDLfYNqcVkfjZmNWEvc8sBwAfXq+IqMilVCKQblT3OamgdTAl/p NWbQ== X-Forwarded-Encrypted: i=1; AJvYcCWRqpyCrZzybd7tk3bnht53eXrnisjXJufiNwNzgDugAhGJblIgJcf5JvTtQdxA8MY5Ip+sTKJ6/kYGV3oOOm4s@lists.infradead.org X-Gm-Message-State: AOJu0Yx0WU4fIIHkQVRuedCQKqx5Aw2kfISgKaCxMFlz67fo7VYhZejZ jNCwbBVsuLGPJB7uegp4lIF584zHnhaMiz7KB7g9e1BwdRwq4kVfl9wBmk+LK5o= X-Gm-Gg: ASbGnctcEXpogYGFrzCCqIpmQPcW49iIw0nAsYa91m1IevQ+zkrXBEua2guZcrn0EC+ HxJtZ8xiiQdvKaobJElNsO0uwB61/NYQ/I92WBW1WW0qmVB4w4B7QuSbDE2UBwj6BnzbTlpK7NG cSnPC3YQm/HeNbWRgwC+0ErvzCBq7BqbcYDu1vWO0VdCU4dfH5i51FvzqwoninYWK5QhRjl6HA9 lpA+rquCgMKBszfuGSSY3PV84aIAvunPKuDrIMd85bRRpQ2pLqJLvg3ZQ== 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() MIME-Version: 1.0 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_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241129_175301_703745_95D888C8 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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..b05fd77870b00aac97d003f3fb9c2b98cb73abc0 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_connector *connector, return MODE_NOCLOCK; } -static int sun4i_hdmi_connector_atomic_check(struct drm_connector *connector, - struct drm_atomic_state *state) -{ - struct drm_connector_state *conn_state = - drm_atomic_get_new_connector_state(state, connector); - struct drm_crtc *crtc = conn_state->crtc; - struct drm_crtc_state *crtc_state = crtc->state; - struct drm_display_mode *mode = &crtc_state->adjusted_mode; - enum drm_mode_status status; - - status = sun4i_hdmi_connector_clock_valid(connector, mode, - conn_state->hdmi.tmds_char_rate); - if (status != MODE_OK) - return -EINVAL; - - return 0; -} - static int sun4i_hdmi_get_modes(struct drm_connector *connector) { struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector); @@ -258,7 +240,7 @@ static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = { }; static const struct drm_connector_helper_funcs sun4i_hdmi_connector_helper_funcs = { - .atomic_check = sun4i_hdmi_connector_atomic_check, + .atomic_check = drm_atomic_helper_connector_hdmi_check, .mode_valid = drm_hdmi_connector_mode_valid, .get_modes = sun4i_hdmi_get_modes, };