[PATCH 6/7] drm/i915: Convert DSI connector properties to atomic.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu Mar 16 10:41:54 UTC 2017


Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 54 +++++++---------------------------------
 1 file changed, 9 insertions(+), 45 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index e787142025ac..0360e9bd4830 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -1588,48 +1588,6 @@ static int intel_dsi_get_modes(struct drm_connector *connector)
 	return 1;
 }
 
-static int intel_dsi_set_property(struct drm_connector *connector,
-				  struct drm_property *property,
-				  uint64_t val)
-{
-	struct drm_device *dev = connector->dev;
-	struct intel_connector *intel_connector = to_intel_connector(connector);
-	struct drm_crtc *crtc;
-	int ret;
-
-	ret = drm_object_property_set_value(&connector->base, property, val);
-	if (ret)
-		return ret;
-
-	if (property == dev->mode_config.scaling_mode_property) {
-		if (val == DRM_MODE_SCALE_NONE) {
-			DRM_DEBUG_KMS("no scaling not supported\n");
-			return -EINVAL;
-		}
-		if (HAS_GMCH_DISPLAY(to_i915(dev)) &&
-		    val == DRM_MODE_SCALE_CENTER) {
-			DRM_DEBUG_KMS("centering not supported\n");
-			return -EINVAL;
-		}
-
-		if (intel_connector->panel.fitting_mode == val)
-			return 0;
-
-		intel_connector->panel.fitting_mode = val;
-	}
-
-	crtc = connector->state->crtc;
-	if (crtc && crtc->state->enable) {
-		/*
-		 * If the CRTC is enabled, the display will be changed
-		 * according to the new panel fitting mode.
-		 */
-		intel_crtc_restore_mode(crtc);
-	}
-
-	return 0;
-}
-
 static void intel_dsi_connector_destroy(struct drm_connector *connector)
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -1666,10 +1624,11 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
 	.early_unregister = intel_connector_unregister,
 	.destroy = intel_dsi_connector_destroy,
 	.fill_modes = drm_helper_probe_single_connector_modes,
-	.set_property = intel_dsi_set_property,
-	.atomic_get_property = intel_connector_atomic_get_property,
+	.set_property = drm_atomic_helper_connector_set_property,
+	.atomic_get_property = intel_digital_connector_atomic_get_property,
+	.atomic_set_property = intel_digital_connector_atomic_set_property,
 	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
-	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_duplicate_state = intel_digital_connector_duplicate_state,
 };
 
 static void intel_dsi_add_properties(struct intel_connector *connector)
@@ -1677,11 +1636,15 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
 	struct drm_device *dev = connector->base.dev;
 
 	if (connector->panel.fixed_mode) {
+		struct intel_digital_connector_state *conn_state =
+			to_intel_digital_connector_state(connector->base.state);
+
 		drm_mode_create_scaling_mode_property(dev);
 		drm_object_attach_property(&connector->base.base,
 					   dev->mode_config.scaling_mode_property,
 					   DRM_MODE_SCALE_ASPECT);
 		connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
+		conn_state->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
 	}
 }
 
@@ -1739,6 +1702,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 	intel_encoder->get_config = intel_dsi_get_config;
 
 	intel_connector->get_hw_state = intel_connector_get_hw_state;
+	intel_connector->swap_state = intel_digital_connector_swap_state;
 
 	intel_encoder->port = port;
 
-- 
2.7.4



More information about the Intel-gfx-trybot mailing list