From patchwork Fri Oct 18 20:34:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842367 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 748EAD3F29E for ; Fri, 18 Oct 2024 20:42:11 +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: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sCcPwV47XH0yJdbksS/rJtyE3ZkZ9IgFn3oQZBYAYBs=; b=LeL8Uejne19xXQ aqCdwRKpCeclCzzxjAoHFnX3DllQJssFm5hMiP4dk6ejH5ej+bhRpvqWWHWXQ3fwPy/AXAB4U0+Ga ZHD8IVwoBtGiBckHcno+0A3cA6dacWvvYSBViEtxN36lhJKtpQat6zQseXZ03/dKuS4iAStyLl5v4 OXtEYODgFihXzg3bJz7L5Q8goGqOn3E+Ls5uP8pj2P9RZ8qK3EGkW2KEoyEFDB3aYJjmTan5P7y7h epfYn6mMPudPTRuXLxYan+5t2iS8dTi2/D/tKZ392A9GGFfVdmTKmD+BJeJdDgRRoOrFGQf391eCI +o8AJEMZHZuWgcHief/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1tnL-00000001zAS-1gcM; Fri, 18 Oct 2024 20:41:59 +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 1t1tg9-00000001xbV-3cj1 for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 20:34:35 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-539f7606199so3019717e87.0 for ; Fri, 18 Oct 2024 13:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729283672; x=1729888472; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=sCcPwV47XH0yJdbksS/rJtyE3ZkZ9IgFn3oQZBYAYBs=; b=iwf32tp4wSr28zO1cyRTFVLN4Qe9FbJJ6uuLRfXyHEEQjcB8LwKNClzs2qMZowalvR 8QC5PyCXzvaDMkEatuooX5xn6AjZ4Txo5AdjUEG3QU2wC0TfOYuxtbdGEd/VZB3d7Iaj xuw7UxHmUB8UOS87e0i9yTntH8MOSOr5Xqj6mSVTE7mKWKiKqPeapJ8ssLgZkdNg3xrr XiW0w0OxwVfhiZQZ0es50NsL8807CjFHJpUbzt2odvd11s5ILc9UBDxxP9IPJsA7XI9Z URL9moQqG97JciGX5gZaRe3y7JRX7S2cPe44pKSzSiPplPczB1NIPY8peg/jMpSTwPhx 9YZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729283672; x=1729888472; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sCcPwV47XH0yJdbksS/rJtyE3ZkZ9IgFn3oQZBYAYBs=; b=dTPUWeViRIZdSVYWfnrJwJaoReYTOVmK2i6NHWZdq882wwhIUq5yRr3SeOptTkiadj mt+bEroCEp/L3LH467UF2DlbAViiHWC2uXhTaZ6Ajvk8nzHVY7p80QpB3ONaEt7mpBjw mfkGMxKR7xPq0mzcAU7dvSu1QMB5LD19OG8A03Iy/aaZDsE0ZRpv7LRSrT23hYmgSk4U aee0OUAbtQK+3V0WudNcsRpqlQTq0sfkjW8yeutkglRxuqRbDg3PBRrwQVMEOF38Mhcq //UFM3+NThQ5YUUGqdYjz6p60gIb1hxmMiK4stVJHQWixNVyJdCMW2a819EpZrNA46iy yOPQ== X-Forwarded-Encrypted: i=1; AJvYcCWRm5s1k/IJ9HukxJPFKPM4X2VHTfbBDP3Ow7hBepwuzE93AZUAqNA2gL+pT7A3EH9iAHUhzXIWQ4Zy7JrPSbCQ@lists.infradead.org X-Gm-Message-State: AOJu0YxFPeMdCmC+Ch539Mb2aSKQqwnLJNdorHOyS3mPn1lG7uAewiED xU7gXNDkyLU/fOqmZwbyk8k3iqbNzjDHHExnOdECKslALXN/Ws89FGekk218d7Q= X-Google-Smtp-Source: AGHT+IELPtenzGW4LLaGWUAYzBlOsnHcuhLHJ49lUB7TfHK/mvIGRg0GSftC9WVPQgye44/HgrcATg== X-Received: by 2002:a05:6512:1387:b0:539:d428:fbf2 with SMTP id 2adb3069b0e04-53a152170ccmr2519278e87.13.1729283672001; Fri, 18 Oct 2024 13:34:32 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0e09sm314047e87.146.2024.10.18.13.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 13:34:31 -0700 (PDT) From: Dmitry Baryshkov Subject: [PATCH 0/6] drm/display: hdmi: add drm_hdmi_connector_mode_valid() Date: Fri, 18 Oct 2024 23:34:18 +0300 Message-Id: <20241018-hdmi-mode-valid-v1-0-6e49ae4801f7@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAErGEmcC/x3MQQqAIBBA0avErBtQMZCuEi1EpxxIDQUJwrsnL d/i/xcqFaYK6/RCocaVcxqQ8wQu2HQSsh8GJZSWQhoMPjLG7AmbvdijteS0VmYR0sGo7kIHP/9 x23v/AGP7nrlhAAAA To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1527; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=NVgLRwt8YngxLk2l766d34PGqOxCoja034TmXCo3gEs=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEsZWTzWWmG5oZnAvNyyF1pWnZXCGdwJa35Rle GgQVwoA06yJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLGVgAKCRCLPIo+Aiko 1YBNB/9soM6Y9tnx5H+1z9yVAqXzFA2tjpHv/OUSQ/QJrgTGwHmMNVvs8UGD+b5nNxwZIi06/eG mlCQ67VnWcoy9ujIYfTcMYLozAEAZ01tgSB9DR7HObujc/XwiC+X8gWLQdPxV4FJ9tNHy/KCzr7 dujoIoUyiNpD4N5o+67DuTbxTptGAwxhyYT5pP9qVNFXGom7P2bmDPQzaWzVV6tyhcKI1tVTy3b liBsVRSceDQf4G/OX/tYWsOxp4ZogmNzFLtny0b0eMGaWJkGgLLn4AnwgMP/LuJTbA4wfa5X1bt ZfojiYFL+0Hgx2XNPRHTvRLcpebRRnTE6IML2YkVsDihRZan X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_133433_940751_FB112E4E X-CRM114-Status: GOOD ( 10.03 ) 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 Several HDMI drivers have common code pice in the .mode_valid function that validates RGB / 8bpc rate using the TMDS char rate callbacks. Move this code piece to the common helper and remove the need to perform this check manually. In case of DRM_BRIDGE_OP_HDMI bridges the check can be dropped in favour of performing it in drm_bridge_connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Chen-Yu Tsai --- Dmitry Baryshkov (6): drm/display: hdmi: add generic mode_valid helper drm/sun4i: use drm_hdmi_connector_mode_valid() drm/vc4: use drm_hdmi_connector_mode_valid() drm/display: bridge_connector: use drm_bridge_connector_mode_valid() drm/bridge: lontium-lt9611: drop TMDS char rate check in mode_valid drm/bridge: dw-hdmi-qp: replace mode_valid with tmds_char_rate drivers/gpu/drm/bridge/lontium-lt9611.c | 4 +--- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 12 +++++------- drivers/gpu/drm/display/drm_bridge_connector.c | 16 +++++++++++++++- drivers/gpu/drm/display/drm_hdmi_helper.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 12 +----------- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +--- include/drm/display/drm_hdmi_helper.h | 4 ++++ 7 files changed, 52 insertions(+), 25 deletions(-) --- base-commit: af44b5b5776cc6ac1891393a37b1424509f07b35 change-id: 20241018-hdmi-mode-valid-aaec4428501c Best regards,