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.
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(-)
@@ -319,7 +319,7 @@
void __drm_atomic_helper_connector_hdmi_state_init(struct drm_connector *connector,
struct drm_connector_state *new_conn_state)
{
- 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;
@@ -678,7 +678,7 @@ hdmi_compute_config(const struct drm_connector *connector,
{
unsigned int max_bpc = clamp_t(unsigned int,
conn_state->max_bpc,
- 8, connector->max_bpc);
+ 8, connector->hdmi.funcs->max_bpc);
enum drm_output_color_format fmt;
int ret;
@@ -811,7 +811,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)
@@ -670,8 +670,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);
@@ -2385,11 +2385,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.