mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Helge Deller <deller@gmx.de>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 Sam Ravnborg <sam@ravnborg.org>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@gmail.com>,
	 Simona Vetter <simona@ffwll.ch>
Cc: kernel@collabora.com, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Diederik de Haas" <diederik@cknow-tech.com>,
	"Robin Räber" <robin.raebi@gmail.com>,
	"Igor Paunovic" <royalnet026@gmail.com>
Subject: [PATCH v2 10/25] drm/connector: Drop redundant max_bpc field
Date: Wed, 02 Dec 2026 04:20:04 +0200	[thread overview]
Message-ID: <20261202-drm-conn-hdmi-cleanup-v2-10-ba7d32550ea4@collabora.com> (raw)
In-Reply-To: <20261202-drm-conn-hdmi-cleanup-v2-0-ba7d32550ea4@collabora.com>

Now that all users migrated to the new drmm_connector_hdmi_init()
signature, max_bpc is provided through struct drm_connector_hdmi_funcs,
a reference to which is already stored in drm_connector_hdmi.

Drop the redundant connector->max_bpc field and point its users to
hdmi.funcs->max_bpc instead.

Tested-by: Diederik de Haas <diederik@cknow-tech.com>  # NanoPC-T6 LTS, Rock 5B
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Robin Räber <robin.raebi@gmail.com>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 6 +++---
 drivers/gpu/drm/drm_connector.c                 | 2 --
 include/drm/drm_connector.h                     | 5 -----
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index c10cc580d0d4..7889a65f0802 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -320,7 +320,7 @@
 void __drm_atomic_helper_connector_hdmi_state_init(struct drm_connector_state *new_conn_state,
 						   struct drm_connector *connector)
 {
-	unsigned int max_bpc = connector->max_bpc;
+	unsigned int max_bpc = connector->hdmi.funcs ? connector->hdmi.funcs->max_bpc : 0;
 
 	new_conn_state->max_bpc = max_bpc;
 	new_conn_state->max_requested_bpc = max_bpc;
@@ -686,7 +686,7 @@ hdmi_compute_config(const struct drm_connector *connector,
 	}
 
 	max_bpc = clamp_t(unsigned int, conn_state->max_bpc,
-			  8, connector->max_bpc);
+			  8, connector->hdmi.funcs->max_bpc);
 
 	if (conn_state->color_format != DRM_CONNECTOR_COLOR_FORMAT_AUTO) {
 		switch (conn_state->color_format) {
@@ -817,7 +817,7 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
 	if (!connector->hdmi.funcs->hdr_drm.write_infoframe)
 		return 0;
 
-	if (connector->max_bpc < 10)
+	if (connector->hdmi.funcs->max_bpc < 10)
 		return 0;
 
 	if (!conn_state->hdr_output_metadata)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 0cb38d4427e2..3fda52515b33 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -658,8 +658,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
 	}
 
 	drm_connector_attach_max_bpc_property(connector, 8, hdmi_funcs->max_bpc);
-	/* TODO: remove after conversion to new drmm_connector_hdmi_init() */
-	connector->max_bpc = hdmi_funcs->max_bpc;
 
 	if (hdmi_funcs->max_bpc > 8)
 		drm_connector_attach_hdr_output_metadata_property(connector);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index f7a060b728f8..2d4890dc585a 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -2501,11 +2501,6 @@ struct drm_connector {
 	 */
 	struct drm_property_blob *path_blob_ptr;
 
-	/**
-	 * @max_bpc: Maximum bits per color channel the connector supports.
-	 */
-	unsigned int max_bpc;
-
 	/**
 	 * @max_bpc_property: Default connector property for the max bpc to be
 	 * driven out of the connector.

-- 
2.56.0


  parent reply	other threads:[~2026-12-02  2:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  2:19 [PATCH v2 00/25] drm: HDMI connector API cleanup and HDMI 2.0 test coverage Cristian Ciocaltea
2026-12-02  2:19 ` [PATCH v2 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad() Cristian Ciocaltea
2026-12-02  2:19 ` [PATCH v2 02/25] video/hdmi: Define SPD InfoFrame vendor/product field lengths Cristian Ciocaltea
2026-12-02  2:19 ` [PATCH v2 03/25] drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force() Cristian Ciocaltea
2026-12-02  2:19 ` [PATCH v2 04/25] drm/display: hdmi-state-helper: Reject connectors lacking HDMI funcs Cristian Ciocaltea
2026-12-02  2:19 ` [PATCH v2 05/25] drm/tests: connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 06/25] drm/tests: hdmi: " Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 07/25] drm/connector: Remove drmm_connector_hdmi_ini2() Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 08/25] drm/connector: Drop redundant hdmi vendor/product fields Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 09/25] drm/connector: Drop redundant hdmi supported_formats field Cristian Ciocaltea
2026-12-02  2:20 ` Cristian Ciocaltea [this message]
2026-12-02  2:20 ` [PATCH v2 11/25] drm/connector: Use the SPD InfoFrame field length defines Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 12/25] drm/connector: Fix comment in drmm_connector_hdmi_init() Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 13/25] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 14/25] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 15/25] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 16/25] drm/tests: connector: Add HDMI max_tmds_char_rate init coverage Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 17/25] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 18/25] drm/tests: hdmi: Cover mode validation against connector max_tmds_char_rate Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 19/25] drm/tests: hdmi: Verify scrambler_needed computation Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 20/25] drm/tests: hdmi: Add SPD InfoFrame vendor/product coverage Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 21/25] drm/tests: hdmi: Add HDMI 2.0 scrambling helpers coverage Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 22/25] drm/tests: hdmi: Verify SCDC resync on hotplug Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 23/25] drm/tests: bridge: Set supported HDMI version Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 24/25] drm/tests: bridge: Add HDMI 2.0 bridge connector coverage Cristian Ciocaltea
2026-12-02  2:20 ` [PATCH v2 25/25] drm/tests: probe-helper: Add .force_ctx() callback coverage Cristian Ciocaltea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202-drm-conn-hdmi-cleanup-v2-10-ba7d32550ea4@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=airlied@gmail.com \
    --cc=deller@gmx.de \
    --cc=diederik@cknow-tech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robin.raebi@gmail.com \
    --cc=royalnet026@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®