Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/i915/gen9: Initialize intel_state->active_crtcs during WM" failed to apply to 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 9, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.7-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From f4750a46a0dee58f7a65b438b28a092669b609aa Mon Sep 17 00:00:00 2001

From: Matt Roper <[email protected]>
Date: Fri, 17 Jun 2016 13:42:18 -0700
Subject: [PATCH] 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)

drivers/gpu/drm/i915/intel_pm.c +16 -1
index d5deb58a2128..e9763a89f3d7 100644
@@ -3912,9 +3912,24 @@ skl_compute_ddb(struct drm_atomic_state *state)
 	 * pretend that all pipes switched active status so that we'll
 	 * ensure a full DDB recompute.
 	 */
-	if (dev_priv->wm.distrust_bios_wm)
+	if (dev_priv->wm.distrust_bios_wm) {
+		ret = drm_modeset_lock(&dev->mode_config.connection_mutex,
+				       state->acquire_ctx);
+		if (ret)
+			return ret;
+
 		intel_state->active_pipe_changes = ~0;
 
+		/*
+		 * We usually only initialize intel_state->active_crtcs if we
+		 * we're doing a modeset; make sure this field is always
+		 * initialized during the sanitization process that happens
+		 * on the first commit too.
+		 */
+		if (!intel_state->modeset)
+			intel_state->active_crtcs = dev_priv->active_crtcs;
+	}
+
 	/*
 	 * If the modeset changes which CRTC's are active, we need to
 	 * recompute the DDB allocation for *all* active pipes, even