[PATCH] drm/drm_vblank: use drm_warn_once() to warn undefined mode timing
Shawn Guo
shawn.guo at linaro.org
Fri Oct 16 07:12:54 UTC 2020
Commit 5caa0feafcc6 ("drm/vblank: Lock down vblank->hwmode more") added
WARN_ON_ONCE() for atomic drivers to warn the case that vsync is enabled
before a mode has been set on CRTC. This happens sometimes during the
initial mode setting of a CRTC. It also happens on Android running HWC2
backed with drm_hwcomposer, where HWC2::SetVsyncEnabled could be called
before the atomic mode setting on CRTC happens.
In this case, there is nothing really bad to happen as kernel function
returns as no-op. So using WARN() version might be overkilled,
considering some user space crash reporting services may treat kernel
WARNINGS as crashes. Let's drop WARN_ON_ONCE() and change drm_dbg_core()
to drm_warn_once() for warning undefined mode timing.
Signed-off-by: Shawn Guo <shawn.guo at linaro.org>
---
drivers/gpu/drm/drm_vblank.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index b18e1efbbae1..5f7c4a923e8a 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -717,9 +717,9 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
* Happens during initial modesetting of a crtc.
*/
if (mode->crtc_clock == 0) {
- drm_dbg_core(dev, "crtc %u: Noop due to uninitialized mode.\n",
- pipe);
- drm_WARN_ON_ONCE(dev, drm_drv_uses_atomic_modeset(dev));
+ drm_warn_once(dev, "crtc %u: Noop due to uninitialized mode.\n",
+ pipe);
+
return false;
}
--
2.17.1
More information about the dri-devel
mailing list