goto done;
}
- if (is_edp(intel_dp) &&
- property == connector->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(dev_priv) &&
- val == DRM_MODE_SCALE_CENTER) {
- DRM_DEBUG_KMS("centering not supported\n");
- return -EINVAL;
- }
-
+ if (property == connector->scaling_mode_property) {
if (connector->state->scaling_mode == val) {
/* the eDP scaling property is not changed */
return 0;
static void
intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
{
+ struct drm_i915_private *dev_priv = to_i915(connector->dev);
+
intel_attach_force_audio_property(connector);
intel_attach_broadcast_rgb_property(connector);
intel_dp->color_range_auto = true;
if (is_edp(intel_dp)) {
- drm_mode_create_scaling_mode_property(connector->dev);
- drm_object_attach_property(
- &connector->base,
- connector->dev->mode_config.scaling_mode_property,
- DRM_MODE_SCALE_ASPECT);
+ u32 allowed_scalers;
+
+ allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN);
+ if (!HAS_GMCH_DISPLAY(dev_priv))
+ allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER);
+
+ drm_connector_attach_scaling_mode_property(connector, allowed_scalers);
+
connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT;
+
}
}
struct drm_property *property,
uint64_t val)
{
- struct drm_device *dev = connector->dev;
struct drm_crtc *crtc;
int ret;
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 (property == connector->scaling_mode_property) {
if (connector->state->scaling_mode == val)
return 0;
static void intel_dsi_add_properties(struct intel_connector *connector)
{
- struct drm_device *dev = connector->base.dev;
+ struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
if (connector->panel.fixed_mode) {
- drm_mode_create_scaling_mode_property(dev);
- drm_object_attach_property(&connector->base.base,
- dev->mode_config.scaling_mode_property,
- DRM_MODE_SCALE_ASPECT);
+ u32 allowed_scalers;
+
+ allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN);
+ if (!HAS_GMCH_DISPLAY(dev_priv))
+ allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER);
+
+ drm_connector_attach_scaling_mode_property(&connector->base,
+ allowed_scalers);
+
connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
}
}
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;
u32 lvds;
int pipe;
u8 pin;
+ u32 allowed_scalers;
if (!intel_lvds_supported(dev_priv))
return;
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);