Skip to contentSkip to conversation

drm/i915: Don't clobber crtc->new_config when nothing changes

PATCH Applied [email protected] 4 participants 4 messages Nov 21, 2014 – Nov 24, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Don't clobber crtc->new_config when nothing changes

From: Ville Syrjälä <[email protected]>

When doing a nop modeset we currently leave crtc->new_config point at the already freed temporary pipe_config. That will anger the sanity checks in intel_modeset_update_state() when the nop modeset gets followed by a GPU reset on gen3/4 where the display block gets fully reinitialized during the reset.

So leave crtc->new_config alone until we know a modeset is actually required.

---
 drivers/gpu/drm/i915/intel_display.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -3
index 853697f..3218455 100644
@@ -10907,7 +10907,6 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
 	}
 	intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
 			       "[modeset]");
-	to_intel_crtc(crtc)->new_config = pipe_config;
 
 out:
 	return pipe_config;
@@ -10933,6 +10932,9 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 
 	*saved_mode = crtc->mode;
 
+	if (modeset_pipes)
+		to_intel_crtc(crtc)->new_config = pipe_config;
+
 	/*
 	 * See if the config requires any additional preparation, e.g.
 	 * to adjust global state with pipes off.  We need to do this
@@ -11466,12 +11468,12 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
 		ret = PTR_ERR(pipe_config);
 		goto fail;
 	} else if (pipe_config) {
-		if (to_intel_crtc(set->crtc)->new_config->has_audio !=
+		if (pipe_config->has_audio !=
 		    to_intel_crtc(set->crtc)->config.has_audio)
 			config->mode_changed = true;
 
 		/* Force mode sets for any infoframe stuff */
-		if (to_intel_crtc(set->crtc)->new_config->has_infoframe ||
+		if (pipe_config->has_infoframe ||
 		    to_intel_crtc(set->crtc)->config.has_infoframe)
 			config->mode_changed = true;
 	}
Signature · 6 lines
2.0.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · On Fri, 21 Nov 2014 21:00:36 +0200 [email protected] wrote:

From: Ville Syrjälä <[email protected]>

When doing a nop modeset we currently leave crtc->new_config point at the already freed temporary pipe_config. That will anger the sanity checks in intel_modeset_update_state() when the nop modeset gets followed by a GPU reset on gen3/4 where the display block gets fully reinitialized during the reset.

So leave crtc->new_config alone until we know a modeset is actually required.

---
 drivers/gpu/drm/i915/intel_display.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -2
index 853697f..3218455 100644
@@ -10907,7 +10907,6 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
 	}
 	intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
 			       "[modeset]");
-	to_intel_crtc(crtc)->new_config = pipe_config;
 
 out:
 	return pipe_config;
@@ -10933,6 +10932,9 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 
 	*saved_mode = crtc->mode;
 
+	if (modeset_pipes)
+		to_intel_crtc(crtc)->new_config = pipe_config;
+
 	/*
 	 * See if the config requires any additional preparation, e.g.
 	 * to adjust global state with pipes off.  We need to do this
@@ -11466,12 +11468,12 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
 		ret = PTR_ERR(pipe_config);
 		goto fail;
 	} else if (pipe_config) {
-		if (to_intel_crtc(set->crtc)->new_config->has_audio !=

drivers/gpu/drm/i915/intel_display.c static int intel_crtc_set_config(struct drm_mode_set *set) · line 11479

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +2 -1
+		if (pipe_config->has_audio !=
 		    to_intel_crtc(set->crtc)->config.has_audio)
 			config->mode_changed = true;
 
 		/* Force mode sets for any infoframe stuff */
-		if (to_intel_crtc(set->crtc)->new_config->has_infoframe ||
+		if (pipe_config->has_infoframe ||
 		    to_intel_crtc(set->crtc)->config.has_infoframe)
 			config->mode_changed = true;
 	}

Yeah looks fine.

Thanks,

Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
In reply to [email protected]
Quoted 8 lines · On Fri, Nov 21, 2014 at 09:00:36PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

When doing a nop modeset we currently leave crtc->new_config point at the already freed temporary pipe_config. That will anger the sanity checks in intel_modeset_update_state() when the nop modeset gets followed by a GPU reset on gen3/4 where the display block gets fully reinitialized during the reset.

Quoted 5 lines

So leave crtc->new_config alone until we know a modeset is actually required.

Queued for -next, thanks for the patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#3 lore raw

Re: [PATCH] drm/i915: Don't clobber crtc->new_config when

In reply to [email protected]

-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                 -1              367/367              366/367
ILK                 -4              375/375              371/375

SNB 450/450 450/450
IVB -2 503/503 501/503
BYT 289/289 289/289
HSW -3 567/567 564/567
BDW 417/417 417/417
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied

PNV  igt_gen3_mixed_blits      PASS(4, M23)      CRASH(1, M23)
ILK  igt_gem_reset_stats_close-pending-fork-render      TIMEOUT(2, M37M26)PASS(1, M26)      TIMEOUT(1, M26)
ILK  igt_kms_flip_nonexisting-fb      PASS(2, M37M26)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_vblank-vs-hang      TIMEOUT(2, M37M26)PASS(1, M26)      TIMEOUT(1, M26)
ILK  igt_kms_flip_wf_vblank-ts-check      PASS(3, M37M26)      DMESG_WARN(1, M26)
IVB  igt_gem_bad_reloc_negative-reloc      NSPT(3, M34M21M4)PASS(1, M21)      NSPT(1, M21)
IVB  igt_gem_bad_reloc_negative-reloc-lut      NSPT(3, M21M34M4)PASS(4, M21M34M4)      NSPT(1, M21)
HSW  igt_gem_bad_reloc_negative-reloc-lut      NSPT(13, M40M20)PASS(1, M20)      NSPT(1, M20)
HSW  igt_kms_rotation_crc_primary-rotation      PASS(14, M20M40)      DMESG_WARN(1, M20)
HSW  igt_pm_rc6_residency_rc6-accuracy      PASS(14, M20M40)      FAIL(1, M20)

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx