[PATCH v1 33/35] drm/connector: Remove TV modes property

Maxime Ripard maxime at cerno.tech
Fri Jul 29 16:35:16 UTC 2022


Now that all the other drivers have been converted to the new style TV mode
property, let's get rid of the old one.

Signed-off-by: Maxime Ripard <maxime at cerno.tech>

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index d7ff6c644c2f..d52e87e8e6aa 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -698,8 +698,6 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 		state->tv.margins.top = val;
 	} else if (property == config->tv_bottom_margin_property) {
 		state->tv.margins.bottom = val;
-	} else if (property == config->tv_mode_property) {
-		state->tv.mode = val;
 	} else if (property == config->tv_norm_property) {
 		state->tv.norm = val;
 	} else if (property == config->tv_brightness_property) {
@@ -810,8 +808,6 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->tv.margins.top;
 	} else if (property == config->tv_bottom_margin_property) {
 		*val = state->tv.margins.bottom;
-	} else if (property == config->tv_mode_property) {
-		*val = state->tv.mode;
 	} else if (property == config->tv_norm_property) {
 		*val = state->tv.norm;
 	} else if (property == config->tv_brightness_property) {
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index d73a68764b6e..5e138159f2de 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1650,9 +1650,7 @@ EXPORT_SYMBOL(drm_mode_create_tv_margin_properties);
  * 0 on success or a negative error code on failure.
  */
 int drm_mode_create_tv_properties(struct drm_device *dev,
-				  unsigned int supported_tv_norms,
-				  unsigned int num_modes,
-				  const char * const modes[])
+				  unsigned int supported_tv_norms)
 {
 	static const struct drm_prop_enum_list tv_norm_values[] = {
 		{ __builtin_ffs(DRM_MODE_TV_NORM_NTSC_443) - 1, "NTSC-443" },
@@ -1722,20 +1720,6 @@ int drm_mode_create_tv_properties(struct drm_device *dev,
 		goto nomem;
 	dev->mode_config.tv_norm_property = tv_norm;
 
-	if (num_modes) {
-		unsigned int i;
-
-		dev->mode_config.tv_mode_property =
-			drm_property_create(dev, DRM_MODE_PROP_ENUM,
-					    "mode", num_modes);
-		if (!dev->mode_config.tv_mode_property)
-			goto nomem;
-
-		for (i = 0; i < num_modes; i++)
-			drm_property_add_enum(dev->mode_config.tv_mode_property,
-					      i, modes[i]);
-	}
-
 	dev->mode_config.tv_brightness_property =
 		drm_property_create_range(dev, 0, "brightness", 0, 100);
 	if (!dev->mode_config.tv_brightness_property)
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index bed52423776e..1d4025663530 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -526,8 +526,7 @@ static int sun4i_tv_bind(struct device *dev, struct device *master,
 
 	ret = drm_mode_create_tv_properties(drm,
 					    DRM_MODE_TV_NORM_NTSC_M |
-					    DRM_MODE_TV_NORM_PAL_B,
-					    0, NULL);
+					    DRM_MODE_TV_NORM_PAL_B);
 	if (ret)
 		goto err_cleanup_connector;
 
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
index 91d343238b0f..2e7e964928b3 100644
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -704,8 +704,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data)
 					    DRM_MODE_TV_NORM_PAL_B |
 					    DRM_MODE_TV_NORM_PAL_M |
 					    DRM_MODE_TV_NORM_PAL_N |
-					    DRM_MODE_TV_NORM_SECAM_B,
-					    0, NULL);
+					    DRM_MODE_TV_NORM_SECAM_B);
 	if (ret)
 		return ret;
 
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 78275e68ff66..e535dca6376e 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -712,7 +712,6 @@ struct drm_tv_connector_state {
 	enum drm_mode_subconnector select_subconnector;
 	enum drm_mode_subconnector subconnector;
 	struct drm_connector_tv_margins margins;
-	unsigned int mode;
 	unsigned int norm;
 	unsigned int brightness;
 	unsigned int contrast;
@@ -1806,9 +1805,7 @@ void drm_connector_attach_dp_subconnector_property(struct drm_connector *connect
 
 int drm_mode_create_tv_margin_properties(struct drm_device *dev);
 int drm_mode_create_tv_properties(struct drm_device *dev,
-				  unsigned int supported_tv_norms,
-				  unsigned int num_modes,
-				  const char * const modes[]);
+				  unsigned int supported_tv_norms);
 void drm_connector_attach_tv_margin_properties(struct drm_connector *conn);
 int drm_mode_create_scaling_mode_property(struct drm_device *dev);
 int drm_connector_attach_content_type_property(struct drm_connector *dev);

-- 
b4 0.10.0-dev-49460


More information about the dri-devel mailing list