diff options
author | Jani Nikula <jani.nikula@intel.com> | 2012-10-26 05:03:59 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-26 14:50:57 -0400 |
commit | 4d8915234165fc85873121f228011b93f9e242d7 (patch) | |
tree | ab89cdf1fb07ed0d303743fb7e8654046d4f6334 /drivers/gpu | |
parent | 898076ed2ef648796859e5e86aa102b8f9ed4af1 (diff) |
drm/i915/lvds: move fitting mode from intel_lvds_connector to intel_panel
Prepare for supporting scaling mode configuration also in eDP.
Includes a drive-by-removal of an outdated comment about fitting mode.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 24 |
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 81d20205733d..8839ed52a3e9 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -165,6 +165,7 @@ struct intel_encoder { | |||
165 | 165 | ||
166 | struct intel_panel { | 166 | struct intel_panel { |
167 | struct drm_display_mode *fixed_mode; | 167 | struct drm_display_mode *fixed_mode; |
168 | int fitting_mode; | ||
168 | }; | 169 | }; |
169 | 170 | ||
170 | struct intel_connector { | 171 | struct intel_connector { |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 587ed0f31bda..ffa0051023f4 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -44,7 +44,6 @@ struct intel_lvds_connector { | |||
44 | struct intel_connector base; | 44 | struct intel_connector base; |
45 | 45 | ||
46 | struct notifier_block lid_notifier; | 46 | struct notifier_block lid_notifier; |
47 | int fitting_mode; | ||
48 | }; | 47 | }; |
49 | 48 | ||
50 | struct intel_lvds_encoder { | 49 | struct intel_lvds_encoder { |
@@ -253,8 +252,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
253 | struct drm_device *dev = encoder->dev; | 252 | struct drm_device *dev = encoder->dev; |
254 | struct drm_i915_private *dev_priv = dev->dev_private; | 253 | struct drm_i915_private *dev_priv = dev->dev_private; |
255 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); | 254 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); |
256 | struct intel_lvds_connector *lvds_connector = | 255 | struct intel_connector *intel_connector = |
257 | lvds_encoder->attached_connector; | 256 | &lvds_encoder->attached_connector->base; |
258 | struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc; | 257 | struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc; |
259 | u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0; | 258 | u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0; |
260 | int pipe; | 259 | int pipe; |
@@ -274,11 +273,12 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
274 | * with the panel scaling set up to source from the H/VDisplay | 273 | * with the panel scaling set up to source from the H/VDisplay |
275 | * of the original mode. | 274 | * of the original mode. |
276 | */ | 275 | */ |
277 | intel_fixed_panel_mode(lvds_connector->base.panel.fixed_mode, | 276 | intel_fixed_panel_mode(intel_connector->panel.fixed_mode, |
278 | adjusted_mode); | 277 | adjusted_mode); |
279 | 278 | ||
280 | if (HAS_PCH_SPLIT(dev)) { | 279 | if (HAS_PCH_SPLIT(dev)) { |
281 | intel_pch_panel_fitting(dev, lvds_connector->fitting_mode, | 280 | intel_pch_panel_fitting(dev, |
281 | intel_connector->panel.fitting_mode, | ||
282 | mode, adjusted_mode); | 282 | mode, adjusted_mode); |
283 | return true; | 283 | return true; |
284 | } | 284 | } |
@@ -304,7 +304,7 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
304 | 304 | ||
305 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 305 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
306 | 306 | ||
307 | switch (lvds_connector->fitting_mode) { | 307 | switch (intel_connector->panel.fitting_mode) { |
308 | case DRM_MODE_SCALE_CENTER: | 308 | case DRM_MODE_SCALE_CENTER: |
309 | /* | 309 | /* |
310 | * For centered modes, we have to calculate border widths & | 310 | * For centered modes, we have to calculate border widths & |
@@ -573,7 +573,7 @@ static int intel_lvds_set_property(struct drm_connector *connector, | |||
573 | struct drm_property *property, | 573 | struct drm_property *property, |
574 | uint64_t value) | 574 | uint64_t value) |
575 | { | 575 | { |
576 | struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector); | 576 | struct intel_connector *intel_connector = to_intel_connector(connector); |
577 | struct drm_device *dev = connector->dev; | 577 | struct drm_device *dev = connector->dev; |
578 | 578 | ||
579 | if (property == dev->mode_config.scaling_mode_property) { | 579 | if (property == dev->mode_config.scaling_mode_property) { |
@@ -584,11 +584,11 @@ static int intel_lvds_set_property(struct drm_connector *connector, | |||
584 | return -EINVAL; | 584 | return -EINVAL; |
585 | } | 585 | } |
586 | 586 | ||
587 | if (lvds_connector->fitting_mode == value) { | 587 | if (intel_connector->panel.fitting_mode == value) { |
588 | /* the LVDS scaling property is not changed */ | 588 | /* the LVDS scaling property is not changed */ |
589 | return 0; | 589 | return 0; |
590 | } | 590 | } |
591 | lvds_connector->fitting_mode = value; | 591 | intel_connector->panel.fitting_mode = value; |
592 | 592 | ||
593 | crtc = intel_attached_encoder(connector)->base.crtc; | 593 | crtc = intel_attached_encoder(connector)->base.crtc; |
594 | if (crtc && crtc->enabled) { | 594 | if (crtc && crtc->enabled) { |
@@ -1008,14 +1008,10 @@ bool intel_lvds_init(struct drm_device *dev) | |||
1008 | 1008 | ||
1009 | /* create the scaling mode property */ | 1009 | /* create the scaling mode property */ |
1010 | drm_mode_create_scaling_mode_property(dev); | 1010 | drm_mode_create_scaling_mode_property(dev); |
1011 | /* | ||
1012 | * the initial panel fitting mode will be FULL_SCREEN. | ||
1013 | */ | ||
1014 | |||
1015 | drm_connector_attach_property(&intel_connector->base, | 1011 | drm_connector_attach_property(&intel_connector->base, |
1016 | dev->mode_config.scaling_mode_property, | 1012 | dev->mode_config.scaling_mode_property, |
1017 | DRM_MODE_SCALE_ASPECT); | 1013 | DRM_MODE_SCALE_ASPECT); |
1018 | lvds_connector->fitting_mode = DRM_MODE_SCALE_ASPECT; | 1014 | intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT; |
1019 | /* | 1015 | /* |
1020 | * LVDS discovery: | 1016 | * LVDS discovery: |
1021 | * 1) check for EDID on DDC | 1017 | * 1) check for EDID on DDC |