drm/i915: Force state->modeset=true when distrust_bios_wm==true
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Feb 2020 14:04:12 +0000 (16:04 +0200)
committerJani Nikula <jani.nikula@intel.com>
Sat, 15 Feb 2020 17:20:41 +0000 (19:20 +0200)
commit0f8839f5f323da04a800e6ced1136e4b1e1689a9
treea5367d185f1c6488f231d593064989c5933f5674
parenta4277aa398d76db109d6b8420934f68daf69a6c3
drm/i915: Force state->modeset=true when distrust_bios_wm==true

Currently when we load the driver we set distrust_bios_wm=true, which
will cause active_pipe_changes to get flagged even when we're not
toggling any pipes on/off. The reason being that we want to fully
redistribute the dbuf among the active pipes and ignore whatever
state the firmware left behind.

Unfortunately when the code flags active_pipe_changes it doesn't
set state->modeset to true, which means the hardware dbuf state
won't actually get updated. Hence the hardware and software
states go out of sync, which can result in planes trying to use a
disabled dbuf slice. Suprisingly that only seems to corrupt the
display rather than making the whole display engine keel over.

Let's fix this for now by flagging state->modeset whenever
distrust_bios_wm is set.

Eventually we'll likely want to rip out all of this mess and
introduce proper statye tracking for dbuf. But that requires
more work. Toss in a FIXME to that effect.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Fixes: ff2cd8635e41 ("drm/i915: Correctly map DBUF slices to pipes")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200213140412.32697-4-stanislav.lisovskiy@intel.com
drivers/gpu/drm/i915/display/intel_display.c