From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 4.20 regression fix] drm/i915: Revert "Fix assert_plane() warning on bootup with external display"
Date: Wed, 21 Nov 2018 14:14:44 +0200 [thread overview]
Message-ID: <20181121121444.GE9144@intel.com> (raw)
In-Reply-To: <20181119223500.29779-1-hdegoede@redhat.com>
On Mon, Nov 19, 2018 at 11:35:00PM +0100, Hans de Goede wrote:
> 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 <azhar.shaikh@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Fixed with https://patchwork.freedesktop.org/series/52754/
> ---
> drivers/gpu/drm/i915/intel_display.c | 61 +---------------------------
> 1 file changed, 2 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2107de6da692..03dec1c05652 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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;
> }
>
> --
> 2.19.1
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2018-11-21 12:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 22:35 [PATCH 4.20 regression fix] drm/i915: Revert "Fix assert_plane() warning on bootup with external display" Hans de Goede
2018-11-19 23:10 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-11-20 7:11 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-21 12:14 ` Ville Syrjälä [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181121121444.GE9144@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.