From patchwork Fri Oct 18 21:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842463 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 488D8D3F2AB for ; Fri, 18 Oct 2024 21:49:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2AB910E9C0; Fri, 18 Oct 2024 21:49:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RoB5vV0b"; dkim-atps=neutral Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D7C910E9BC for ; Fri, 18 Oct 2024 21:49:23 +0000 (UTC) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-539f7606199so3077774e87.0 for ; Fri, 18 Oct 2024 14:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288161; x=1729892961; darn=lists.freedesktop.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=9z8gZhR6xKvHdHJfRz4craU+dxQh5f6YMki2hXyc4YM=; b=RoB5vV0b/Q3cE3KhDFk24kOLKnjzGZPZ1KII+h98ym6qQBnmMH+zHPEAYIN+WPW6Do O2DHri5iR0P0D/rWBDSqoQZVFfjcwqgxsbA3PB+8KBMuu69mP98q5B6tLbr1VZrwxc3R cNZOIJ/uex38Rn+HPfNVDxTfxdhq58B8IMb/PhSQudUUzDInfPxIXxRLSRArQAoqVlH0 ta5q0/WP7zDd8OY0oSw4MQ8eRuVqOFAxdENxXf5ArsR5tBfwHpVHe/UvBJ7FSWJg3aJU 9sL0Ot1Ivi4M5cuvrRRirZY2vCIDoejF5d1qZy+rJHcfZPdT4Fn2vc9FNGvjTvoQ2yIz gqmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288161; x=1729892961; 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=9z8gZhR6xKvHdHJfRz4craU+dxQh5f6YMki2hXyc4YM=; b=W5HGBmmQ1syuGblS5tm1mOV21lV9t7JF21dauEDvgi/DJulUELjtybDuqtsJkazp7G EwD7BBMwrfuM1zNm27C8ayqfyVFcRGavQ7UV3riK0DbJe6f24bo/CG47gXH5juOp8UTv bvETqHFmMCTgLSHozZhTQN0E8jG3rZVJG4IOYSKkj4fz8X6Qgdta65445dxMwX3uEHFu p43YOMfloMgRAWT9Wytfa9rC+c+aGM4ZFv0abagJiU24xwYOZ6RMPTVBGmrDZXq9sV7V prrXi6qvHNpx9hNVpTbXWT2Xf7XYc4vWVUmE6L9DkPRBKRkQhSsYDdiEvW6GaV8Mp+xi VK+A== X-Gm-Message-State: AOJu0YzCuXTUnsADJFbdB49q5Ipx9nwPNtQxnOsOAzR4v2bPZY588dD+ ws58GzusODyop7u0PbcEytMDwrYgXmyu6QJ++u/iEtJJCZ5ooGVKrfu89/j8uUk= X-Google-Smtp-Source: AGHT+IEvBA85x80m9/B/gJoVTav3nM1QjDIWITUKAkImXSQZnUaTDoetNxkyXbVIvGvOnxTTs+hpZQ== X-Received: by 2002:a05:6512:3a8d:b0:536:7362:5923 with SMTP id 2adb3069b0e04-53a1520b285mr2619592e87.1.1729288161371; Fri, 18 Oct 2024 14:49:21 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:21 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:12 +0300 Subject: [PATCH 1/6] drm/display: bridge_connector: handle ycbcr_420_allowed MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-1-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2190; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=XEeB8zSmc5l7zbT8EsjhmWQeibYM5q3N2PhNmNxtKME=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdkI2xvvDyeAfQVDQUi0tdefgLR6vV7buRI tI484ScB1+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1WeWCAClFBFBl2ZmrqDc2fZN2aSCu3RdrzJkvaupwJdyhURATXsaWpT9bGsmOd2MjKTxT0Loq9p C8WpoBOLd6UjVr13L7T8l6Sq3H77uEMREgloAxbbLVaW05xKTeFdS/KSTJr5oABdtTDqZzsxg0a slmypGrkSSKs3m2pJ/DXM/2yZYvIrGD8OmlpV1P5VSrCKXjNvMsek2LHuHrBDKxtfqjjTxMjDIl /ZBvupf/oBQ5XheDg1XSudap4ydX+m2c6+pZUkxgA/53WVDoyKOv5rDrinCM9gnbKDAFnC8Cm6z PiycyIZiFvnah4d49hQ0ije+kgj0w9K8xM9FIx6zlu5k5KN6 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Follow the interlace_allowed example and calculate drm_connector's ycbcr_420_allowed flag as AND of all drm_bridge's ycbcr_420_allowed flags in a chain. This is one of the gaps between several bridge-specific connector implementations and drm_bridge_connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/display/drm_bridge_connector.c | 6 ++++-- include/drm/drm_bridge.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 3da5b8bf8259..320c297008aa 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -397,11 +397,11 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, bridge_connector->encoder = encoder; /* - * TODO: Handle doublescan_allowed, stereo_allowed and - * ycbcr_420_allowed. + * TODO: Handle doublescan_allowed and stereo_allowed. */ connector = &bridge_connector->base; connector->interlace_allowed = true; + connector->ycbcr_420_allowed = true; /* * Initialise connector status handling. First locate the furthest @@ -414,6 +414,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, drm_for_each_bridge_in_chain(encoder, bridge) { if (!bridge->interlace_allowed) connector->interlace_allowed = false; + if (!bridge->ycbcr_420_allowed) + connector->ycbcr_420_allowed = false; if (bridge->ops & DRM_BRIDGE_OP_EDID) bridge_connector->bridge_edid = bridge; diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 75019d16be64..e8d735b7f6a4 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -802,6 +802,11 @@ struct drm_bridge { * modes. */ bool interlace_allowed; + /** + * @ycbcr_420_allowed: Indicate that the bridge can handle YCbCr 420 + * output. + */ + bool ycbcr_420_allowed; /** * @pre_enable_prev_first: The bridge requires that the prev * bridge @pre_enable function is called before its @pre_enable, From patchwork Fri Oct 18 21:49:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842462 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 ACE62D3F2AA for ; Fri, 18 Oct 2024 21:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE51810E9BD; Fri, 18 Oct 2024 21:49:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="F36R66Lu"; dkim-atps=neutral Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED25B10E9BE for ; Fri, 18 Oct 2024 21:49:24 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-53a0c160b94so543940e87.2 for ; Fri, 18 Oct 2024 14:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288163; x=1729892963; darn=lists.freedesktop.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=Go5ATa3ANcllBgMb3i995a+Tn/9iklS8uo3r/4fZl+Y=; b=F36R66LuKG537OMcWvhgMUFYHHNhV6tpLOHDBBorjRfpPHMR6P9eVAN+nzKtODXWTB EjeJ/QRZWfCLriYqgZ+fp/ZAhqc2jq+Gyxo8r3XCd6xWXCYorSpslUfn7oFmOg3VT5Ai WMvmQs7m90ALVouK451Pa4AGCq4s/GyZdzrYrHT74zmt6WFeJYeocmuvi6Ea64oj7gzv UwTqB3K+a2GF6pKOzeM0BRfN7iQiRPS/7/w8RIyhV6LYWrCnv8JJVLNaRJrLqDmqdXTV laW/DpnQ4WluYI0NhWK+d1h+ZQ80EIyrF0VVo71LILFgX6DnJ5p3KLpBI0K/Gt3FhhUh j2gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288163; x=1729892963; 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=Go5ATa3ANcllBgMb3i995a+Tn/9iklS8uo3r/4fZl+Y=; b=RFJ8hg4B6HC2A7nv3CyuKbDXJf5kPUyutwDATXUrY09IbQurxRebEDBrv+AUjWQjk4 WcOYe09F6bh75x9A7pYWMdD/XLMnzr1/hw4v5mgOwvdeGrUVSeLHEEbzeRrbGu540oGd 1Z2ysIhBZf6bLJotbGj+1mF+ludinZFwZLvAiOynl3C+KN269zFowXMHFy/J+CRU6sCG AUSHGuAgPZwTbfXGNnXBDFubihCI8aUkDdDN6vfG+tf4OOyx65yttcYP4aXQsOfTT4as UUu/t2xT/fECeH04y9dgS2fCvw71f5udYhrxUFfC8CVRIP/O08JaqH7wi07XqalWYLzR m/rg== X-Gm-Message-State: AOJu0YxHlr61thoPSrSxdLs/atx3HgnEj7N10Ih2p9rrjSn51Xc+OMfZ WWL4vE5cZYbI9hPh2c7fWPgnYwXfJjb2nDW7RfuLhT3d936EUHnQhT7emH1OQkc= X-Google-Smtp-Source: AGHT+IEo/FMuV8BXcaeTLXW0eKYEblPO9D0Z6JBXczbnQvEt9ytqgCebRe6synIHwL/ExZe7lEvCMQ== X-Received: by 2002:a05:6512:3c9e:b0:536:a695:942c with SMTP id 2adb3069b0e04-53a1520be7dmr2388053e87.7.1729288163023; Fri, 18 Oct 2024 14:49:23 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:21 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:13 +0300 Subject: [PATCH 2/6] drm/atomic: add interlaced and ycbcr_420 flags to connector's state dump MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-2-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1201; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=bRmnoe4tVoeG590rXiMuIqAybo/BJ38wHNkcgqIlmso=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdV58nH3hPAsgrDZ9l/GYMAVX0S0QXyB3Om au9VDJz5tGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1VjhCACxMe6Efsk0jMD+km71rST56+FRiTPqH+ulz1SSX9gFC5ae64pRNdtVSouzjEQta4XWO55 TR8odbc1YUb62bW4jdPyQ6hWGQ+m2pnJ76JcZTNomBlvh9WBURN/nn7j3Izw6QJK3o/hozejaOu VVfbcWJGzREM7vnHQV3i5fpBqIbd31u9+zf4karPkxgVnUj+6FuOCVsmV/Fp1rRJZQKlpiKq0yd MRJFtyJTPKHvXbPGc/wautX5WvPq9TLXrfb8bbaATPxf3th7DP5WbsDfNMSyrfyOjEMsspoQ8Jd YGmInnt4UhpdCGWANP5rPQGdkFDWgZc3Rs/ou8nS5YNF2/Go X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Although the interlace_allowed and ycbcr_420_allowed flags are a part of the struct drm_connector rather than struct drm_connector_state, still include them into state dump in order to ease debugging of the setup issues. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/drm_atomic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 0fc99da93afe..9ea2611770f4 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1132,6 +1132,8 @@ static void drm_atomic_connector_print_state(struct drm_printer *p, drm_printf(p, "connector[%u]: %s\n", connector->base.id, connector->name); drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware); + drm_printf(p, "\tinterlace_allowed=%d\n", connector->interlace_allowed); + drm_printf(p, "\tycbcr_420_allowed=%d\n", connector->ycbcr_420_allowed); drm_printf(p, "\tmax_requested_bpc=%d\n", state->max_requested_bpc); drm_printf(p, "\tcolorspace=%s\n", drm_get_colorspace_name(state->colorspace)); From patchwork Fri Oct 18 21:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842464 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 0E3B7D3F2AA for ; Fri, 18 Oct 2024 21:49:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B17610E9C3; Fri, 18 Oct 2024 21:49:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="A1XjI/J+"; dkim-atps=neutral Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FDDB10E9C1 for ; Fri, 18 Oct 2024 21:49:27 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539d9fffea1so2706771e87.2 for ; Fri, 18 Oct 2024 14:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288165; x=1729892965; darn=lists.freedesktop.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=gaBPMg1AmxsxPM/D5Hee5JcN9a25p5bXN91ymYiIy5c=; b=A1XjI/J+sm+t+aDK1wIoogJ+h+ePemaFdERES5EOks+hmuhaG9j8MdfqjdMkay5dvZ gGf1/xht/ijwvwpyVH08cWlFrQ6ddXo+y9ARqwu4fp3/U8/1EDDA2MrM0ciOWFNBrqZ9 e1Ju0K32wWtXDsAOtjdXzq5Va4DVLsipyJj4yaFH482sghY3Zm/jO/Vdr5Z3wJLfpujA Yk66LNDEzONyzQzEvDFKKgaYkkPahf1b9Kq9BC52EnfhhXSbrd8CO3pxl29DPv7SCANO TPWl65dN7Id0EufipU8DhiyxMrTdhmRRegqbY+S5s2owa8KuvbH0k7roXzOYDpBEIp6P RZaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288165; x=1729892965; 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=gaBPMg1AmxsxPM/D5Hee5JcN9a25p5bXN91ymYiIy5c=; b=na/jb+k/LuuUaYEsU14oSVZxHL0kPZvnkykB4v7KZgpcy8WS5aJC0mAbFbJmNw/i4M AptSwBxyjwr1zGZD5u2HcC0fsM/PVAG7y15uNIGEo5TcMiZBmVNaEC7A7HYQY0wzqIsN WOldCYlRjXJMbh5SWS/BAbmC1Kag16GJiBoMlqKtCvOOSccpKQdZKrR3XQ6O12xhq/P2 n4eKx6rFzKgUBYSeYVvnNg0Q1NpT95qesgmio81rXOEPoZs4qexWGObH8oSeEbPEqycr i2SJT2AINu1hteEqiNWIgdXQWH8QsfwZq6pbOyI4h/MkHvIToi+/M7pECS341Qmfrl7h pDBw== X-Gm-Message-State: AOJu0Yy3DMzivIXOpJVxaAW3AT6TKN+Sz6dzRJ0tjHYUoM93G9bGz6V3 X83rXZK+g0+pb18ZXlLBv8A81HzZ8ju7/1CAkEuxy3yUGYiztRm+iJZj3ABvznM= X-Google-Smtp-Source: AGHT+IEwsp3DJLispc5Uu+bsLkWA9jEEfNgUg2fe0AkZdKhNFZlyKLrQPTa06UtCmputrUq6ijp2uw== X-Received: by 2002:a05:6512:1598:b0:539:f886:31d6 with SMTP id 2adb3069b0e04-53a1520bd09mr2482354e87.2.1729288165534; Fri, 18 Oct 2024 14:49:25 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:24 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:14 +0300 Subject: [PATCH 3/6] drm/bridge: display-connector: allow YCbCr 420 for HDMI and DP MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-3-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1023; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=pZFlU5ikCJDIckLBlIAUq/awzCCp0+P63uSXEOzs+Ls=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7rQ9bvcVYyXhH4v2nbOrW+V56fz/nM6Ra8qGUUzfkmXz NR4wOHRyWjMwsDIxSArpsjiU9AyNWZTctiHHVPrYQaxMoFMYeDiFICJ+Gaz/2LKWimrkK2V+Hly 9qLrbbUCO2cI9V7mf7l3qX6f6v9FgsWWBgt90p1C/+yM65wm/SHu3mEdAWNz/tpN4YYiFU5P1vc 0LNFboKga0HF5U5fM7Oq8he8cZR9Fnt0edGyC6mfnsgcMTi6zmD7rOf7ilxVcwJA4Y4vzC0HHLd MPXdjRzXE74Nnk09ndskoTuzzXxz9uDuWW/r9NneNNSYEmx8q/Byp6Pau1Zh6cd+3RXtHmmmmbc rM3H4qPaGu5djjsyMtNhm3VfVzLRRbaaseJJq1Zx7iN3yRoqYnCtKbvZ4+qvz/wIeGu38/XHoam 8w82aNZNXnNxQqlatk+4mN4BlsZ0H2OThUov9TNsDCoCAQ== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Allow YCbCr 420 output for HDMI and DisplayPort connectors. Other bridges in the chain still might limit YCbCr 420 support on the corresponding connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/display-connector.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index ab8e00baf3f1..aab9ce7be94c 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -270,6 +270,10 @@ static int display_connector_probe(struct platform_device *pdev) /* All the supported connector types support interlaced modes. */ conn->bridge.interlace_allowed = true; + if (type == DRM_MODE_CONNECTOR_HDMIA || + type == DRM_MODE_CONNECTOR_DisplayPort) + conn->bridge.ycbcr_420_allowed = true; + /* Get the optional connector label. */ of_property_read_string(pdev->dev.of_node, "label", &label); From patchwork Fri Oct 18 21:49:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842466 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C4616D3F2AF for ; Fri, 18 Oct 2024 21:49:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8ECB810E9C6; Fri, 18 Oct 2024 21:49:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="w4tKjKmb"; dkim-atps=neutral Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B22B10E9C2 for ; Fri, 18 Oct 2024 21:49:28 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2fb4af0b6beso42937371fa.3 for ; Fri, 18 Oct 2024 14:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288166; x=1729892966; darn=lists.freedesktop.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=++kNX7bNku5QwEW8QyrZ4sh/fBENm2B/D5wgk1dPOsE=; b=w4tKjKmbi6DSVjXKxfoy8WZgbA1GXe2V5s9f6QhL7KjOXjaigk1X+NbxhxVtowsMB0 nd6FozSKL/gTpHOupI1GvJmnCc5zw44rDezMzITa/xQgrQ9A2DL1l2PWRIToZWVONFYS CGBOY7Y+qTygPAyULGBZp+RTjaAkn4YftpmZYXHY8eRFUOR5R6MmTkwZnjGbpnr6xzn+ YXdTOuT6wBz292F7iODyV/BF83tMUL6aZrpJHAQDbqjAhprpd5h9H6Z5FjuLdjswyHF+ SI+652or0UPkHI4rk3JczjxfvSc3V5nYj4t4VgFrFjVxQlR97QYr663QLGuY4vsSqAFP hwUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288166; x=1729892966; 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=++kNX7bNku5QwEW8QyrZ4sh/fBENm2B/D5wgk1dPOsE=; b=mmSAKGBkwFLKszR5w6Dq2iWR/CPM7h3Qi/WSj2BbXE4YiwedikOviY0CFYBBgjOIyY wika+GJbwDFPbgQ4YODuP7xO7leTgfJkCZ5xu+a0oNI9dsyailHvlaJv6VBs5f1KOr/u i2jauwhtfXZA6g8ePfTsbD7I/ZCIkzEx9fv+NVP0/k1cy+0SZZTT8bnyQx2STlbLFZQZ jkT5tcIwl+DPS8LYEjKoNRlnz9TPNOZdGD5NfId0kznzC+4E6rHLSv/tbKJzGWxHu+4f fPnYTYjigmu56+ep0Py8JcIUOkEd06NqzF5ihFqEDNN72B0koytllXNPtuGcbEKoH5FC alqQ== X-Gm-Message-State: AOJu0YzG1caC9LjdX5vGnIDs34cmqEFsWMdCvh0RW987+LXyu4kL2+Dq FaGkqaFfel17yUg6x+9r1Rn4lMpbYfm/dMDbWntc9FNuhaEe0JbCNkIlgI70YCM= X-Google-Smtp-Source: AGHT+IEzY/SRAJiRek65ftXwRIaSZWszQ1TrTKHKVue2XD7qrdxALnnHFoS9HheGc0hNt3zatPurVA== X-Received: by 2002:a05:6512:281e:b0:533:4505:5b2a with SMTP id 2adb3069b0e04-53a15469bc3mr3671477e87.28.1729288166200; Fri, 18 Oct 2024 14:49:26 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:25 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:15 +0300 Subject: [PATCH 4/6] drm/bridge: aux: allow interlaced and YCbCr 420 output MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-4-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1680; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=djZfmDBuxlU0JNDnxFnHNPof6nNMCNv2DHOE5qEfzzs=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdxGkLweJv+OM6qHmNV/IfPe4ih05zIyoU7 kJT9651h3yJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1Z66B/wOA1Y63ge3/9+ec5RRkm09oVvTET8CgLutvJicgnnXJpoD1xFAD9yeSZUxMm1JvpeCwUJ 7/e85Jbgvnv0rT3m0G3RRigczR8IgIBM6sbVOwA3aGTAKEQdERPTHo7uO3ViUrNHtHpLEVA/GhK 1H5b2Qp5xZP+xyI8bQD+sEWK49cJB6eEWw13zLPFj4VhFUtvpnG7Hmo+HbNLaShgegiXRUPxIth thR+rqDuF0nu2rbP+c3NaSwfcICzvALu405PAWooBekJ1qdYR/QzGQrHTvg8QBFwToKKLRi2sC7 5J73pzZSvULsbl0/BUhl5RdsXjYT2zNV6UEcFPLPEOR0pnPV X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As both aux bridges are merely passthrough bridges, mark them as supporting interlaced and YCbCr 420 data. Other bridges in the chain still might limit interlaced and YCbCr 420 data support on the corresponding connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/aux-bridge.c | 4 ++++ drivers/gpu/drm/bridge/aux-hpd-bridge.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/aux-bridge.c b/drivers/gpu/drm/bridge/aux-bridge.c index b29980f95379..e3e95ccec1ae 100644 --- a/drivers/gpu/drm/bridge/aux-bridge.c +++ b/drivers/gpu/drm/bridge/aux-bridge.c @@ -120,6 +120,10 @@ static int drm_aux_bridge_probe(struct auxiliary_device *auxdev, data->bridge.funcs = &drm_aux_bridge_funcs; data->bridge.of_node = data->dev->of_node; + /* passthrough data, allow everything */ + data->bridge.interlace_allowed = true; + data->bridge.ycbcr_420_allowed = true; + return devm_drm_bridge_add(data->dev, &data->bridge); } diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c index 6886db2d9e00..48f297c78ee6 100644 --- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c @@ -180,6 +180,10 @@ static int drm_aux_hpd_bridge_probe(struct auxiliary_device *auxdev, data->bridge.ops = DRM_BRIDGE_OP_HPD; data->bridge.type = id->driver_data; + /* passthrough data, allow everything */ + data->bridge.interlace_allowed = true; + data->bridge.ycbcr_420_allowed = true; + auxiliary_set_drvdata(auxdev, data); return devm_drm_bridge_add(data->dev, &data->bridge); From patchwork Fri Oct 18 21:49:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842465 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4504ED3F2AB for ; Fri, 18 Oct 2024 21:49:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66C8C10E9C5; Fri, 18 Oct 2024 21:49:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QEcosjA6"; dkim-atps=neutral Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D31610E9C3 for ; Fri, 18 Oct 2024 21:49:30 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-539e59dadebso3645600e87.0 for ; Fri, 18 Oct 2024 14:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288169; x=1729892969; darn=lists.freedesktop.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=7DkvTcvtzrj+vI5w26rcakY7Zkomm18gg55vGgQd3cg=; b=QEcosjA6qDi6ZvrmZEV35cZoSuzELtl5xlVzWGsxFPpfU1TA/PScIr10TddkHKnnDs FQjznh4/cBfZSeUW6iWxIXHBin3e922H4mhTzrA4UOUK3Ug5hOARr6s6dmRUtNa8eBDv auQRiMS4Sz3MWXvEbLX3Ca2vfWySGTETF5QZ3lsEM4kMW03E/8+z0qq2KQ9iFIHi2Zor 81otjeVyY2ch+WoT9JzGt1YCvuyaLmlq7hYg7nAODYFD8Gf/glSVsm+rxTNxeVawkoKe r7lslo1zplhlXFpG3DuDk9I3vCg2GM/rGl0bepddDDWJe9o08ekie0/PovfyFW04EAO7 pogg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288169; x=1729892969; 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=7DkvTcvtzrj+vI5w26rcakY7Zkomm18gg55vGgQd3cg=; b=wx3EQhxf1dhfz33HJ6NuqboY/eYmItEljjizAPvpbkijktPQuVAjC0ktGl8xBkx+sW kP+OWb2sALSwj+g1Is4/XLtfTluSv9YMbnRInFIPFVCREuH/2Lzali2YbiivE0kani0m Cl+i4cIKBGtASnMTcwW2Do1vwioLBTkO0uJEWfzfvk8cFGhTKOfS6D6mv1hqce1Hjhff DDnSPNq1FXtbAcrBLsxN1ObjT3v8vEcs+ls3r4TBNqdm0py0p6uKXPo5HpmqeQveQp0F 0tFCfUSOmOoiAt0M9Yn8zv74FxoD6GNowNeYT79EN/KNmlGZO9Lh/07U7h++9ko1bbiJ dCtQ== X-Gm-Message-State: AOJu0YwF0dwyhKBkWjoSs1YCf540oJXCBo1xW6Pkn8gznLDFnXknVJXJ VoGdPogYBQGNJ6GCzybLQxx7iEyo/Hat1OM6Q8rMRqvFPH0m+BoBFhCUFf30qb4= X-Google-Smtp-Source: AGHT+IEdC8loWBskIO3ec47CgiS3ugrBsDjwPbv5xYeMyu2Akw/gZ0odKdi14u5bdzJYJeWuO3Cw1Q== X-Received: by 2002:a05:6512:2396:b0:536:54df:bffa with SMTP id 2adb3069b0e04-53a1544c1e8mr2768234e87.45.1729288168661; Fri, 18 Oct 2024 14:49:28 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:27 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:16 +0300 Subject: [PATCH 5/6] drm/msm/dp: migrate the ycbcr_420_allowed to drm_bridge MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-5-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3851; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=ugTosUslB7wYiUqpHQuS1lhI0s68LhvrkUMBV1pOZG0=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdCMWS3IEeYl04oBE5MQmiiYn7fcPZlBXfM P3seFVF/PuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1YMjB/wMXVy2Q15F0LL8KfsS+vI2vd9tB7X/2igt44qCY9V/YD7aYTGLdxLWdbcDrxQN5u9Mcwh zw1Jv6DFYlV1pFvCsNZUscq3eBivP0SSQWq5ASyu5y3KpXIEb4LIrWQdCuo34zNSNp1O2VqZUXc aYJwBkRlnW3GxmOtYp9V2o4IjKVWglBgHxctzLV0EQQshkTvWjUwSb2YjpNllMgZrQy2BU3cARG 2dxcJfnRCBNhorNeFbjps9ZBZo8NZXiehcXpL/MdalVwzWtwjA9OJjrheMeOKcDpuhRwk2hc/fC YODvL7pzINueMvI4JEybtw/B2labB9J/5nnSUiYnYiJ89NYl X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of forcing the ycbcr_420_allowed flag to be set on the created drm_connector, set it on the drm_bridge instance and allow drm_bridge_connecgtor to propagate it to the drm_connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Reviewed-by: Neil Armstrong Acked-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- drivers/gpu/drm/msm/dp/dp_drm.c | 10 ++++------ drivers/gpu/drm/msm/dp/dp_drm.h | 7 ++++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index e1228fb093ee..0ddd8abca499 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1467,14 +1467,14 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, dp_priv = container_of(dp_display, struct dp_display_private, dp_display); - ret = dp_bridge_init(dp_display, dev, encoder); + ret = dp_bridge_init(dp_display, dev, encoder, yuv_supported); if (ret) { DRM_DEV_ERROR(dev->dev, "failed to create dp bridge: %d\n", ret); return ret; } - dp_display->connector = dp_drm_connector_init(dp_display, encoder, yuv_supported); + dp_display->connector = dp_drm_connector_init(dp_display, encoder); if (IS_ERR(dp_display->connector)) { ret = PTR_ERR(dp_display->connector); DRM_DEV_ERROR(dev->dev, diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 1b9be5bd97f1..7eb1621f9e7f 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -289,7 +289,7 @@ static const struct drm_bridge_funcs edp_bridge_ops = { }; int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, - struct drm_encoder *encoder) + struct drm_encoder *encoder, bool yuv_supported) { int rc; struct msm_dp_bridge *dp_bridge; @@ -304,6 +304,7 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, bridge = &dp_bridge->bridge; bridge->funcs = dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops; bridge->type = dp_display->connector_type; + bridge->ycbcr_420_allowed = yuv_supported; /* * Many ops only make sense for DP. Why? @@ -351,8 +352,8 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, } /* connector initialization */ -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder, - bool yuv_supported) +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, + struct drm_encoder *encoder) { struct drm_connector *connector = NULL; @@ -363,9 +364,6 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr if (!dp_display->is_edp) drm_connector_attach_dp_subconnector_property(connector); - if (yuv_supported) - connector->ycbcr_420_allowed = true; - drm_connector_attach_encoder(connector, encoder); return connector; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_drm.h index 45e57ac25a4d..ae632fcc407c 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.h +++ b/drivers/gpu/drm/msm/dp/dp_drm.h @@ -19,10 +19,11 @@ struct msm_dp_bridge { #define to_dp_bridge(x) container_of((x), struct msm_dp_bridge, bridge) -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder, - bool yuv_supported); +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, + struct drm_encoder *encoder); int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, - struct drm_encoder *encoder); + struct drm_encoder *encoder, + bool yuv_supported); void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, struct drm_bridge_state *old_bridge_state); From patchwork Fri Oct 18 21:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13842467 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 AEA2FD3F2AA for ; Fri, 18 Oct 2024 21:49:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C639810E9C4; Fri, 18 Oct 2024 21:49:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sYcqgWUF"; dkim-atps=neutral Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E07410E9CA for ; Fri, 18 Oct 2024 21:49:32 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-539e4b7409fso2586808e87.0 for ; Fri, 18 Oct 2024 14:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288170; x=1729892970; darn=lists.freedesktop.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=z3JlxuYLRvmuBAe/hXPotObPdIzfa3RGXwRrg41qHxk=; b=sYcqgWUF9QUQo53/+S66Kig5/o281J/V0RSaa/L1RFGjzCujRf0K6EPltBUGYS7dg2 nMYBoxKssztZJELLfTuiE631iRvwTQvhpDrVeK7OOVqBcuRbuPoKFzYYsBHtlFK+K79i KotoE91aRYhLvIr25kp7hubWlBlmPeTj320zPg9lB5JTOMa26hriK+NEUEnMimgcQSQL fiAvOqLAxbIG+Mk/MdwlwWLD7rtUtyLO7N3Mg+R8y6FiyMFrOFd1XuGa2wSlEVs/MMl+ eXOJchZCsPNbvBrPC53iFUvZTk+VahVhyzkBVbDh3UB8ypUqY3j88moiajCyBI2oXtVu 6dWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288170; x=1729892970; 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=z3JlxuYLRvmuBAe/hXPotObPdIzfa3RGXwRrg41qHxk=; b=IFNnivXDW9NtgZEJ6GRQhn4pW4UR6/w0MjFAgSHsCCdijzcwC4tO7Xbcbutf3LtIaY ZH3VP7EdIKaWSfgC+OdkeMDGL0pslDjsoEOa45gMJZrfzBAeswSmW+0msbO562JQTdQ/ wAmcKZK0/QxsoGHPadolnyBBCGBIQwxTApl/3CmgyqUlkwfemYorGZZWoBGwGqJ6jDPH 9sE8FFJG822SGf/AQL6PRhmFueWmB/W0BCuB+7s/ZJu4HeODKxFaWNftqcDgUxyC7X5p wsMPDvRjLlpFCQHVpb3THy2jLy8pJJ5utiYP5K0BK+vcpFFX04Ifm/r0tfm+HhgySyOk aDwA== X-Gm-Message-State: AOJu0YwkBf1rfXfDppCU6Y5gWoQjZYQeYyP5kY4Jbk5E+xF2pSbjbB5O //aeolasvSCXDDvpdhMlYnDmn+QTn9lOi1m33ap2X37qTM5LC4cLzhKriSzmKDk= X-Google-Smtp-Source: AGHT+IHnKKr9DRlmVgrVc32PqUJ1XzjQFynXLr6N7p9iMEp4ytq6PRLtyD5ZxAK9ZZhPA+gqE3INBw== X-Received: by 2002:a05:6512:3f12:b0:53a:41a:69bb with SMTP id 2adb3069b0e04-53a15b995c1mr1118216e87.28.1729288170302; Fri, 18 Oct 2024 14:49:30 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:29 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:17 +0300 Subject: [PATCH 6/6] drm/bridge: dw-hdmi: set bridge's ycbcr_420_allowed flag MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-6-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Alexander Stein X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=956; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=vSGIECGW576rwJsHdegRSgB/e6dJJG1yWk4yZ40815g=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7rQ9Xve2779/pDOty7EYZXSyS8qsUqzJ364anNd+p/J8 axaczmmTkZjFgZGLgZZMUUWn4KWqTGbksM+7JhaDzOIlQlkCgMXpwBMhFmQg6FNq7pWwjTa9/oz WwuPtULRWf7X2PdL+6+8e0tGRqG5R2r53MZrAjmrDb9tnWobqfHvwV3Gjhvqc1+sWT+x861LHd+ ClVqcwj7lJZ8V+eR8VjbqCh4IzX0iXf90n0Ivr3x7ofi3pofPvr6VXbVcKp+l5IJueQa/9oOCD9 /uXLlVfzNo6iaBwwUfrZI02pvOXz+e3v5v+673Idzia9prJ1QXdHxIK66sduHjulG9cU3ylzrLu /N3Wz6ezTMj0s9N6wTjufBcB/uDM28wl4l8ltwl0Jma+Tg03VzAeMLx7BwRhdf8QueFZ90Wu3Ar Pj41i/2RqZC/m+sz/wfVr58X+X18xFzvyvPm6M6g5aHlAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Set the drm_bridge's ycbcr_420_allowed flag if the YCbCr 420 output is supported by the hardware. Cc: Alexander Stein Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 0031f3c54882..996733ed2c00 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3503,6 +3503,9 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->bridge.of_node = pdev->dev.of_node; hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA; + if (hdmi->version >= 0x200a) + hdmi->bridge.ycbcr_420_allowed = plat_data->ycbcr_420_allowed; + memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = dev; pdevinfo.id = PLATFORM_DEVID_AUTO;