aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-07-03 03:50:19 -0400
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-07-07 01:53:09 -0400
commitb25c60af7a8773694a505cdb0d2e67807243217d (patch)
tree0d0cddb6694d71108605e11633689a21917d766f /include/drm/drm_crtc.h
parent184d3cf4f73896267340cf06acfa751fad4f8dd2 (diff)
drm/crtc: Add a generic infrastructure to fake VBLANK events
In some cases CRTCs are active but are not able to generating events, at least not at every frame at it's expected to. This is typically the case when the CRTC is feeding a writeback connector that has no job queued. In this situation the CRTC is usually stopped until a new job is queued, and this can lead to timeouts when part of the pipeline is updated but no new jobs are queued to the active writeback connector. In order to solve that, we add a ->no_vblank flag to drm_crtc_state and ask the CRTC drivers to set it to true when they know they're not able to generate VBLANK events. The core drm_atomic_helper_fake_vblank() helper can then be used to fake VBLANKs at commit time. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-6-boris.brezillon@bootlin.com
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 23eddbccab10..17f4f93340b8 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -119,6 +119,29 @@ struct drm_crtc_state {
119 bool zpos_changed : 1; 119 bool zpos_changed : 1;
120 bool color_mgmt_changed : 1; 120 bool color_mgmt_changed : 1;
121 121
122 /**
123 * @no_vblank:
124 *
125 * Reflects the ability of a CRTC to send VBLANK events. This state
126 * usually depends on the pipeline configuration, and the main usuage
127 * is CRTCs feeding a writeback connector operating in oneshot mode.
128 * In this case the VBLANK event is only generated when a job is queued
129 * to the writeback connector, and we want the core to fake VBLANK
130 * events when this part of the pipeline hasn't changed but others had
131 * or when the CRTC and connectors are being disabled.
132 *
133 * __drm_atomic_helper_crtc_duplicate_state() will not reset the value
134 * from the current state, the CRTC driver is then responsible for
135 * updating this field when needed.
136 *
137 * Note that the combination of &drm_crtc_state.event == NULL and
138 * &drm_crtc_state.no_blank == true is valid and usually used when the
139 * writeback connector attached to the CRTC has a new job queued. In
140 * this case the driver will send the VBLANK event on its own when the
141 * writeback job is complete.
142 */
143 bool no_vblank : 1;
144
122 /* attached planes bitmask: 145 /* attached planes bitmask:
123 * WARNING: transitional helpers do not maintain plane_mask so 146 * WARNING: transitional helpers do not maintain plane_mask so
124 * drivers not converted over to atomic helpers should not rely 147 * drivers not converted over to atomic helpers should not rely