Digging out an ooold post of Daniel's... On 04.03.2014 18:13, Daniel Vetter wrote: > On Tue, Feb 25, 2014 at 11:58:26AM +0900, Michel Dänzer wrote: >> >> When the pre/post-modeset hooks were originally added, it worked like >> this: the pre-modeset hook enabled the vblank interrupt, which updated >> the DRM vblank counter from the driver/HW counter. The post-modeset hook >> disabled the vblank interrupt again, which recorded the post-modeset >> driver/HW counter value. >> >> But the vblank code has changed a lot since then, not sure it still >> works like that. > > It still works like that, but there's two fundamental issues with this > trick: > - There's a race where the vblank state is fubar right between the > completion of the modeset and before the first vblank happened.
Can you provide more details about that? You mentioned on IRC that sometimes 'bogus' DRM vblank counter values are returned to userspace. The most likely cause of that would be drm_vblank_pre_modeset() being called too late, i.e. after the hardware counter was reset. (Or if you're reducing / eliminating the vblank disable timer, possibly the vblank interrupt getting disabled too early, i.e. before the hardware counter was reset) Speaking of reducing or disabling the vblank disable timer, that should be possible with drm_vblank_pre/post_modeset() as well. > - It doesn't work across suspend/resume since no one re-enables the vblank > interrupt. That sounds like a driver bug to me. The driver should re-enable the hardware interrupt on resume if the vblank interrupt is currently enabled by the DRM core. This seems to work fine for me with radeon. So, I'm afraid I'm still not convinced that the new vblank_off/on() functions and the ever-increasing series of fixes for problems related to them are the right (let alone only) solution for your problems. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx