drm/vblank: Do not update vblank count if interrupts are already disabled.
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Sat, 3 Feb 2018 05:13:00 +0000 (21:13 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 15 Feb 2018 19:50:04 +0000 (11:50 -0800)
commit68036b08b91bc491ccc308f902616a570a49227c
treeee6cbb2970d467cece871162c2d950db5f2ae5f2
parentf4c0468e4bd64b7cd00e2db309925728fc72bf8b
drm/vblank: Do not update vblank count if interrupts are already disabled.

Updating vblank counts requires register reads and these reads may not
return meaningful values if the device was in a low power state after
vblank interrupts were last disabled. So, update the count only if vblank
interrupts are enabled. Secondly, this means the registers should be read
before disabling vblank interrupts.

v2: Don't check vblank->enabled outside it's lock (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180203051302.9974-8-dhinakaran.pandiyan@intel.com
drivers/gpu/drm/drm_vblank.c