[PATCH v2 05/27] drm/i915: add fastboot checks for has_audio and has_infoframe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The original commit 206645910b97
"drm/i915: check for audio and infoframe changes across mode sets v2"
added checking when has_audio and has_infoframe were changed.

It seems the original commit added both checks for the fastboot case.
By setting crtc_state->mode_changed the code will disable the crtc,
and re-enable it.

This doesn't work on boot, so there we just turn off the crtc.
Later on it should re-enable the crtc anyway, with the correct
settings.

Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@xxxxxxxxx>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++----------------------
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 64c84fb94b4d..65b7e7406c78 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11888,19 +11888,6 @@ encoder_retry:
 	DRM_DEBUG_KMS("plane bpp: %i, pipe bpp: %i, dithering: %i\n",
 		      base_bpp, pipe_config->pipe_bpp, pipe_config->dither);
 
-	/* Check if we need to force a modeset */
-	if (pipe_config->has_audio !=
-	    to_intel_crtc_state(crtc->state)->has_audio) {
-		pipe_config->base.mode_changed = true;
-		ret = drm_atomic_add_affected_planes(state, crtc);
-	}
-
-	/*
-	 * Note we have an issue here with infoframes: current code
-	 * only updates them on the full mode set path per hw
-	 * requirements.  So here we should be checking for any
-	 * required changes and forcing a mode set.
-	 */
 fail:
 	return ret;
 }
@@ -12667,19 +12654,9 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
 		return ret;
 
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
-		if (!crtc_state->enable &&
-		    WARN_ON(crtc_state->active))
-			crtc_state->active = false;
-
-		if (!crtc_state->enable)
+		if (!needs_modeset(crtc_state) || !crtc_state->enable)
 			continue;
 
-		if (!needs_modeset(crtc_state)) {
-			ret = drm_atomic_add_affected_connectors(state, crtc);
-			if (ret)
-				return ret;
-		}
-
 		ret = intel_modeset_pipe_config(crtc,
 					to_intel_crtc_state(crtc_state));
 		if (ret)
@@ -15266,18 +15243,31 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
 		crtc_state->mode_changed =
 		crtc_state->planes_changed = false;
 
-		if (crtc->enabled) {
+		if (crtc->state->enable) {
 			intel_mode_from_pipe_config(&crtc->state->mode,
 				to_intel_crtc_state(crtc->state));
 
 			drm_mode_copy(&crtc->mode, &crtc->state->mode);
 			drm_mode_copy(&crtc->hwmode,
 				      &crtc->state->adjusted_mode);
+
+			/* Check if we need to force a modeset */
+			if (to_intel_crtc_state(crtc_state)->has_audio !=
+			    to_intel_crtc_state(crtc->state)->has_audio)
+				crtc_state->mode_changed = true;
+
+			if (to_intel_crtc_state(crtc_state)->has_infoframe !=
+			    to_intel_crtc_state(crtc->state)->has_infoframe)
+				crtc_state->mode_changed = true;
 		}
 
 		intel_sanitize_crtc(intel_crtc, !force_restore ? NULL :
 				    to_intel_crtc_state(crtc_state));
 
+		/* turn CRTC off if a modeset is requested. */
+		if (crtc_state->mode_changed && !force_restore)
+			intel_crtc_control(crtc, false, true);
+
 		/*
 		 * sanitize_crtc may have forced an update of crtc->state,
 		 * so reload in intel_dump_pipe_config
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux