public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Don't rely upon encoder->type for infoframe hw state readout
@ 2014-11-20 21:41 Daniel Vetter
  2014-11-23  2:39 ` [PATCH] drm/i915: Don't rely upon encoder->type for shuang.he
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Vetter @ 2014-11-20 21:41 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

encoder->type can change underneath us and doesn't need to reflect
actual hw state (since we don't construct it from hw state like
e.g. encoder->crtc crtc->config).

And this can indeed happen:
1) Boot with plugged-in hdmi screen. Since we only set ->type in the
   probe functions this means we won't detect any infoframes since
   type is still unkown.
2) First probe sets type to HDMI.
3) If the first modeset now does _not_ happen on the HDMI pipe with
   infoframes encoder->get_config suddenly sees infoframes and the
   state checker gets angry.

Fix this by only relying on actual hw state when figuring out whether
the ddi port is in hdmi mode and sends infoframes.

Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Paulo Zanoni <przanoni@gmail.com>
Reported-by: Paulo Zanoni <przanoni@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_ddi.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 24110c96e539..e6b45cd150d3 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2027,6 +2027,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
 	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
 	enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder;
+	struct intel_hdmi *intel_hdmi;
 	u32 temp, flags = 0;
 	struct drm_device *dev = dev_priv->dev;
 
@@ -2062,6 +2063,10 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
 	switch (temp & TRANS_DDI_MODE_SELECT_MASK) {
 	case TRANS_DDI_MODE_SELECT_HDMI:
 		pipe_config->has_hdmi_sink = true;
+		intel_hdmi = enc_to_intel_hdmi(&encoder->base);
+
+		if (intel_hdmi->infoframe_enabled(&encoder->base))
+			pipe_config->has_infoframe = true;
 		break;
 	case TRANS_DDI_MODE_SELECT_DVI:
 	case TRANS_DDI_MODE_SELECT_FDI:
@@ -2075,14 +2080,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
 		break;
 	}
 
-	if (encoder->type == INTEL_OUTPUT_HDMI) {
-		struct intel_hdmi *intel_hdmi =
-			enc_to_intel_hdmi(&encoder->base);
-
-		if (intel_hdmi->infoframe_enabled(&encoder->base))
-			pipe_config->has_infoframe = true;
-	}
-
 	if (intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) {
 		temp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD);
 		if (temp & AUDIO_OUTPUT_ENABLE(intel_crtc->pipe))
-- 
2.1.1

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915: Don't rely upon encoder->type for
  2014-11-20 21:41 [PATCH] drm/i915: Don't rely upon encoder->type for infoframe hw state readout Daniel Vetter
@ 2014-11-23  2:39 ` shuang.he
  0 siblings, 0 replies; 2+ messages in thread
From: shuang.he @ 2014-11-23  2:39 UTC (permalink / raw)
  To: shuang.he, intel-gfx, daniel.vetter

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              367/367              366/367
ILK                 -6              373/375              367/375
SNB                                  450/450              450/450
IVB                 -1              502/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(3, M23)      CRASH(1, M23)
ILK  igt_kms_3d      PASS(2, M37M26)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_bcs-flip-vs-modeset-interruptible      PASS(3, M37M26)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_blocking-absolute-wf_vblank-interruptible      DMESG_WARN(1, M26)PASS(1, M37)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_rcs-flip-vs-panning      NSPT(1, M26)DMESG_WARN(1, M26)PASS(1, M37)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_wf_vblank-ts-check      PASS(3, M37M26)      DMESG_WARN(1, M26)
ILK  igt_kms_flip_wf_vblank-vs-modeset-interruptible      PASS(4, M37M26)      DMESG_WARN(1, M26)
IVB  igt_gem_bad_reloc_negative-reloc-lut      NSPT(3, M21M34M4)PASS(1, M21)      NSPT(2, M4)
HSW  igt_gem_bad_reloc_negative-reloc-lut      NSPT(10, M40M20)PASS(1, M20)      NSPT(1, M40)
HSW  igt_kms_rotation_crc_primary-rotation      PASS(11, M20M40)      DMESG_WARN(1, M40)
HSW  igt_pm_rc6_residency_rc6-accuracy      PASS(11, M20M40)      FAIL(1, M40)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-23  2:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 21:41 [PATCH] drm/i915: Don't rely upon encoder->type for infoframe hw state readout Daniel Vetter
2014-11-23  2:39 ` [PATCH] drm/i915: Don't rely upon encoder->type for shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox