diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2016-06-17 16:42:18 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-08-22 09:04:09 -0400 |
commit | f4750a46a0dee58f7a65b438b28a092669b609aa (patch) | |
tree | 65e1d26554a1ddaf3bc03e5039d2bb8e01da4f31 | |
parent | fa8410b355251fd30341662a40ac6b22d3e38468 (diff) |
drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization (v2)
intel_state->active_crtcs is usually only initialized when doing a
modeset. During our first atomic commit after boot, we're effectively
faking a modeset to sanitize the DDB/wm setup, so ensure that this field
gets initialized before use.
v2:
- Don't clobber active_crtcs if our first commit really is a modeset
(Maarten)
- Grab connection_mutex when faking a modeset during sanitization
(Maarten)
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466196140-16336-2-git-send-email-matthew.d.roper@intel.com
Cc: stable@vger.kernel.org #v4.7+
(cherry picked from commit 1b54a880b250acc226b13cea221b90aa1b3e37dd)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d5deb58a2128..e9763a89f3d7 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -3912,9 +3912,24 @@ skl_compute_ddb(struct drm_atomic_state *state) | |||
3912 | * pretend that all pipes switched active status so that we'll | 3912 | * pretend that all pipes switched active status so that we'll |
3913 | * ensure a full DDB recompute. | 3913 | * ensure a full DDB recompute. |
3914 | */ | 3914 | */ |
3915 | if (dev_priv->wm.distrust_bios_wm) | 3915 | if (dev_priv->wm.distrust_bios_wm) { |
3916 | ret = drm_modeset_lock(&dev->mode_config.connection_mutex, | ||
3917 | state->acquire_ctx); | ||
3918 | if (ret) | ||
3919 | return ret; | ||
3920 | |||
3916 | intel_state->active_pipe_changes = ~0; | 3921 | intel_state->active_pipe_changes = ~0; |
3917 | 3922 | ||
3923 | /* | ||
3924 | * We usually only initialize intel_state->active_crtcs if we | ||
3925 | * we're doing a modeset; make sure this field is always | ||
3926 | * initialized during the sanitization process that happens | ||
3927 | * on the first commit too. | ||
3928 | */ | ||
3929 | if (!intel_state->modeset) | ||
3930 | intel_state->active_crtcs = dev_priv->active_crtcs; | ||
3931 | } | ||
3932 | |||
3918 | /* | 3933 | /* |
3919 | * If the modeset changes which CRTC's are active, we need to | 3934 | * If the modeset changes which CRTC's are active, we need to |
3920 | * recompute the DDB allocation for *all* active pipes, even | 3935 | * recompute the DDB allocation for *all* active pipes, even |