drm: Ignore timestamp for monitor shut-off

Some graphics drivers (currently at least VMware and AMD) will give a 0
timestamp for the atomic mode flip completion event when turning off
the display. This causes us to trip an assertion in
weston_output_frame_finish() because the clock jumps backwards, which
isn't a condition the presentation feedback code should be dealing with.

This is a good assertion and we'd like to keep it. And there's some
expectation that this is buggy behaviour in the graphics drivers that will
be fixed at some point.

Pragmatically speaking though, there's nothing productive we can do with a
correct timestamp for the display shutdown.  So let's just flag the
event sent for DPMS off as invalid so presentation feedback doesn't have
to worry about it, and the assert doesn't fire.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 3 years ago committed by Daniel Stone
parent c2b9747812
commit 74bdb35c85
  1. 7
      libweston/backend-drm/drm.c

@ -312,7 +312,12 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
ts.tv_sec = sec;
ts.tv_nsec = usec * 1000;
weston_output_finish_frame(&output->base, &ts, flags);
if (output->state_cur->dpms != WESTON_DPMS_OFF)
weston_output_finish_frame(&output->base, &ts, flags);
else
weston_output_finish_frame(&output->base, NULL,
WP_PRESENTATION_FEEDBACK_INVALID);
/* We can't call this from frame_notify, because the output's
* repaint needed flag is cleared just after that */

Loading…
Cancel
Save