From patchwork Tue Feb 24 10:58:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 397 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DDBB378D7F; Tue, 24 Feb 2026 10:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771930760; cv=none; b=k1xGmX4Aw3cI6kz4pOpIMUyVobFbNqdyCeNocdqugej/0OTZ4hSTFVSvGi8aY5zziUPuYIbabDFHdVZd7fd8P3C/x6T0Pi0GZ55tc83sggNb4qwseYxl/EopA1KMfRWWH4dTze2JLCbBOR7dbgTpQtJUQ1DIcvZVVqqeA39aGxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771930760; c=relaxed/simple; bh=I0hmUfyS8pL5282T3n2iSaHNb/rjMZSspVg5wsBkC8M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bodKcl4Al6W0Hb2MXuJDaDnS3KUNkTlv5xHEy82YTeuU3kHfaD6Py4taizifkPSaJz+j3ozR2TVgeDRCfBBTVWNE242zEX6dyH+b50PcIIiJ7tEwelRQi7mjY90NfqeBak4FXPWTXGMwkakQA/U3U8AG/6vi5QX4XjWR/LW/8U4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wt6ZMFI6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wt6ZMFI6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6956BC19422; Tue, 24 Feb 2026 10:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771930760; bh=I0hmUfyS8pL5282T3n2iSaHNb/rjMZSspVg5wsBkC8M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Wt6ZMFI6mDkHUpUSP75m/Lz3CQSWWkCoDta4pU6VcXszIlEGUusPrXf4fXdZ/sOQX L/LCA15qOiT3LxGOWMFN3VRE/pwN8xAYZnw1wdL6PshHCG/VZTAwfaH83hzjG/xdl7 cESki5DHk4h5MPo84L3j3fByfdgMQ1HOiabOinGTJIAGKEetBWS/T0W6UCJfE1iEmk lO3n7zZmthEST6QhtFYE/P+TbbADgdEyLGZPRly4540pHScvXrGnile+9r/5ufE2y6 gcVT33wrwQb7Bxp977Xqa1ahCxkjTGEIh5IuHIjPfu/uLq3pvH0Ol5ynf1bKcsvx1h FSkwCsQqbPnxQ== From: Maxime Ripard Date: Tue, 24 Feb 2026 11:58:48 +0100 Subject: [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: Convert to drm_output_color_format Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260224-drm-rework-color-formats-v1-9-bebc76604ada@kernel.org> References: <20260224-drm-rework-color-formats-v1-0-bebc76604ada@kernel.org> In-Reply-To: <20260224-drm-rework-color-formats-v1-0-bebc76604ada@kernel.org> To: Nicolas Frattaroli , Jani Nikula , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Andy Yan , Liviu Dudau , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Liu Ying , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3464; i=mripard@kernel.org; h=from:subject:message-id; bh=I0hmUfyS8pL5282T3n2iSaHNb/rjMZSspVg5wsBkC8M=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDJlzW9K2vJqhdG0/4/J7fbqXW99X5+76bWHqzrQxsK3zo d4i2y05HVNZGIQ5GWTFFFmeyISdXt6+uMrBfuUPmDmsTCBDGLg4BWAinMsZ62O/HupdV6BuN/1H ybIDDPUuO/mV89Z4Bsz+emmC727bVXtbT31zDmjmnvg1M1KEcddPX8b64gsPc3LOryvsaTnV8/C e44nEnznufZ9ZxSOv8TGe2PZu7p6PR964RevOzNhwek64U8FZAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Status: O Now that we introduced a new drm_output_color_format enum to represent what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new enum. The main different is that while DRM_COLOR_FORMAT_ was a bitmask, drm_output_color_format is a proper enum. However, the enum was done is such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so the transitition is easier. The only thing we need to consider is if the original code meant to use that value as a bitmask, in which case we do need to keep the bit shift, or as a discriminant in which case we don't. Signed-off-by: Maxime Ripard Reviewed-by: Philipp Zabel --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index ee88c0e793b0416d20105a43448cb4037402e64b..0296e110ce65ffc284e120f4e3f92052474e83e5 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2662,11 +2662,11 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, struct drm_connector *conn = conn_state->connector; struct drm_display_info *info = &conn->display_info; struct drm_display_mode *mode = &crtc_state->mode; u8 max_bpc = conn_state->max_requested_bpc; bool is_hdmi2_sink = info->hdmi.scdc.supported || - (info->color_formats & DRM_COLOR_FORMAT_YCBCR420); + (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); u32 *output_fmts; unsigned int i = 0; *num_output_fmts = 0; @@ -2721,40 +2721,40 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, /* Default 8bit RGB fallback */ output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24; if (max_bpc >= 16 && info->bpc == 16) { - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48; output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48; } if (max_bpc >= 12 && info->bpc >= 12) { - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24; - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36; output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36; } if (max_bpc >= 10 && info->bpc >= 10) { - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20; - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30; output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30; } - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16; - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24; *num_output_fmts = i; return output_fmts;