Skip to contentSkip to conversation

drm/i915: Handle pipe CRC around enabling/disabling pipe.

PATCH New Maarten Lankhorst 2 participants 3 messages Mar 7, 2018

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

PATCH 1/1 drm/i915: Handle pipe CRC around enabling/disabling pipe.

This will get rid of the following error:

[   74.730271] WARNING: CPU: 4 PID: 0 at drivers/gpu/drm/drm_vblank.c:614 drm_calc_vbltimestamp_from_scanoutpos+0x13e/0x2f0
[   74.730311] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic i915 x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel crct10dif_pclmul snd_hda_codec crc32_pclmul snd_hwdep broadcom ghash_clmulni_intel snd_hda_core bcm_phy_lib snd_pcm tg3 lpc_ich mei_me mei prime_numbers
[   74.730353] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G     U           4.16.0-rc2-CI-CI_DRM_3822+ #1
[   74.730355] Hardware name: Dell Inc. XPS 8300  /0Y2MRG, BIOS A06 10/17/2011
[   74.730359] RIP: 0010:drm_calc_vbltimestamp_from_scanoutpos+0x13e/0x2f0
[   74.730361] RSP: 0018:ffff88022fb03d10 EFLAGS: 00010086
[   74.730365] RAX: ffffffffa0291d20 RBX: ffff88021a180000 RCX: 0000000000000001
[   74.730367] RDX: ffffffff820e7db8 RSI: 0000000000000001 RDI: ffffffff82068cea
[   74.730369] RBP: ffff88022fb03d70 R08: 0000000000000000 R09: ffffffff815d26d0
[   74.730371] R10: 0000000000000000 R11: ffffffffa0161ca0 R12: 0000000000000001
[   74.730373] R13: ffff880212448008 R14: ffff880212448330 R15: 0000000000000000
[   74.730376] FS:  0000000000000000(0000) GS:ffff88022fb00000(0000) knlGS:0000000000000000
[   74.730378] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   74.730380] CR2: 000055edcbec9000 CR3: 0000000002210001 CR4: 00000000000606e0
[   74.730382] Call Trace:
[   74.730385]  <IRQ>
[   74.730397]  drm_get_last_vbltimestamp+0x36/0x50
[   74.730401]  drm_update_vblank_count+0x64/0x240
[   74.730409]  drm_crtc_accurate_vblank_count+0x41/0x90
[   74.730453]  display_pipe_crc_irq_handler+0x176/0x220 [i915]
[   74.730497]  i9xx_pipe_crc_irq_handler+0xfe/0x150 [i915]
[   74.730537]  ironlake_irq_handler+0x618/0xa30 [i915]
[   74.730548]  __handle_irq_event_percpu+0x3c/0x340
[   74.730556]  handle_irq_event_percpu+0x1b/0x50
[   74.730561]  handle_irq_event+0x2f/0x50
[   74.730566]  handle_edge_irq+0xe4/0x1b0
[   74.730572]  handle_irq+0x11/0x20
[   74.730576]  do_IRQ+0x5e/0x120
[   74.730584]  common_interrupt+0x84/0x84
[   74.730586]  </IRQ>
[   74.730591] RIP: 0010:cpuidle_enter_state+0xaa/0x350
[   74.730593] RSP: 0018:ffffc9000008beb8 EFLAGS: 00000212 ORIG_RAX: ffffffffffffffde
[   74.730597] RAX: ffff880226b80040 RBX: 000000000031fc3e RCX: 0000000000000001
[   74.730599] RDX: 0000000000000000 RSI: ffffffff8210fb59 RDI: ffffffff820c02e7
[   74.730601] RBP: 0000000000000004 R08: 00000000000040af R09: 0000000000000018
[   74.730603] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004
[   74.730606] R13: ffffe8ffffd00430 R14: 0000001166120bf4 R15: ffffffff82294460
[   74.730621]  ? cpuidle_enter_state+0xa6/0x350
[   74.730629]  do_idle+0x188/0x1d0
[   74.730636]  cpu_startup_entry+0x14/0x20
[   74.730641]  start_secondary+0x129/0x160
[   74.730646]  secondary_startup_64+0xa5/0xb0
[   74.730660] Code: e1 48 c7 c2 b8 7d 0e 82 be 01 00 00 00 48 c7 c7 ea 8c 06 82 e8 64 ec ff ff 48 8b 83 c8 07 00 00 48 83 78 28 00 0f 84 e2 fe ff ff <0f> 0b 45 31 ed e9 db fe ff ff 41 b8 d3 4d 62 10 89 c8 6a 03 41
[   74.730754] ---[ end trace 14b1345705b68565 ]---

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105185

---
 drivers/gpu/drm/i915/intel_display.c  |  2 ++
 drivers/gpu/drm/i915/intel_drv.h      |  3 +++
 drivers/gpu/drm/i915/intel_pipe_crc.c | 30 +++++++++++++++++++++++++++++-
 3 files changed, 34 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 331084082545..67d13fe4c24f 100644
@@ -12147,6 +12147,7 @@ static void intel_update_crtc(struct drm_crtc *crtc,
 	if (modeset) {
 		update_scanline_offset(intel_crtc);
 		dev_priv->display.crtc_enable(pipe_config, state);
+		intel_crtc_enable_pipe_crc(crtc);
 	} else {
 		intel_pre_plane_update(to_intel_crtc_state(old_crtc_state),
 				       pipe_config);
@@ -12327,6 +12328,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
 
 		if (old_crtc_state->active) {
 			intel_crtc_disable_planes(crtc, old_crtc_state->plane_mask);
+			intel_crtc_disable_pipe_crc(crtc);
 			dev_priv->display.crtc_disable(to_intel_crtc_state(old_crtc_state), state);
 			intel_crtc->active = false;
 			intel_fbc_disable(intel_crtc);
drivers/gpu/drm/i915/intel_drv.h +3 -0
index d4368589b355..002429957dd5 100644
@@ -2138,8 +2138,11 @@ int intel_pipe_crc_create(struct drm_minor *minor);
 #ifdef CONFIG_DEBUG_FS
 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
 			      size_t *values_cnt);
+void intel_crtc_disable_pipe_crc(struct drm_crtc *crtc);
+void intel_crtc_enable_pipe_crc(struct drm_crtc *crtc);
 #else
 #define intel_crtc_set_crc_source NULL
+#define intel_crtc_disable_pipe_crc(crtc) do {} while (0)
 #endif
 extern const struct file_operations i915_display_crc_ctl_fops;
 #endif /* __INTEL_DRV_H__ */
drivers/gpu/drm/i915/intel_pipe_crc.c +29 -1
index 1f5cd572a7ff..eca391022edc 100644
@@ -916,7 +916,7 @@ int intel_pipe_crc_create(struct drm_minor *minor)
 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
 			      size_t *values_cnt)
 {
-	struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
 	struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[crtc->index];
 	enum intel_display_power_domain power_domain;
 	enum intel_pipe_crc_source source;
@@ -959,3 +959,31 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
 
 	return ret;
 }
+
+void intel_crtc_enable_pipe_crc(struct drm_crtc *crtc)
+{
+	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+	enum intel_pipe_crc_source source;
+	u32 val = 0;
+
+	if (!crtc->crc.opened)
+		return;
+
+	if (display_crc_ctl_parse_source(crtc->crc.source, &source) < 0)
+		return;
+
+	if (get_new_crc_ctl_reg(dev_priv, crtc->index, &source, &val) < 0)
+		return;
+
+	I915_WRITE(PIPE_CRC_CTL(crtc->index), val);
+	POSTING_READ(PIPE_CRC_CTL(crtc->index));
+}
+
+void intel_crtc_disable_pipe_crc(struct drm_crtc *crtc)
+{
+	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+
+	I915_WRITE(PIPE_CRC_CTL(crtc->index), 0);
+	POSTING_READ(PIPE_CRC_CTL(crtc->index));
+	synchronize_irq(dev_priv->drm.irq);
+}
Signature · 6 lines
2.16.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Handle pipe CRC around enabling/disabling pipe.

== Series Details ==

== Series Details ==

Series: drm/i915: Handle pipe CRC around enabling/disabling pipe.
URL : https://patchwork.freedesktop.org/series/39508/
State : success

== Summary ==

Series 39508v1 drm/i915: Handle pipe CRC around enabling/disabling pipe.
https://patchwork.freedesktop.org/api/1.0/series/39508/revisions/1/mbox/

fi-bdw-5557u failed to collect. IGT log at Patchwork_8256/fi-bdw-5557u/run0.log fi-bdw-gvtdvm failed to collect. IGT log at Patchwork_8256/fi-bdw-gvtdvm/run0.log fi-blb-e6850 failed to collect. IGT log at Patchwork_8256/fi-blb-e6850/run0.log fi-bsw-n3050 failed to collect. IGT log at Patchwork_8256/fi-bsw-n3050/run0.log fi-bwr-2160 failed to collect. IGT log at Patchwork_8256/fi-bwr-2160/run0.log fi-bxt-dsi failed to collect. IGT log at Patchwork_8256/fi-bxt-dsi/run0.log fi-bxt-j4205 failed to collect. IGT log at Patchwork_8256/fi-bxt-j4205/run0.log fi-byt-j1900 failed to collect. IGT log at Patchwork_8256/fi-byt-j1900/run0.log fi-byt-n2820 failed to collect. IGT log at Patchwork_8256/fi-byt-n2820/run0.log fi-cfl-8700k failed to collect. IGT log at Patchwork_8256/fi-cfl-8700k/run0.log fi-cfl-s2 failed to collect. IGT log at Patchwork_8256/fi-cfl-s2/run0.log fi-elk-e7500 failed to collect. IGT log at Patchwork_8256/fi-elk-e7500/run0.log fi-gdg-551 failed to collect. IGT log at Patchwork_8256/fi-gdg-551/run0.log fi-glk-1 failed to collect. IGT log at Patchwork_8256/fi-glk-1/run0.log fi-hsw-4770 failed to collect. IGT log at Patchwork_8256/fi-hsw-4770/run0.log fi-ilk-650 failed to collect. IGT log at Patchwork_8256/fi-ilk-650/run0.log fi-ivb-3520m failed to collect. IGT log at Patchwork_8256/fi-ivb-3520m/run0.log fi-ivb-3770 failed to collect. IGT log at Patchwork_8256/fi-ivb-3770/run0.log fi-kbl-7500u failed to collect. IGT log at Patchwork_8256/fi-kbl-7500u/run0.log fi-kbl-7560u failed to collect. IGT log at Patchwork_8256/fi-kbl-7560u/run0.log fi-kbl-7567u failed to collect. IGT log at Patchwork_8256/fi-kbl-7567u/run0.log fi-kbl-r failed to collect. IGT log at Patchwork_8256/fi-kbl-r/run0.log fi-pnv-d510 failed to collect. IGT log at Patchwork_8256/fi-pnv-d510/run0.log fi-skl-6260u failed to collect. IGT log at Patchwork_8256/fi-skl-6260u/run0.log fi-skl-6600u failed to collect. IGT log at Patchwork_8256/fi-skl-6600u/run0.log fi-skl-6700hq failed to collect. IGT log at Patchwork_8256/fi-skl-6700hq/run0.log fi-skl-6700k2 failed to collect. IGT log at Patchwork_8256/fi-skl-6700k2/run0.log fi-skl-6770hq failed to collect. IGT log at Patchwork_8256/fi-skl-6770hq/run0.log fi-skl-guc failed to collect. IGT log at Patchwork_8256/fi-skl-guc/run0.log fi-snb-2520m failed to collect. IGT log at Patchwork_8256/fi-snb-2520m/run0.log fi-snb-2600 failed to collect. IGT log at Patchwork_8256/fi-snb-2600/run0.log

8a4eb4556f66d7ab7ad512d5c3d239da8de6b750 drm-tip: 2018y-03m-06d-22h-59m-29s UTC integration manifest 111b6a4c5cd7 drm/i915: Handle pipe CRC around enabling/disabling pipe.

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8256/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: failure for drm/i915: Handle pipe CRC around enabling/disabling pipe.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: drm/i915: Handle pipe CRC around enabling/disabling pipe.
URL : https://patchwork.freedesktop.org/series/39508/
State : failure

== Summary ==

---- Possible new issues:

Test kms_chv_cursor_fail:

        Subgroup pipe-a-128x128-bottom-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-128x128-left-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-128x128-right-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-128x128-top-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-256x256-left-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-256x256-right-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-256x256-top-edge:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup pipe-a-64x64-bottom-edge:
                pass       -> INCOMPLETE (shard-hsw)

---- Known issues:

Test gem_eio:

        Subgroup in-flight-external:
                pass       -> INCOMPLETE (shard-apl) fdo#105341
Test gem_softpin:
        Subgroup noreloc-s3:
                skip       -> PASS       (shard-snb) fdo#103375
Test kms_chv_cursor_fail:
        Subgroup pipe-a-64x64-top-edge:
                pass       -> INCOMPLETE (shard-hsw) fdo#105185 +9
Test kms_flip:
        Subgroup 2x-plain-flip-ts-check:
                fail       -> PASS       (shard-hsw) fdo#100368 +1
Test kms_frontbuffer_tracking:
        Subgroup fbc-suspend:
                pass       -> FAIL       (shard-apl) fdo#101623
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-apl) fdo#99912
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252 +1
Test pm_lpsp:
        Subgroup screens-disabled:
                fail       -> PASS       (shard-hsw) fdo#104941

fdo#105341 https://bugs.freedesktop.org/show_bug.cgi?id=105341
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#104941 https://bugs.freedesktop.org/show_bug.cgi?id=104941

shard-apl        total:3381 pass:1780 dwarn:1   dfail:0   fail:7   skip:1591 time:11795s
shard-hsw        total:2949 pass:1515 dwarn:1   dfail:0   fail:0   skip:1420 time:8325s
shard-snb        total:3467 pass:1361 dwarn:4   dfail:0   fail:2   skip:2100 time:7038s

Blacklisted hosts:
shard-kbl total:3377 pass:1898 dwarn:1 dfail:0 fail:8 skip:1468 time:8757s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8256/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx