From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v4 4/9] drm/i915: Convert LVDS connector properties to atomic.
Date: Wed, 12 Apr 2017 12:50:02 +0200 [thread overview]
Message-ID: <1491994207-25965-5-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1491994207-25965-1-git-send-email-maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 56 +++++++++++----------------------------
1 file changed, 15 insertions(+), 41 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 919d84290774..39d983d9b702 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -401,6 +401,7 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
&lvds_encoder->attached_connector->base;
struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc);
+
unsigned int lvds_bpp;
/* Should never happen!! */
@@ -433,10 +434,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);
}
@@ -598,56 +599,24 @@ static void intel_lvds_destroy(struct drm_connector *connector)
kfree(connector);
}
-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) {
- struct drm_crtc *crtc;
-
- if (value == DRM_MODE_SCALE_NONE) {
- DRM_DEBUG_KMS("no scaling not supported\n");
- return -EINVAL;
- }
-
- if (intel_connector->panel.fitting_mode == value) {
- /* the LVDS scaling property is not changed */
- return 0;
- }
- intel_connector->panel.fitting_mode = value;
-
- crtc = intel_attached_encoder(connector)->base.crtc;
- if (crtc && crtc->state->enable) {
- /*
- * If the CRTC is enabled, the display will be changed
- * according to the new panel fitting mode.
- */
- intel_crtc_restore_mode(crtc);
- }
- }
-
- return 0;
-}
-
static const struct drm_connector_helper_funcs intel_lvds_connector_helper_funcs = {
.get_modes = intel_lvds_get_modes,
.mode_valid = intel_lvds_mode_valid,
+ .atomic_check = intel_digital_connector_atomic_check,
};
static const struct drm_connector_funcs intel_lvds_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = intel_lvds_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
- .set_property = intel_lvds_set_property,
- .atomic_get_property = intel_connector_atomic_get_property,
+ .set_property = drm_atomic_helper_connector_set_property,
+ .atomic_get_property = intel_digital_connector_atomic_get_property,
+ .atomic_set_property = intel_digital_connector_atomic_set_property,
.late_register = intel_connector_register,
.early_unregister = intel_connector_unregister,
.destroy = intel_lvds_destroy,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
- .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+ .atomic_duplicate_state = intel_digital_connector_duplicate_state,
};
static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
@@ -988,6 +957,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
u32 lvds;
int pipe;
u8 pin;
+ unsigned allowed_fittings;
if (!intel_lvds_supported(dev_priv))
return;
@@ -1087,7 +1057,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;
@@ -1181,7 +1151,11 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
out:
mutex_unlock(&dev->mode_config.mutex);
- intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode, 0);
+ allowed_fittings = BIT(DRM_MODE_SCALE_CENTER);
+ allowed_fittings |= BIT(DRM_MODE_SCALE_ASPECT);
+ allowed_fittings |= BIT(DRM_MODE_SCALE_FULLSCREEN);
+
+ intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode, allowed_fittings);
intel_panel_setup_backlight(connector, INVALID_PIPE);
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-04-12 10:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 10:49 [PATCH v4 0/9] drm/i915: Convert connector properties to atomic Maarten Lankhorst
2017-04-12 10:49 ` [PATCH v4 1/9] drm/atomic: Handle aspect ratio and scaling mode in core Maarten Lankhorst
2017-04-13 9:15 ` [PATCH v4.1 01/9] drm/atomic: Handle aspect ratio and scaling mode in core, v2 Maarten Lankhorst
2017-04-19 15:43 ` Daniel Vetter
2017-04-24 12:01 ` Maarten Lankhorst
2017-05-02 8:12 ` Daniel Vetter
2017-05-02 8:17 ` Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 2/9] drm/i915: Add plumbing for digital connector state, v2 Maarten Lankhorst
2017-04-19 15:48 ` Daniel Vetter
2017-04-20 6:11 ` Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 3/9] drm/i915: Convert DSI connector properties to atomic Maarten Lankhorst
2017-04-12 10:50 ` Maarten Lankhorst [this message]
2017-04-12 10:50 ` [PATCH v4 5/9] drm/i915: Make intel_dp->has_audio reflect hw state only Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 6/9] drm/i915: Convert intel_dp properties to atomic Maarten Lankhorst
2017-04-19 15:53 ` Daniel Vetter
2017-04-20 8:28 ` Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 7/9] drm/i915: Convert intel_hdmi connector " Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 8/9] drm/i915: Handle force_audio correctly in intel_sdvo Maarten Lankhorst
2017-04-12 10:50 ` [PATCH v4 9/9] drm/i915: Convert intel_sdvo connector properties to atomic Maarten Lankhorst
2017-04-19 15:58 ` Daniel Vetter
2017-04-12 11:13 ` ✓ Fi.CI.BAT: success for drm/i915: Convert connector properties to atomic. (rev4) Patchwork
2017-04-13 9:34 ` ✓ Fi.CI.BAT: success for drm/i915: Convert connector properties to atomic. (rev5) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491994207-25965-5-git-send-email-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox