From: Daniel Vetter Date: Wed, 5 Apr 2023 13:31:05 +0000 (+0200) Subject: drm/atomic-helper: Don't set deadline for modesets X-Git-Tag: v6.4-rc1~31^2~15^2~11 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f2c7ca890182;p=tomoyo%2Ftomoyo-test1.git drm/atomic-helper: Don't set deadline for modesets If the crtc is being switched on or off then the semantics of computing the timestampe of the next vblank is somewhat ill-defined. And indeed, the code splats with a warning in the timestamp computation code. Specifically it hits the check to make sure that atomic drivers have full set up the timing constants in the drm_vblank structure, and that's just not the case before the crtc is actually on. For robustness it seems best to just not set deadlines for modesets. v2: Also skip on inactive crtc (Ville) Link: https://lore.kernel.org/dri-devel/dfc21f18-7e1e-48f0-c05a-d659b9c90b91@linaro.org/ Fixes: d39e48ca80c0 ("drm/atomic-helper: Set fence deadline for vblank") Cc: Ville Syrjälä Cc: Rob Clark Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Reported-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov # test patch only Cc: Dmitry Baryshkov Reviewed-by: Ville Syrjälä Reviewed-by: Rob Clark Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230405133105.947834-1-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d4d2a2ce40f8..2c2c9caf0be5 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1528,6 +1528,12 @@ static void set_fence_deadline(struct drm_device *dev, for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { ktime_t v; + if (drm_atomic_crtc_needs_modeset(new_crtc_state)) + continue; + + if (!new_crtc_state->active) + continue; + if (drm_crtc_next_vblank_start(crtc, &v)) continue;