From patchwork Tue Dec 24 18:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 13920444 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 A9946E77188 for ; Tue, 24 Dec 2024 18:23:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CB8B10E48F; Tue, 24 Dec 2024 18:23:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="bomyqqyl"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id E026310E48F for ; Tue, 24 Dec 2024 18:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1735064577; bh=jAFb17WiglcXqROhm1UFDinGC0D36h9W5e3s5HYPpeU=; h=From:Subject:Date:To:Cc:From; b=bomyqqylwXu0jgN8X2X+LPdWAFDrmd0bWZ+VEGe46pFU0mg+19uZP1I0F30adjUXV of2X0NvzW4E2In13KjE0+7ZMJHdMos87t7sQbjVOQqcGfichDjgxDMgXdOp3KtjJC1 CHdSB6vCLg7PEpXV0xYGvoAqWk107TNO7exyku7xtER7QUjumicPE3rn8FfIQbPhFL CcqxmjcSEq64z5iEere056+kHJgjQSAW2xlxu5xdoXNNhbuMWPKcKh+0Wpl/RWbLs2 wSEJ1kEb2MF3c3ionRXDMWbgfN7F2OVcuYprzUjkd84GyrsYEJx2flGMmkbL2aaC5T 7zcJ4xlcyS/Fw== Received: from localhost (unknown [84.232.140.38]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3594E17E15AD; Tue, 24 Dec 2024 19:22:57 +0100 (CET) From: Cristian Ciocaltea Subject: [PATCH v4 0/4] Fix ycbcr_420_allowed inconsistency for HDMI bridges Date: Tue, 24 Dec 2024 20:22:40 +0200 Message-Id: <20241224-bridge-conn-fmt-prio-v4-0-a9ceb5671379@collabora.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAPD7amcC/4XNQQ6CMBAF0KuQrq3ptNBWV97DuKBDK02AkkKIh nB3CxuNkZhZ/Z/8NzMZbPR2IOdsJtFOfvChSyE/ZATrsrtb6quUCWc8BxCMmuir1GLoOurakfb RB4oFKIScKVsVJE37aJ1/bOz1lnLthzHE5/ZlgrX9A05A0+XSSCkcKCcuGJqmNCGWRwwtWdGJv yHO5A7EE6QL1KAKfjJa/4LEBwRqBxKUUWHRCNQOmXTf0LIsL5AR7fZOAQAA X-Change-ID: 20241130-bridge-conn-fmt-prio-c517c1407ed5 To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dmitry Baryshkov Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 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" Bridges with DRM_BRIDGE_OP_HDMI set in drm_bridge->ops are expected to rely on drm_bridge->supported_formats to advertise the supported colorspaces, including HDMI_COLORSPACE_YUV420. However, when drm_bridge_connector gets initialised, only drm_bridge->ycbcr_420_allowed is considered in the process of adjusting the drm_connector->ycbcr_420_allowed, which effectively discards the formats advertised by the HDMI bridge. This patchset tries to address the issue by prioritizing supported_formats over ycbcr_420_allowed. Signed-off-by: Cristian Ciocaltea --- Changes in v4: - Moved the adjustment of bridge connector's supported_formats to a separate patch (Dmitry) - Collected Dmitry's R-b tag for patch "drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed" - Rebased series onto drm-misc-next-2024-12-19 - Added new patch to extend HDMI connector output format tests (Maxime) - Link to v3: https://lore.kernel.org/r/20241217-bridge-conn-fmt-prio-v3-0-3ecb3c8fc06f@collabora.com Changes in v3: - Simplified the inconsistency handling by overwriting ycbcr_420_allowed for HDMI bridges before adding them to the global bridge list - Added a 2nd patch to check if supported_formats matches ycbcr_420_allowed on HDMI connector initialization (Dmitry) - Link to v2: https://lore.kernel.org/r/20241206-bridge-conn-fmt-prio-v2-1-85c817529b88@collabora.com Changes in v2: - Wrapped HDMI_COLORSPACE_YUV420 flag in the BIT() macro to properly check its presence in supported_formats - Ensured YUV420 gets removed from the bitmask passed to drmm_connector_hdmi_init() when ycbcr_420_allowed is not set - Link to v1: https://lore.kernel.org/r/20241130-bridge-conn-fmt-prio-v1-1-146b663f17f3@collabora.com --- Cristian Ciocaltea (4): drm/bridge: Prioritize supported_formats over ycbcr_420_allowed drm/bridge-connector: Sync supported_formats with computed ycbcr_420_allowed drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed drm/tests: connector: Add ycbcr_420_allowed tests drivers/gpu/drm/display/drm_bridge_connector.c | 8 +++- drivers/gpu/drm/drm_bridge.c | 4 ++ drivers/gpu/drm/drm_connector.c | 3 ++ drivers/gpu/drm/tests/drm_connector_test.c | 60 ++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) --- base-commit: 1e93f594285faef57651a0c89f61a7d976db7def change-id: 20241130-bridge-conn-fmt-prio-c517c1407ed5