diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-05-29 11:06:53 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-11 10:57:36 -0400 |
commit | 3b150f08e5013297729627a222e410284832effe (patch) | |
tree | 7ce618e2e893b2c0b5595826d58fd6662215304b /drivers/gpu | |
parent | 75e2acf24ab5e4bbf6a19b0f5460456ea16a2e5d (diff) |
drm/i915: don't force full modeset if primary plane is disabled (v2)
In a future patch, we'll allow the primary plane to be disabled by
userspace via the universal plane API. If a modeset is requested while
the primary plane is disabled, crtc->primary->fb will be NULL which
generally triggers a full modeset (except in fastboot situations). If
we detect that the crtc is active, but there's no primary plane fb,
we should still allow a simple plane update rather than a full modeset
if the mode isn't actually changing (after re-enabling the primary plane
of course).
v2:
- Enable plane after set_base to avoid enabling the plane if set_base
fails, and to make flip+enable atomic (suggested by Ville)
- Drop BUG to WARN if we somehow enter the 'fb_changed' modeset case
with the crtc disabled (suggested by Ville)
Reviewed-by: Chon Ming Lee <chon.ming.lee@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8635bb7878fe..d99be95276d1 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -10562,12 +10562,17 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set, | |||
10562 | if (is_crtc_connector_off(set)) { | 10562 | if (is_crtc_connector_off(set)) { |
10563 | config->mode_changed = true; | 10563 | config->mode_changed = true; |
10564 | } else if (set->crtc->primary->fb != set->fb) { | 10564 | } else if (set->crtc->primary->fb != set->fb) { |
10565 | /* If we have no fb then treat it as a full mode set */ | 10565 | /* |
10566 | * If we have no fb, we can only flip as long as the crtc is | ||
10567 | * active, otherwise we need a full mode set. The crtc may | ||
10568 | * be active if we've only disabled the primary plane, or | ||
10569 | * in fastboot situations. | ||
10570 | */ | ||
10566 | if (set->crtc->primary->fb == NULL) { | 10571 | if (set->crtc->primary->fb == NULL) { |
10567 | struct intel_crtc *intel_crtc = | 10572 | struct intel_crtc *intel_crtc = |
10568 | to_intel_crtc(set->crtc); | 10573 | to_intel_crtc(set->crtc); |
10569 | 10574 | ||
10570 | if (intel_crtc->active && i915.fastboot) { | 10575 | if (intel_crtc->active) { |
10571 | DRM_DEBUG_KMS("crtc has no fb, will flip\n"); | 10576 | DRM_DEBUG_KMS("crtc has no fb, will flip\n"); |
10572 | config->fb_changed = true; | 10577 | config->fb_changed = true; |
10573 | } else { | 10578 | } else { |
@@ -10805,10 +10810,24 @@ static int intel_crtc_set_config(struct drm_mode_set *set) | |||
10805 | ret = intel_set_mode(set->crtc, set->mode, | 10810 | ret = intel_set_mode(set->crtc, set->mode, |
10806 | set->x, set->y, set->fb); | 10811 | set->x, set->y, set->fb); |
10807 | } else if (config->fb_changed) { | 10812 | } else if (config->fb_changed) { |
10813 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
10814 | struct intel_crtc *intel_crtc = to_intel_crtc(set->crtc); | ||
10815 | |||
10808 | intel_crtc_wait_for_pending_flips(set->crtc); | 10816 | intel_crtc_wait_for_pending_flips(set->crtc); |
10809 | 10817 | ||
10810 | ret = intel_pipe_set_base(set->crtc, | 10818 | ret = intel_pipe_set_base(set->crtc, |
10811 | set->x, set->y, set->fb); | 10819 | set->x, set->y, set->fb); |
10820 | |||
10821 | /* | ||
10822 | * We need to make sure the primary plane is re-enabled if it | ||
10823 | * has previously been turned off. | ||
10824 | */ | ||
10825 | if (!intel_crtc->primary_enabled && ret == 0) { | ||
10826 | WARN_ON(!intel_crtc->active); | ||
10827 | intel_enable_primary_hw_plane(dev_priv, intel_crtc->plane, | ||
10828 | intel_crtc->pipe); | ||
10829 | } | ||
10830 | |||
10812 | /* | 10831 | /* |
10813 | * In the fastboot case this may be our only check of the | 10832 | * In the fastboot case this may be our only check of the |
10814 | * state after boot. It would be better to only do it on | 10833 | * state after boot. It would be better to only do it on |