---
name: "drm_vblank_pre_modeset"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/drm_vblank_pre_modeset"
---

# drm\_vblank\_pre\_modeset(9)

account for vblanks across mode sets

## NAME

drm\_vblank\_pre\_modeset - account for vblanks across mode sets

## SYNOPSIS

**void drm\_vblank\_pre\_modeset(struct drm\_device \*** *dev***, int** *crtc***);**

## ARGUMENTS

*dev*

DRM device

*crtc*

CRTC in question

## DESCRIPTION

Account for vblank events across mode setting events, which will likely reset the hardware frame counter.

This is done by grabbing a temporary vblank reference to ensure that the vblank interrupt keeps running across the modeset sequence. With this the software-side vblank frame counting will ensure that there are no jumps or discontinuities.

Unfortunately this approach is racy and also doesn't work when the vblank interrupt stops running, e.g. across system suspend resume. It is therefore highly recommended that drivers use the newer **drm\_vblank\_off** and **drm\_vblank\_on** instead. **drm\_vblank\_pre\_modeset** only works correctly when using “cooked” software vblank frame counters and not relying on any hardware counters.

Drivers must call **drm\_vblank\_post\_modeset** when re-enabling the same crtc again.

## AUTHORS

**Jesse Barnes** \<jesse.barnes@intel.com\>\
 Intel Corporation,

Initial version

**Laurent Pinchart** \<laurent.pinchart@ideasonboard.com\>\
 Ideas on board SPRL,

Driver internals

**Daniel Vetter** \<daniel.vetter@ffwll.ch\>\
 Intel Corporation,

Contributions all over the place

## COPYRIGHT
