Skip to content

Commit

Permalink
drm/i915: Use atomic scaling_mode instead of panel.fitting_mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
mlankhorst committed May 30, 2017
1 parent d819731 commit eead06d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
13 changes: 5 additions & 8 deletions drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
}

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 5 additions & 6 deletions drivers/gpu/drm/i915/intel_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down
11 changes: 5 additions & 6 deletions drivers/gpu/drm/i915/intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit eead06d

Please sign in to comment.