[PATCH 18/20] drm: do not call drm_connector_property_set_value from drivers

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 1 02:38:36 PST 2012


If a property has changed successfully the core will call
drm_connector_property_set_value, so do not duplicate this
call in the drivers.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c |    4 ----
 drivers/gpu/drm/gma500/cdv_intel_lvds.c |   23 ++++++-----------------
 drivers/gpu/drm/gma500/psb_intel_lvds.c |   25 +++++++------------------
 drivers/gpu/drm/gma500/psb_intel_sdvo.c |    5 -----
 drivers/gpu/drm/i915/intel_dp.c         |    5 -----
 drivers/gpu/drm/i915/intel_hdmi.c       |    5 -----
 drivers/gpu/drm/i915/intel_sdvo.c       |    5 -----
 drivers/gpu/drm/i915/intel_tv.c         |    4 ----
 8 files changed, 13 insertions(+), 63 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index de25560..87b7bd6 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -195,10 +195,6 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
 		if (curValue == value)
 			return 0;
 
-		if (drm_connector_property_set_value(connector,
-							property, value))
-			return -1;
-
 		centre = (curValue == DRM_MODE_SCALE_NO_SCALE) ||
 			(value == DRM_MODE_SCALE_NO_SCALE);
 
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 7569e8e..aeb9624 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -471,11 +471,6 @@ int cdv_intel_lvds_set_property(struct drm_connector *connector,
 			return -1;
 		}
 
-		if (drm_connector_property_set_value(connector,
-							property,
-							value))
-			return -1;
-
 		if (crtc->saved_mode.hdisplay != 0 &&
 		    crtc->saved_mode.vdisplay != 0) {
 			if (!drm_crtc_helper_set_mode(encoder->crtc,
@@ -486,20 +481,14 @@ int cdv_intel_lvds_set_property(struct drm_connector *connector,
 				return -1;
 		}
 	} else if (!strcmp(property->name, "backlight") && encoder) {
-		if (drm_connector_property_set_value(connector,
-							property,
-							value))
-			return -1;
-		else {
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
-			struct drm_psb_private *dev_priv =
-						encoder->dev->dev_private;
-			struct backlight_device *bd =
-						dev_priv->backlight_device;
-			bd->props.brightness = value;
-			backlight_update_status(bd);
+		struct drm_psb_private *dev_priv =
+					encoder->dev->dev_private;
+		struct backlight_device *bd =
+					dev_priv->backlight_device;
+		bd->props.brightness = value;
+		backlight_update_status(bd);
 #endif
-		}
 	} else if (!strcmp(property->name, "DPMS") && encoder) {
 		struct drm_encoder_helper_funcs *helpers =
 					encoder->helper_private;
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index 7c9498ea..112d48a 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -601,11 +601,6 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 			goto set_prop_error;
 		}
 
-		if (drm_connector_property_set_value(connector,
-							property,
-							value))
-			goto set_prop_error;
-
 		if (crtc->saved_mode.hdisplay != 0 &&
 		    crtc->saved_mode.vdisplay != 0) {
 			if (!drm_crtc_helper_set_mode(encoder->crtc,
@@ -616,21 +611,15 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 				goto set_prop_error;
 		}
 	} else if (!strcmp(property->name, "backlight")) {
-		if (drm_connector_property_set_value(connector,
-							property,
-							value))
-			goto set_prop_error;
-		else {
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
-			struct drm_psb_private *devp =
-						encoder->dev->dev_private;
-			struct backlight_device *bd = devp->backlight_device;
-			if (bd) {
-				bd->props.brightness = value;
-				backlight_update_status(bd);
-			}
-#endif
+		struct drm_psb_private *devp =
+					encoder->dev->dev_private;
+		struct backlight_device *bd = devp->backlight_device;
+		if (bd) {
+			bd->props.brightness = value;
+			backlight_update_status(bd);
 		}
+#endif
 	} else if (!strcmp(property->name, "DPMS")) {
 		struct drm_encoder_helper_funcs *hfuncs
 						= encoder->helper_private;
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index b9c6da9..4396be8 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -1703,11 +1703,6 @@ psb_intel_sdvo_set_property(struct drm_connector *connector,
 	struct drm_psb_private *dev_priv = connector->dev->dev_private;
 	uint16_t temp_value;
 	uint8_t cmd;
-	int ret;
-
-	ret = drm_connector_property_set_value(connector, property, val);
-	if (ret)
-		return ret;
 
 	if (property == dev_priv->force_audio_property) {
 		int i = val;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 0024b59..32fba41 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2213,11 +2213,6 @@ intel_dp_set_property(struct drm_connector *connector,
 {
 	struct drm_i915_private *dev_priv = connector->dev->dev_private;
 	struct intel_dp *intel_dp = intel_attached_dp(connector);
-	int ret;
-
-	ret = drm_connector_property_set_value(connector, property, val);
-	if (ret)
-		return ret;
 
 	if (property == dev_priv->force_audio_property) {
 		int i = val;
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 64541f7..8218be5 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -395,11 +395,6 @@ intel_hdmi_set_property(struct drm_connector *connector,
 {
 	struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
 	struct drm_i915_private *dev_priv = connector->dev->dev_private;
-	int ret;
-
-	ret = drm_connector_property_set_value(connector, property, val);
-	if (ret)
-		return ret;
 
 	if (property == dev_priv->force_audio_property) {
 		int i = val;
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 24d9e62..7f4e758 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1669,11 +1669,6 @@ intel_sdvo_set_property(struct drm_connector *connector,
 	struct drm_i915_private *dev_priv = connector->dev->dev_private;
 	uint16_t temp_value;
 	uint8_t cmd;
-	int ret;
-
-	ret = drm_connector_property_set_value(connector, property, val);
-	if (ret)
-		return ret;
 
 	if (property == dev_priv->force_audio_property) {
 		int i = val;
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 6eb11fe..5d074f5 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1381,10 +1381,6 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
 	struct drm_crtc *crtc = intel_tv->base.base.crtc;
 	int ret = 0;
 
-	ret = drm_connector_property_set_value(connector, property, val);
-	if (ret < 0)
-		goto out;
-
 	if (property == dev->mode_config.tv_left_margin_property) {
 		intel_tv->margin[TV_MARGIN_LEFT] = val;
 	} else if (property == dev->mode_config.tv_right_margin_property) {
-- 
1.7.8.3



More information about the dri-devel mailing list