drm/i915: Mark FIFO underrun disabled earlier
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 25 Jan 2023 18:52:30 +0000 (20:52 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 23 Feb 2023 14:28:03 +0000 (16:28 +0200)
commit66560f33059ebe606cad7aef9c298a19d4f9e998
tree1ca6a216cf643e6bc1b560caa2e6c724b07eb232
parent5eba7426050755c96d4b9561432b18ca000a4fd4
drm/i915: Mark FIFO underrun disabled earlier

At least on some platforms (tested on ctg) the way
vgacon does screen blanking seems to flag constant
FIFO underruns, which means we have to be prepared
for them while the driver is loading. Currently
there is a time window between drm_crtc_init() and
intel_sanitize_fifo_underrun_reporting() during
which FIFO underrun reporting is in fact marked as
enabled. Thus we may end up mistakenly detecting
these bogus underruns during driver init.

Close the race by marking FIFO underrun reporting
as disabled prior to even registering the crtc.
intel_sanitize_fifo_underrun_reporting()/etc. will
re-enable it later if needed.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125185234.21599-2-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_fifo_underrun.c
drivers/gpu/drm/i915/display/intel_fifo_underrun.h
drivers/gpu/drm/i915/display/intel_modeset_setup.c