drm/i915: Use atomic scaling_mode instead of panel.fitting_mode
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 1 May 2017 13:37:55 +0000 (15:37 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 30 May 2017 08:28:21 +0000 (10:28 +0200)
The first step in converting connector properties to atomic is
wiring up the atomic state. We're still not completely supoprting
the scaling mode in the atomic case, but this is the first step
towards it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170501133804.8116-4-maarten.lankhorst@linux.intel.com
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_lvds.c

index 4a6feb6..921b9bb 100644 (file)
@@ -1686,10 +1686,10 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
                if (HAS_GMCH_DISPLAY(dev_priv))
                        intel_gmch_panel_fitting(intel_crtc, pipe_config,
-                                                intel_connector->panel.fitting_mode);
+                                                conn_state->scaling_mode);
                else
                        intel_pch_panel_fitting(intel_crtc, pipe_config,
-                                               intel_connector->panel.fitting_mode);
+                                               conn_state->scaling_mode);
        }
 
        if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
@@ -4832,7 +4832,6 @@ intel_dp_set_property(struct drm_connector *connector,
                      uint64_t val)
 {
        struct drm_i915_private *dev_priv = to_i915(connector->dev);
-       struct intel_connector *intel_connector = to_intel_connector(connector);
        struct intel_encoder *intel_encoder = intel_attached_encoder(connector);
        struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
        int ret;
@@ -4901,11 +4900,11 @@ intel_dp_set_property(struct drm_connector *connector,
                        return -EINVAL;
                }
 
-               if (intel_connector->panel.fitting_mode == val) {
+               if (connector->state->scaling_mode == val) {
                        /* the eDP scaling property is not changed */
                        return 0;
                }
-               intel_connector->panel.fitting_mode = val;
+               connector->state->scaling_mode = val;
 
                goto done;
        }
@@ -5183,8 +5182,6 @@ bool intel_dp_is_edp(struct drm_i915_private *dev_priv, enum port port)
 static void
 intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
 {
-       struct intel_connector *intel_connector = to_intel_connector(connector);
-
        intel_attach_force_audio_property(connector);
        intel_attach_broadcast_rgb_property(connector);
        intel_dp->color_range_auto = true;
@@ -5195,7 +5192,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
                        &connector->base,
                        connector->dev->mode_config.scaling_mode_property,
                        DRM_MODE_SCALE_ASPECT);
-               intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
+               connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT;
        }
 }
 
index bd50097..28d30f9 100644 (file)
@@ -266,7 +266,6 @@ struct intel_encoder {
 struct intel_panel {
        struct drm_display_mode *fixed_mode;
        struct drm_display_mode *downclock_mode;
-       int fitting_mode;
 
        /* backlight */
        struct {
index fc0ef49..ec141eb 100644 (file)
@@ -320,10 +320,10 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,
 
                if (HAS_GMCH_DISPLAY(dev_priv))
                        intel_gmch_panel_fitting(crtc, pipe_config,
-                                                intel_connector->panel.fitting_mode);
+                                                conn_state->scaling_mode);
                else
                        intel_pch_panel_fitting(crtc, pipe_config,
-                                               intel_connector->panel.fitting_mode);
+                                               conn_state->scaling_mode);
        }
 
        /* DSI uses short packets for sync events, so clear mode flags for DSI */
@@ -1592,7 +1592,6 @@ static int intel_dsi_set_property(struct drm_connector *connector,
                                  uint64_t val)
 {
        struct drm_device *dev = connector->dev;
-       struct intel_connector *intel_connector = to_intel_connector(connector);
        struct drm_crtc *crtc;
        int ret;
 
@@ -1611,10 +1610,10 @@ static int intel_dsi_set_property(struct drm_connector *connector,
                        return -EINVAL;
                }
 
-               if (intel_connector->panel.fitting_mode == val)
+               if (connector->state->scaling_mode == val)
                        return 0;
 
-               intel_connector->panel.fitting_mode = val;
+               connector->state->scaling_mode = val;
        }
 
        crtc = connector->state->crtc;
@@ -1680,7 +1679,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
                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;
+               connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
        }
 }
 
index 8b942ef..a14bdef 100644 (file)
@@ -433,10 +433,10 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
                pipe_config->has_pch_encoder = true;
 
                intel_pch_panel_fitting(intel_crtc, pipe_config,
-                                       intel_connector->panel.fitting_mode);
+                                       conn_state->scaling_mode);
        } else {
                intel_gmch_panel_fitting(intel_crtc, pipe_config,
-                                        intel_connector->panel.fitting_mode);
+                                        conn_state->scaling_mode);
 
        }
 
@@ -602,7 +602,6 @@ static int intel_lvds_set_property(struct drm_connector *connector,
                                   struct drm_property *property,
                                   uint64_t value)
 {
-       struct intel_connector *intel_connector = to_intel_connector(connector);
        struct drm_device *dev = connector->dev;
 
        if (property == dev->mode_config.scaling_mode_property) {
@@ -613,11 +612,11 @@ static int intel_lvds_set_property(struct drm_connector *connector,
                        return -EINVAL;
                }
 
-               if (intel_connector->panel.fitting_mode == value) {
+               if (connector->state->scaling_mode == value) {
                        /* the LVDS scaling property is not changed */
                        return 0;
                }
-               intel_connector->panel.fitting_mode = value;
+               connector->state->scaling_mode = value;
 
                crtc = intel_attached_encoder(connector)->base.crtc;
                if (crtc && crtc->state->enable) {
@@ -1087,7 +1086,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
        drm_object_attach_property(&connector->base,
                                      dev->mode_config.scaling_mode_property,
                                      DRM_MODE_SCALE_ASPECT);
-       intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
+       connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT;
 
        intel_lvds_pps_get_hw_state(dev_priv, &lvds_encoder->init_pps);
        lvds_encoder->init_lvds_val = lvds;