---
name: "drm_cvt_mode"
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_cvt_mode"
---

# drm\_cvt\_mode(9)

create a modeline based on the CVT algorithm

## NAME

drm\_cvt\_mode - create a modeline based on the CVT algorithm

## SYNOPSIS

**struct drm\_display\_mode \* drm\_cvt\_mode(struct drm\_device \*** *dev***, int** *hdisplay***, int** *vdisplay***, int** *vrefresh***, bool** *reduced***, bool** *interlaced***, bool** *margins***);**

## ARGUMENTS

*dev*

drm device

*hdisplay*

hdisplay size

*vdisplay*

vdisplay size

*vrefresh*

vrefresh rate

*reduced*

whether to use reduced blanking

*interlaced*

whether to compute an interlaced mode

*margins*

whether to add margins (borders)

## DESCRIPTION

This function is called to generate the modeline based on CVT algorithm according to the hdisplay, vdisplay, vrefresh. It is based from the VESA(TM) Coordinated Video Timing Generator by Graham Loveridge April 9, 2003 available at

## HTTP

//www.elo.utfsm.cl/~elo212/docs/CVTd6r1.xls

And it is copied from xf86CVTmode in xserver/hw/xfree86/modes/xf86cvt.c. What I have done is to translate it by using integer calculation.

## RETURNS

The modeline based on the CVT algorithm stored in a drm\_display\_mode object. The display mode object is allocated with **drm\_mode\_create**. Returns NULL when no mode could be allocated.

## 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
