aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-05-01 15:37:56 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-05-30 10:32:31 +0200
commit8b45330ad30193a6e4925ae4d36565fb817533fc (patch)
tree20031be394df5d718faec8e424c20a75bb45ef45 /drivers/gpu/drm/i915/intel_lvds.c
parentdrm/i915: Use atomic scaling_mode instead of panel.fitting_mode (diff)
downloadlinux-dev-8b45330ad30193a6e4925ae4d36565fb817533fc.tar.xz
linux-dev-8b45330ad30193a6e4925ae4d36565fb817533fc.zip
drm/i915: Use per-connector scaling mode property
None of the intel connectors can use all types of scaling modes, so only try the ones that are possible. This is another preparation for connectors towards conversion to atomic. 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-5-maarten.lankhorst@linux.intel.com [mlankhorst: Use renamed drm_connector_attach_scaling_mode_property function]
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index a14bdefdcb8f..3bcd9695ef2e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -602,16 +602,10 @@ static int intel_lvds_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
- struct drm_device *dev = connector->dev;
- if (property == dev->mode_config.scaling_mode_property) {
+ if (property == connector->scaling_mode_property) {
struct drm_crtc *crtc;
- if (value == DRM_MODE_SCALE_NONE) {
- DRM_DEBUG_KMS("no scaling not supported\n");
- return -EINVAL;
- }
-
if (connector->state->scaling_mode == value) {
/* the LVDS scaling property is not changed */
return 0;
@@ -987,6 +981,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
u32 lvds;
int pipe;
u8 pin;
+ u32 allowed_scalers;
if (!intel_lvds_supported(dev_priv))
return;
@@ -1082,10 +1077,10 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
lvds_encoder->reg = lvds_reg;
/* create the scaling mode property */
- drm_mode_create_scaling_mode_property(dev);
- drm_object_attach_property(&connector->base,
- dev->mode_config.scaling_mode_property,
- DRM_MODE_SCALE_ASPECT);
+ allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT);
+ allowed_scalers |= BIT(DRM_MODE_SCALE_FULLSCREEN);
+ allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER);
+ drm_connector_attach_scaling_mode_property(connector, allowed_scalers);
connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT;
intel_lvds_pps_get_hw_state(dev_priv, &lvds_encoder->init_pps);