Skip to contentSkip to conversation

drm/i915: Revert "Fix assert_plane() warning on bootup with external display"

PATCH In review Hans de Goede 3 participants 4 messages Nov 19, 2018 – Nov 21, 2018

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

PATCH 1/1 drm/i915: Revert "Fix assert_plane() warning on bootup with external display"

Starting with 4.20-rc1 I'm seeing the LCD screen briefly turn mostly purple on devices with a DSI panel (seen on 2 different devices with a DSI panel).

This happens both with and without fastboot=1. This is caused by commit 516a49cc1946 ("drm/i915: Fix assert_plane() warning on bootup with external display").

And a user commenting on fdo bug 108225 has reported a flicker caused by the screen briefly turning blank when booting with fastboot=1, which goes away when reverting this commit.

I believe a revert of the offending commit is the best solution because the commit introduces a drm_atomic_commit() call in the drivers' probe path, causing writes to the hardware during probe.
I believe this goes agains the design of the driver which is to only read-back state on probe and only write to the hardware on the first commit from the fbcon or userspace.

Instead the assert_plane() problem the commit tried to fix should be fixed by fixing the state read-back code.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=108225

Cc Azhar Shaikh <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 61 +---------------------------
 1 file changed, 2 insertions(+), 59 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -59
index 2107de6da692..03dec1c05652 100644
@@ -15193,61 +15193,12 @@ static void intel_update_fdi_pll_freq(struct drm_i915_private *dev_priv)
 	DRM_DEBUG_DRIVER("FDI PLL freq=%d\n", dev_priv->fdi_pll_freq);
 }
 
-static int intel_initial_commit(struct drm_device *dev)
-{
-	struct drm_atomic_state *state = NULL;
-	struct drm_modeset_acquire_ctx ctx;
-	struct drm_crtc *crtc;
-	struct drm_crtc_state *crtc_state;
-	int ret = 0;
-
-	state = drm_atomic_state_alloc(dev);
-	if (!state)
-		return -ENOMEM;
-
-	drm_modeset_acquire_init(&ctx, 0);
-
-retry:
-	state->acquire_ctx = &ctx;
-
-	drm_for_each_crtc(crtc, dev) {
-		crtc_state = drm_atomic_get_crtc_state(state, crtc);
-		if (IS_ERR(crtc_state)) {
-			ret = PTR_ERR(crtc_state);
-			goto out;
-		}
-
-		if (crtc_state->active) {
-			ret = drm_atomic_add_affected_planes(state, crtc);
-			if (ret)
-				goto out;
-		}
-	}
-
-	ret = drm_atomic_commit(state);
-
-out:
-	if (ret == -EDEADLK) {
-		drm_atomic_state_clear(state);
-		drm_modeset_backoff(&ctx);
-		goto retry;
-	}
-
-	drm_atomic_state_put(state);
-
-	drm_modeset_drop_locks(&ctx);
-	drm_modeset_acquire_fini(&ctx);
-
-	return ret;
-}
-
 int intel_modeset_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct i915_ggtt *ggtt = &dev_priv->ggtt;
 	enum pipe pipe;
 	struct intel_crtc *crtc;
-	int ret;
 
 	dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
 
@@ -15319,6 +15270,8 @@ int intel_modeset_init(struct drm_device *dev)
 		      INTEL_INFO(dev_priv)->num_pipes > 1 ? "s" : "");
 
 	for_each_pipe(dev_priv, pipe) {
+		int ret;
+
 		ret = intel_crtc_init(dev_priv, pipe);
 		if (ret) {
 			drm_mode_config_cleanup(dev);
@@ -15374,16 +15327,6 @@ int intel_modeset_init(struct drm_device *dev)
 	if (!HAS_GMCH_DISPLAY(dev_priv))
 		sanitize_watermarks(dev);
 
-	/*
-	 * Force all active planes to recompute their states. So that on
-	 * mode_setcrtc after probe, all the intel_plane_state variables
-	 * are already calculated and there is no assert_plane warnings
-	 * during bootup.
-	 */
-	ret = intel_initial_commit(dev);
-	if (ret)
-		DRM_DEBUG_KMS("Initial commit in probe failed.\n");
-
 	return 0;
 }
 
Signature · 6 lines
2.19.1

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

✓ Fi.CI.BAT: success for drm/i915: Revert "Fix assert_plane() warning on bootup with external display"

== Series Details ==

== Series Details ==

Series: drm/i915: Revert "Fix assert_plane() warning on bootup with external display"
URL : https://patchwork.freedesktop.org/series/52720/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5166 -> Patchwork_10855 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52720/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_10855 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@i915_selftest@live_hangcheck:
      fi-skl-guc:         PASS -> DMESG-FAIL (fdo#108593)

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191) +1

    
    ==== Possible fixes ====

    igt@i915_selftest@live_hangcheck:
      fi-glk-dsi:         INCOMPLETE (fdo#103359, k.org#198133) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#107362, fdo#103191) -> PASS

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#108593 https://bugs.freedesktop.org/show_bug.cgi?id=108593
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (54 -> 45) ==

Missing (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-skl-6260u fi-ctg-p8600 fi-icl-u3 fi-icl-u

== Build changes ==

* Linux: CI_DRM_5166 -> Patchwork_10855

CI_DRM_5166: 75e2b62553fff801c8f2c283d69677c0e3175cb8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4720: c27aaca295d3ca2a38521e571c012449371e4bb5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10855: 22de4dead754a33dda2aa3be0e36637c7c8be73b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

22de4dead754 drm/i915: Revert "Fix assert_plane() warning on bootup with external display"

== Logs ==

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

#2 lore raw

✓ Fi.CI.IGT: success for drm/i915: Revert "Fix assert_plane() warning on bootup with external display"

In reply to Hans de Goede
== Series Details ==

== Series Details ==

Series: drm/i915: Revert "Fix assert_plane() warning on bootup with external display"
URL : https://patchwork.freedesktop.org/series/52720/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5166_full -> Patchwork_10855_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_10855_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_10855_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_10855_full:

=== IGT changes ===

    ==== Warnings ====

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-snb:          SKIP -> PASS +2

== Known issues ==

Here are the changes found in Patchwork_10855_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_schedule@pi-ringfull-blt:
      {shard-iclb}:       NOTRUN -> FAIL (fdo#103158)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#106887, fdo#106023)

    igt@i915_suspend@shrink:
      {shard-iclb}:       NOTRUN -> DMESG-WARN (fdo#108784)

    igt@kms_busy@extended-modeset-hang-newfb-render-a:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-snb:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_ccs@pipe-a-crc-primary-rotation-180:
      {shard-iclb}:       NOTRUN -> FAIL (fdo#107725) +2

    igt@kms_cursor_crc@cursor-256x85-sliding:
      {shard-iclb}:       NOTRUN -> FAIL (fdo#103232) +7

    igt@kms_cursor_crc@cursor-64x21-onscreen:
      shard-glk:          PASS -> FAIL (fdo#103232) +1

    igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          PASS -> FAIL (fdo#105454, fdo#106509)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-skl:          NOTRUN -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-pwrite:
      {shard-iclb}:       NOTRUN -> FAIL (fdo#103167) +4

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      shard-skl:          PASS -> INCOMPLETE (fdo#104108, fdo#107773)

    igt@kms_plane@pixel-format-pipe-b-planes:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#106885) +1

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          PASS -> FAIL (fdo#103166) +1
      {shard-iclb}:       NOTRUN -> FAIL (fdo#103166) +2

    igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
      shard-skl:          NOTRUN -> FAIL (fdo#108145) +2

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    igt@pm_backlight@fade_with_suspend:
      shard-skl:          NOTRUN -> FAIL (fdo#107847)

    igt@pm_rpm@debugfs-read:
      shard-skl:          PASS -> INCOMPLETE (fdo#107807)

    igt@pm_rpm@universal-planes:
      shard-skl:          NOTRUN -> INCOMPLETE (fdo#107807)

    igt@pm_rps@min-max-config-loaded:
      {shard-iclb}:       NOTRUN -> FAIL (fdo#102250)

    
    ==== Possible fixes ====

    igt@gem_softpin@noreloc-s3:
      shard-skl:          INCOMPLETE (fdo#104108, fdo#107773) -> PASS

    igt@kms_cursor_crc@cursor-128x128-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +4

    igt@kms_cursor_crc@cursor-size-change:
      shard-glk:          FAIL (fdo#103232) -> PASS

    igt@kms_flip@flip-vs-modeset-interruptible:
      shard-hsw:          DMESG-WARN (fdo#102614) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-apl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
      shard-glk:          FAIL (fdo#103167) -> PASS +1

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
      shard-skl:          INCOMPLETE (fdo#104108) -> PASS

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      {shard-iclb}:       FAIL (fdo#103166) -> PASS +1

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
      shard-glk:          INCOMPLETE (fdo#103359, k.org#198133) -> PASS

    igt@pm_backlight@basic-brightness:
      {shard-iclb}:       INCOMPLETE (fdo#107820) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#102250 https://bugs.freedesktop.org/show_bug.cgi?id=102250
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#106885 https://bugs.freedesktop.org/show_bug.cgi?id=106885
fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
fdo#107725 https://bugs.freedesktop.org/show_bug.cgi?id=107725
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
fdo#107820 https://bugs.freedesktop.org/show_bug.cgi?id=107820
fdo#107847 https://bugs.freedesktop.org/show_bug.cgi?id=107847
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108784 https://bugs.freedesktop.org/show_bug.cgi?id=108784
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (7 -> 7) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_5166 -> Patchwork_10855

CI_DRM_5166: 75e2b62553fff801c8f2c283d69677c0e3175cb8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4720: c27aaca295d3ca2a38521e571c012449371e4bb5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10855: 22de4dead754a33dda2aa3be0e36637c7c8be73b @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#3 lore raw
In reply to Hans de Goede
Quoted 18 lines · Hans de Goede

Starting with 4.20-rc1 I'm seeing the LCD screen briefly turn mostly purple on devices with a DSI panel (seen on 2 different devices with a DSI panel).

This happens both with and without fastboot=1. This is caused by commit 516a49cc1946 ("drm/i915: Fix assert_plane() warning on bootup with external display").

And a user commenting on fdo bug 108225 has reported a flicker caused by the screen briefly turning blank when booting with fastboot=1, which goes away when reverting this commit.

I believe a revert of the offending commit is the best solution because the commit introduces a drm_atomic_commit() call in the drivers' probe path, causing writes to the hardware during probe.
I believe this goes agains the design of the driver which is to only read-back state on probe and only write to the hardware on the first commit from the fbcon or userspace.

Quoted 7 lines

Instead the assert_plane() problem the commit tried to fix should be fixed by fixing the state read-back code.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=108225

Cc Azhar Shaikh <[email protected]>
Cc Ville Syrjälä <[email protected]>

Fixed with https://patchwork.freedesktop.org/series/52754/

Quoted 98 lines
---
 drivers/gpu/drm/i915/intel_display.c | 61 +---------------------------
 1 file changed, 2 insertions(+), 59 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -59
index 2107de6da692..03dec1c05652 100644
@@ -15193,61 +15193,12 @@ static void intel_update_fdi_pll_freq(struct drm_i915_private *dev_priv)
 	DRM_DEBUG_DRIVER("FDI PLL freq=%d\n", dev_priv->fdi_pll_freq);
 }
 
-static int intel_initial_commit(struct drm_device *dev)
-{
-	struct drm_atomic_state *state = NULL;
-	struct drm_modeset_acquire_ctx ctx;
-	struct drm_crtc *crtc;
-	struct drm_crtc_state *crtc_state;
-	int ret = 0;
-
-	state = drm_atomic_state_alloc(dev);
-	if (!state)
-		return -ENOMEM;
-
-	drm_modeset_acquire_init(&ctx, 0);
-
-retry:
-	state->acquire_ctx = &ctx;
-
-	drm_for_each_crtc(crtc, dev) {
-		crtc_state = drm_atomic_get_crtc_state(state, crtc);
-		if (IS_ERR(crtc_state)) {
-			ret = PTR_ERR(crtc_state);
-			goto out;
-		}
-
-		if (crtc_state->active) {
-			ret = drm_atomic_add_affected_planes(state, crtc);
-			if (ret)
-				goto out;
-		}
-	}
-
-	ret = drm_atomic_commit(state);
-
-out:
-	if (ret == -EDEADLK) {
-		drm_atomic_state_clear(state);
-		drm_modeset_backoff(&ctx);
-		goto retry;
-	}
-
-	drm_atomic_state_put(state);
-
-	drm_modeset_drop_locks(&ctx);
-	drm_modeset_acquire_fini(&ctx);
-
-	return ret;
-}
-
 int intel_modeset_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct i915_ggtt *ggtt = &dev_priv->ggtt;
 	enum pipe pipe;
 	struct intel_crtc *crtc;
-	int ret;
 
 	dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
 
@@ -15319,6 +15270,8 @@ int intel_modeset_init(struct drm_device *dev)
 		      INTEL_INFO(dev_priv)->num_pipes > 1 ? "s" : "");
 
 	for_each_pipe(dev_priv, pipe) {
+		int ret;
+
 		ret = intel_crtc_init(dev_priv, pipe);
 		if (ret) {
 			drm_mode_config_cleanup(dev);
@@ -15374,16 +15327,6 @@ int intel_modeset_init(struct drm_device *dev)
 	if (!HAS_GMCH_DISPLAY(dev_priv))
 		sanitize_watermarks(dev);
 
-	/*
-	 * Force all active planes to recompute their states. So that on
-	 * mode_setcrtc after probe, all the intel_plane_state variables
-	 * are already calculated and there is no assert_plane warnings
-	 * during bootup.
-	 */
-	ret = intel_initial_commit(dev);
-	if (ret)
-		DRM_DEBUG_KMS("Initial commit in probe failed.\n");
-
 	return 0;
 }
 
Signature · 1 line
2.19.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx