]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - Documentation/gpu/drm-kms.rst
drm: Don't export dp-aux devnode functions
[mirror_ubuntu-bionic-kernel.git] / Documentation / gpu / drm-kms.rst
CommitLineData
2fa91d15
JN
1=========================
2Kernel Mode Setting (KMS)
3=========================
4
2fa91d15
JN
5Drivers must initialize the mode setting core by calling
6:c:func:`drm_mode_config_init()` on the DRM device. The function
7initializes the :c:type:`struct drm_device <drm_device>`
8mode_config field and never fails. Once done, mode configuration must
9be setup by initializing the following fields.
10
11- int min_width, min_height; int max_width, max_height;
12 Minimum and maximum width and height of the frame buffers in pixel
13 units.
14
15- struct drm_mode_config_funcs \*funcs;
16 Mode setting functions.
17
311b62d9
DV
18KMS Data Structures
19===================
2fa91d15 20
311b62d9 21.. kernel-doc:: include/drm/drm_crtc.h
2fa91d15
JN
22 :internal:
23
311b62d9
DV
24KMS API Functions
25=================
26
27.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
2fa91d15
JN
28 :export:
29
30Atomic Mode Setting Function Reference
311b62d9 31======================================
2fa91d15
JN
32
33.. kernel-doc:: drivers/gpu/drm/drm_atomic.c
34 :export:
35
5d070be6 36.. kernel-doc:: include/drm/drm_atomic.h
2fa91d15
JN
37 :internal:
38
39Frame Buffer Abstraction
311b62d9 40========================
2fa91d15 41
750fb8c4
DV
42.. kernel-doc:: drivers/gpu/drm/drm_framebuffer.c
43 :doc: overview
2fa91d15 44
7520a277
DV
45Frame Buffer Functions Reference
46--------------------------------
47
48.. kernel-doc:: drivers/gpu/drm/drm_framebuffer.c
49 :export:
50
51.. kernel-doc:: include/drm/drm_framebuffer.h
52 :internal:
53
2fa91d15 54DRM Format Handling
311b62d9 55===================
2fa91d15 56
2fa91d15
JN
57.. kernel-doc:: drivers/gpu/drm/drm_fourcc.c
58 :export:
59
60Dumb Buffer Objects
311b62d9 61===================
2fa91d15
JN
62
63The KMS API doesn't standardize backing storage object creation and
64leaves it to driver-specific ioctls. Furthermore actually creating a
65buffer object even for GEM-based drivers is done through a
66driver-specific ioctl - GEM only has a common userspace interface for
67sharing and destroying objects. While not an issue for full-fledged
68graphics stacks that include device-specific userspace components (in
69libdrm for instance), this limit makes DRM-based early boot graphics
70unnecessarily complex.
71
72Dumb objects partly alleviate the problem by providing a standard API to
73create dumb buffers suitable for scanout, which can then be used to
74create KMS frame buffers.
75
76To support dumb objects drivers must implement the dumb_create,
77dumb_destroy and dumb_map_offset operations.
78
79- int (\*dumb_create)(struct drm_file \*file_priv, struct
80 drm_device \*dev, struct drm_mode_create_dumb \*args);
81 The dumb_create operation creates a driver object (GEM or TTM
82 handle) suitable for scanout based on the width, height and depth
83 from the struct :c:type:`struct drm_mode_create_dumb
84 <drm_mode_create_dumb>` argument. It fills the argument's
85 handle, pitch and size fields with a handle for the newly created
86 object and its line pitch and size in bytes.
87
88- int (\*dumb_destroy)(struct drm_file \*file_priv, struct
89 drm_device \*dev, uint32_t handle);
90 The dumb_destroy operation destroys a dumb object created by
91 dumb_create.
92
93- int (\*dumb_map_offset)(struct drm_file \*file_priv, struct
94 drm_device \*dev, uint32_t handle, uint64_t \*offset);
95 The dumb_map_offset operation associates an mmap fake offset with
96 the object given by the handle and returns it. Drivers must use the
97 :c:func:`drm_gem_create_mmap_offset()` function to associate
98 the fake offset as described in ?.
99
100Note that dumb objects may not be used for gpu acceleration, as has been
101attempted on some ARM embedded platforms. Such drivers really must have
102a hardware-specific ioctl to allocate suitable buffer objects.
103
311b62d9
DV
104Display Modes Function Reference
105================================
2fa91d15 106
311b62d9
DV
107.. kernel-doc:: include/drm/drm_modes.h
108 :internal:
109
110.. kernel-doc:: drivers/gpu/drm/drm_modes.c
111 :export:
2fa91d15 112
52217195
DV
113Connector Display Sink Abstraction
114==================================
115
116.. kernel-doc:: include/drm/drm_connector.h
117 :internal:
118
119.. kernel-doc:: drivers/gpu/drm/drm_connector.c
120 :export:
121
2fa91d15
JN
122KMS Initialization and Cleanup
123==============================
124
125A KMS device is abstracted and exposed as a set of planes, CRTCs,
126encoders and connectors. KMS drivers must thus create and initialize all
127those objects at load time after initializing mode setting.
128
129CRTCs (:c:type:`struct drm_crtc <drm_crtc>`)
130--------------------------------------------
131
132A CRTC is an abstraction representing a part of the chip that contains a
133pointer to a scanout buffer. Therefore, the number of CRTCs available
134determines how many independent scanout buffers can be active at any
135given time. The CRTC structure contains several fields to support this:
136a pointer to some video memory (abstracted as a frame buffer object), a
137display mode, and an (x, y) offset into the video memory to support
138panning or configurations where one piece of video memory spans multiple
139CRTCs.
140
141CRTC Initialization
142~~~~~~~~~~~~~~~~~~~
143
144A KMS device must create and register at least one struct
145:c:type:`struct drm_crtc <drm_crtc>` instance. The instance is
146allocated and zeroed by the driver, possibly as part of a larger
147structure, and registered with a call to :c:func:`drm_crtc_init()`
148with a pointer to CRTC functions.
149
150Planes (:c:type:`struct drm_plane <drm_plane>`)
151-----------------------------------------------
152
153A plane represents an image source that can be blended with or overlayed
154on top of a CRTC during the scanout process. Planes are associated with
155a frame buffer to crop a portion of the image memory (source) and
156optionally scale it to a destination size. The result is then blended
157with or overlayed on top of a CRTC.
158
159The DRM core recognizes three types of planes:
160
161- DRM_PLANE_TYPE_PRIMARY represents a "main" plane for a CRTC.
162 Primary planes are the planes operated upon by CRTC modesetting and
163 flipping operations described in the page_flip hook in
164 :c:type:`struct drm_crtc_funcs <drm_crtc_funcs>`.
165- DRM_PLANE_TYPE_CURSOR represents a "cursor" plane for a CRTC.
166 Cursor planes are the planes operated upon by the
167 DRM_IOCTL_MODE_CURSOR and DRM_IOCTL_MODE_CURSOR2 ioctls.
168- DRM_PLANE_TYPE_OVERLAY represents all non-primary, non-cursor
169 planes. Some drivers refer to these types of planes as "sprites"
170 internally.
171
172For compatibility with legacy userspace, only overlay planes are made
173available to userspace by default. Userspace clients may set the
174DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate
175that they wish to receive a universal plane list containing all plane
176types.
177
178Plane Initialization
179~~~~~~~~~~~~~~~~~~~~
180
181To create a plane, a KMS drivers allocates and zeroes an instances of
182:c:type:`struct drm_plane <drm_plane>` (possibly as part of a
183larger structure) and registers it with a call to
184:c:func:`drm_universal_plane_init()`. The function takes a
185bitmask of the CRTCs that can be associated with the plane, a pointer to
186the plane functions, a list of format supported formats, and the type of
187plane (primary, cursor, or overlay) being initialized.
188
189Cursor and overlay planes are optional. All drivers should provide one
190primary plane per CRTC (although this requirement may change in the
191future); drivers that do not wish to provide special handling for
192primary planes may make use of the helper functions described in ? to
193create and register a primary plane with standard capabilities.
194
195Encoders (:c:type:`struct drm_encoder <drm_encoder>`)
196-----------------------------------------------------
197
198An encoder takes pixel data from a CRTC and converts it to a format
199suitable for any attached connectors. On some devices, it may be
200possible to have a CRTC send data to more than one encoder. In that
201case, both encoders would receive data from the same scanout buffer,
202resulting in a "cloned" display configuration across the connectors
203attached to each encoder.
204
205Encoder Initialization
206~~~~~~~~~~~~~~~~~~~~~~
207
208As for CRTCs, a KMS driver must create, initialize and register at least
209one :c:type:`struct drm_encoder <drm_encoder>` instance. The
210instance is allocated and zeroed by the driver, possibly as part of a
211larger structure.
212
213Drivers must initialize the :c:type:`struct drm_encoder
214<drm_encoder>` possible_crtcs and possible_clones fields before
215registering the encoder. Both fields are bitmasks of respectively the
216CRTCs that the encoder can be connected to, and sibling encoders
217candidate for cloning.
218
219After being initialized, the encoder must be registered with a call to
220:c:func:`drm_encoder_init()`. The function takes a pointer to the
221encoder functions and an encoder type. Supported types are
222
223- DRM_MODE_ENCODER_DAC for VGA and analog on DVI-I/DVI-A
224- DRM_MODE_ENCODER_TMDS for DVI, HDMI and (embedded) DisplayPort
225- DRM_MODE_ENCODER_LVDS for display panels
226- DRM_MODE_ENCODER_TVDAC for TV output (Composite, S-Video,
227 Component, SCART)
228- DRM_MODE_ENCODER_VIRTUAL for virtual machine displays
229
230Encoders must be attached to a CRTC to be used. DRM drivers leave
231encoders unattached at initialization time. Applications (or the fbdev
232compatibility layer when implemented) are responsible for attaching the
233encoders they want to use to a CRTC.
234
235Connectors (:c:type:`struct drm_connector <drm_connector>`)
236-----------------------------------------------------------
237
238A connector is the final destination for pixel data on a device, and
239usually connects directly to an external display device like a monitor
240or laptop panel. A connector can only be attached to one encoder at a
241time. The connector is also the structure where information about the
242attached display is kept, so it contains fields for display data, EDID
243data, DPMS & connection status, and information about modes supported on
244the attached displays.
245
246Connector Initialization
247~~~~~~~~~~~~~~~~~~~~~~~~
248
249Finally a KMS driver must create, initialize, register and attach at
250least one :c:type:`struct drm_connector <drm_connector>`
251instance. The instance is created as other KMS objects and initialized
252by setting the following fields.
253
254interlace_allowed
255 Whether the connector can handle interlaced modes.
256
257doublescan_allowed
258 Whether the connector can handle doublescan.
259
260display_info
261 Display information is filled from EDID information when a display
262 is detected. For non hot-pluggable displays such as flat panels in
263 embedded systems, the driver should initialize the
264 display_info.width_mm and display_info.height_mm fields with the
265 physical size of the display.
266
267polled
268 Connector polling mode, a combination of
269
270 DRM_CONNECTOR_POLL_HPD
271 The connector generates hotplug events and doesn't need to be
272 periodically polled. The CONNECT and DISCONNECT flags must not
273 be set together with the HPD flag.
274
275 DRM_CONNECTOR_POLL_CONNECT
276 Periodically poll the connector for connection.
277
278 DRM_CONNECTOR_POLL_DISCONNECT
279 Periodically poll the connector for disconnection.
280
281 Set to 0 for connectors that don't support connection status
282 discovery.
283
284The connector is then registered with a call to
285:c:func:`drm_connector_init()` with a pointer to the connector
286functions and a connector type, and exposed through sysfs with a call to
287:c:func:`drm_connector_register()`.
288
289Supported connector types are
290
291- DRM_MODE_CONNECTOR_VGA
292- DRM_MODE_CONNECTOR_DVII
293- DRM_MODE_CONNECTOR_DVID
294- DRM_MODE_CONNECTOR_DVIA
295- DRM_MODE_CONNECTOR_Composite
296- DRM_MODE_CONNECTOR_SVIDEO
297- DRM_MODE_CONNECTOR_LVDS
298- DRM_MODE_CONNECTOR_Component
299- DRM_MODE_CONNECTOR_9PinDIN
300- DRM_MODE_CONNECTOR_DisplayPort
301- DRM_MODE_CONNECTOR_HDMIA
302- DRM_MODE_CONNECTOR_HDMIB
303- DRM_MODE_CONNECTOR_TV
304- DRM_MODE_CONNECTOR_eDP
305- DRM_MODE_CONNECTOR_VIRTUAL
306
307Connectors must be attached to an encoder to be used. For devices that
308map connectors to encoders 1:1, the connector should be attached at
309initialization time with a call to
310:c:func:`drm_mode_connector_attach_encoder()`. The driver must
311also set the :c:type:`struct drm_connector <drm_connector>`
312encoder field to point to the attached encoder.
313
314Finally, drivers must initialize the connectors state change detection
315with a call to :c:func:`drm_kms_helper_poll_init()`. If at least
316one connector is pollable but can't generate hotplug interrupts
317(indicated by the DRM_CONNECTOR_POLL_CONNECT and
318DRM_CONNECTOR_POLL_DISCONNECT connector flags), a delayed work will
319automatically be queued to periodically poll for changes. Connectors
320that can generate hotplug interrupts must be marked with the
321DRM_CONNECTOR_POLL_HPD flag instead, and their interrupt handler must
322call :c:func:`drm_helper_hpd_irq_event()`. The function will
323queue a delayed work to check the state of all connectors, but no
324periodic polling will be done.
325
326Connector Operations
327~~~~~~~~~~~~~~~~~~~~
328
329 **Note**
330
331 Unless otherwise state, all operations are mandatory.
332
333DPMS
334''''
335
336void (\*dpms)(struct drm_connector \*connector, int mode);
337The DPMS operation sets the power state of a connector. The mode
338argument is one of
339
340- DRM_MODE_DPMS_ON
341
342- DRM_MODE_DPMS_STANDBY
343
344- DRM_MODE_DPMS_SUSPEND
345
346- DRM_MODE_DPMS_OFF
347
348In all but DPMS_ON mode the encoder to which the connector is attached
349should put the display in low-power mode by driving its signals
350appropriately. If more than one connector is attached to the encoder
351care should be taken not to change the power state of other displays as
352a side effect. Low-power mode should be propagated to the encoders and
353CRTCs when all related connectors are put in low-power mode.
354
355Modes
356'''''
357
358int (\*fill_modes)(struct drm_connector \*connector, uint32_t
359max_width, uint32_t max_height);
360Fill the mode list with all supported modes for the connector. If the
361``max_width`` and ``max_height`` arguments are non-zero, the
362implementation must ignore all modes wider than ``max_width`` or higher
363than ``max_height``.
364
365The connector must also fill in this operation its display_info
366width_mm and height_mm fields with the connected display physical size
367in millimeters. The fields should be set to 0 if the value isn't known
368or is not applicable (for instance for projector devices).
369
370Connection Status
371'''''''''''''''''
372
373The connection status is updated through polling or hotplug events when
374supported (see ?). The status value is reported to userspace through
375ioctls and must not be used inside the driver, as it only gets
376initialized by a call to :c:func:`drm_mode_getconnector()` from
377userspace.
378
379enum drm_connector_status (\*detect)(struct drm_connector
380\*connector, bool force);
381Check to see if anything is attached to the connector. The ``force``
382parameter is set to false whilst polling or to true when checking the
383connector due to user request. ``force`` can be used by the driver to
384avoid expensive, destructive operations during automated probing.
385
386Return connector_status_connected if something is connected to the
387connector, connector_status_disconnected if nothing is connected and
388connector_status_unknown if the connection state isn't known.
389
390Drivers should only return connector_status_connected if the
391connection status has really been probed as connected. Connectors that
392can't detect the connection status, or failed connection status probes,
393should return connector_status_unknown.
394
395Cleanup
396-------
397
398The DRM core manages its objects' lifetime. When an object is not needed
399anymore the core calls its destroy function, which must clean up and
400free every resource allocated for the object. Every
401:c:func:`drm_\*_init()` call must be matched with a corresponding
402:c:func:`drm_\*_cleanup()` call to cleanup CRTCs
403(:c:func:`drm_crtc_cleanup()`), planes
404(:c:func:`drm_plane_cleanup()`), encoders
405(:c:func:`drm_encoder_cleanup()`) and connectors
406(:c:func:`drm_connector_cleanup()`). Furthermore, connectors that
407have been added to sysfs must be removed by a call to
408:c:func:`drm_connector_unregister()` before calling
409:c:func:`drm_connector_cleanup()`.
410
411Connectors state change detection must be cleanup up with a call to
412:c:func:`drm_kms_helper_poll_fini()`.
413
414Output discovery and initialization example
415-------------------------------------------
416
417::
418
419 void intel_crt_init(struct drm_device *dev)
420 {
421 struct drm_connector *connector;
422 struct intel_output *intel_output;
423
424 intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
425 if (!intel_output)
426 return;
427
428 connector = &intel_output->base;
429 drm_connector_init(dev, &intel_output->base,
430 &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
431
432 drm_encoder_init(dev, &intel_output->enc, &intel_crt_enc_funcs,
433 DRM_MODE_ENCODER_DAC);
434
435 drm_mode_connector_attach_encoder(&intel_output->base,
436 &intel_output->enc);
437
438 /* Set up the DDC bus. */
439 intel_output->ddc_bus = intel_i2c_create(dev, GPIOA, "CRTDDC_A");
440 if (!intel_output->ddc_bus) {
441 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
442 "failed.\n");
443 return;
444 }
445
446 intel_output->type = INTEL_OUTPUT_ANALOG;
447 connector->interlace_allowed = 0;
448 connector->doublescan_allowed = 0;
449
450 drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
451 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
452
453 drm_connector_register(connector);
454 }
455
456In the example above (taken from the i915 driver), a CRTC, connector and
457encoder combination is created. A device-specific i2c bus is also
458created for fetching EDID data and performing monitor detection. Once
459the process is complete, the new connector is registered with sysfs to
460make its properties available to applications.
461
2fa91d15 462KMS Locking
311b62d9 463===========
2fa91d15
JN
464
465.. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c
466 :doc: kms locking
467
468.. kernel-doc:: include/drm/drm_modeset_lock.h
469 :internal:
470
471.. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c
472 :export:
473
474KMS Properties
475==============
476
477Drivers may need to expose additional parameters to applications than
478those described in the previous sections. KMS supports attaching
479properties to CRTCs, connectors and planes and offers a userspace API to
480list, get and set the property values.
481
482Properties are identified by a name that uniquely defines the property
483purpose, and store an associated value. For all property types except
484blob properties the value is a 64-bit unsigned integer.
485
486KMS differentiates between properties and property instances. Drivers
487first create properties and then create and associate individual
488instances of those properties to objects. A property can be instantiated
489multiple times and associated with different objects. Values are stored
490in property instances, and all other property information are stored in
491the property and shared between all instances of the property.
492
493Every property is created with a type that influences how the KMS core
494handles the property. Supported property types are
495
496DRM_MODE_PROP_RANGE
497 Range properties report their minimum and maximum admissible values.
498 The KMS core verifies that values set by application fit in that
499 range.
500
501DRM_MODE_PROP_ENUM
502 Enumerated properties take a numerical value that ranges from 0 to
503 the number of enumerated values defined by the property minus one,
504 and associate a free-formed string name to each value. Applications
505 can retrieve the list of defined value-name pairs and use the
506 numerical value to get and set property instance values.
507
508DRM_MODE_PROP_BITMASK
509 Bitmask properties are enumeration properties that additionally
510 restrict all enumerated values to the 0..63 range. Bitmask property
511 instance values combine one or more of the enumerated bits defined
512 by the property.
513
514DRM_MODE_PROP_BLOB
515 Blob properties store a binary blob without any format restriction.
516 The binary blobs are created as KMS standalone objects, and blob
517 property instance values store the ID of their associated blob
518 object.
519
520 Blob properties are only used for the connector EDID property and
521 cannot be created by drivers.
522
523To create a property drivers call one of the following functions
524depending on the property type. All property creation functions take
525property flags and name, as well as type-specific arguments.
526
527- struct drm_property \*drm_property_create_range(struct
528 drm_device \*dev, int flags, const char \*name, uint64_t min,
529 uint64_t max);
530 Create a range property with the given minimum and maximum values.
531
532- struct drm_property \*drm_property_create_enum(struct drm_device
533 \*dev, int flags, const char \*name, const struct
534 drm_prop_enum_list \*props, int num_values);
535 Create an enumerated property. The ``props`` argument points to an
536 array of ``num_values`` value-name pairs.
537
538- struct drm_property \*drm_property_create_bitmask(struct
539 drm_device \*dev, int flags, const char \*name, const struct
540 drm_prop_enum_list \*props, int num_values);
541 Create a bitmask property. The ``props`` argument points to an array
542 of ``num_values`` value-name pairs.
543
544Properties can additionally be created as immutable, in which case they
545will be read-only for applications but can be modified by the driver. To
546create an immutable property drivers must set the
547DRM_MODE_PROP_IMMUTABLE flag at property creation time.
548
549When no array of value-name pairs is readily available at property
550creation time for enumerated or range properties, drivers can create the
551property using the :c:func:`drm_property_create()` function and
552manually add enumeration value-name pairs by calling the
553:c:func:`drm_property_add_enum()` function. Care must be taken to
554properly specify the property type through the ``flags`` argument.
555
556After creating properties drivers can attach property instances to CRTC,
557connector and plane objects by calling the
558:c:func:`drm_object_attach_property()`. The function takes a
559pointer to the target object, a pointer to the previously created
560property and an initial instance value.
561
52a9fcda
DV
562Blending and Z-Position properties
563----------------------------------
564
565.. kernel-doc:: drivers/gpu/drm/drm_blend.c
566 :export:
567
2fa91d15
JN
568Existing KMS Properties
569-----------------------
570
571The following table gives description of drm properties exposed by
572various modules/drivers.
573
574.. csv-table::
575 :header-rows: 1
576 :file: kms-properties.csv
577
578Vertical Blanking
579=================
580
581Vertical blanking plays a major role in graphics rendering. To achieve
582tear-free display, users must synchronize page flips and/or rendering to
583vertical blanking. The DRM API offers ioctls to perform page flips
584synchronized to vertical blanking and wait for vertical blanking.
585
586The DRM core handles most of the vertical blanking management logic,
587which involves filtering out spurious interrupts, keeping race-free
588blanking counters, coping with counter wrap-around and resets and
589keeping use counts. It relies on the driver to generate vertical
590blanking interrupts and optionally provide a hardware vertical blanking
591counter. Drivers must implement the following operations.
592
593- int (\*enable_vblank) (struct drm_device \*dev, int crtc); void
594 (\*disable_vblank) (struct drm_device \*dev, int crtc);
595 Enable or disable vertical blanking interrupts for the given CRTC.
596
597- u32 (\*get_vblank_counter) (struct drm_device \*dev, int crtc);
598 Retrieve the value of the vertical blanking counter for the given
599 CRTC. If the hardware maintains a vertical blanking counter its value
600 should be returned. Otherwise drivers can use the
601 :c:func:`drm_vblank_count()` helper function to handle this
602 operation.
603
604Drivers must initialize the vertical blanking handling core with a call
605to :c:func:`drm_vblank_init()` in their load operation.
606
607Vertical blanking interrupts can be enabled by the DRM core or by
608drivers themselves (for instance to handle page flipping operations).
609The DRM core maintains a vertical blanking use count to ensure that the
610interrupts are not disabled while a user still needs them. To increment
611the use count, drivers call :c:func:`drm_vblank_get()`. Upon
612return vertical blanking interrupts are guaranteed to be enabled.
613
614To decrement the use count drivers call
615:c:func:`drm_vblank_put()`. Only when the use count drops to zero
616will the DRM core disable the vertical blanking interrupts after a delay
617by scheduling a timer. The delay is accessible through the
618vblankoffdelay module parameter or the ``drm_vblank_offdelay`` global
619variable and expressed in milliseconds. Its default value is 5000 ms.
620Zero means never disable, and a negative value means disable
621immediately. Drivers may override the behaviour by setting the
622:c:type:`struct drm_device <drm_device>`
623vblank_disable_immediate flag, which when set causes vblank interrupts
624to be disabled immediately regardless of the drm_vblank_offdelay
625value. The flag should only be set if there's a properly working
626hardware vblank counter present.
627
628When a vertical blanking interrupt occurs drivers only need to call the
629:c:func:`drm_handle_vblank()` function to account for the
630interrupt.
631
632Resources allocated by :c:func:`drm_vblank_init()` must be freed
633with a call to :c:func:`drm_vblank_cleanup()` in the driver unload
634operation handler.
635
636Vertical Blanking and Interrupt Handling Functions Reference
637------------------------------------------------------------
638
639.. kernel-doc:: drivers/gpu/drm/drm_irq.c
640 :export:
641
34a67dd7
DV
642.. kernel-doc:: include/drm/drm_irq.h
643 :internal: