drm: Add drm_vblank_on()
drm_vblank_off() will turn off vblank interrupts, but as long as the
refcount is elevated drm_vblank_get() will not re-enable them. This
is a problem is someone is holding a vblank reference while a modeset is
happening, and the driver requires vblank interrupt to work during that
time.
Add drm_vblank_on() as a counterpart to drm_vblank_off() which will
re-enabled vblank interrupts if the refcount is already elevated. This
will allow drivers to choose the specific places in the modeset sequence
at which vblank interrupts get disabled and enabled.
Testcase: igt/kms_flip/*-vs-suspend
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Add Testcase tag for the igt I've written.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 72b5c34..313f29d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3737,6 +3737,8 @@
* happening.
*/
intel_wait_for_vblank(dev, intel_crtc->pipe);
+
+ drm_vblank_on(dev, pipe);
}
/* IPS only exists on ULT machines and is tied to pipe A. */
@@ -3828,6 +3830,8 @@
* to change the workaround. */
haswell_mode_set_planes_workaround(intel_crtc);
ilk_crtc_enable_planes(crtc);
+
+ drm_vblank_on(dev, pipe);
}
static void ironlake_pfit_disable(struct intel_crtc *crtc)
@@ -4351,6 +4355,8 @@
for_each_encoder_on_crtc(dev, crtc, encoder)
encoder->enable(encoder);
+
+ drm_vblank_on(dev, pipe);
}
static void i9xx_crtc_enable(struct drm_crtc *crtc)
@@ -4398,6 +4404,8 @@
for_each_encoder_on_crtc(dev, crtc, encoder)
encoder->enable(encoder);
+
+ drm_vblank_on(dev, pipe);
}
static void i9xx_pfit_disable(struct intel_crtc *crtc)