diff mbox

drm/doc: document fallback behaviour for atomic events

Message ID 20170307003653.11645-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter March 7, 2017, 12:36 a.m. UTC
Worst case if the hw can't support completion signalling in a
race-free way we want the event to be too late, not too early.

Text adapted from a proposal from Laurent - the other side of how to
make hw work correctly where it's possible is imo already sufficiently
documented.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 include/drm/drm_crtc.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Laurent Pinchart March 7, 2017, 6:02 a.m. UTC | #1
Hi Daniel,

Thank you for the patch.

On Tuesday 07 Mar 2017 01:36:53 Daniel Vetter wrote:
> Worst case if the hw can't support completion signalling in a
> race-free way we want the event to be too late, not too early.
> 
> Text adapted from a proposal from Laurent - the other side of how to
> make hw work correctly where it's possible is imo already sufficiently
> documented.
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  include/drm/drm_crtc.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index bda9347554a1..444200017f8c 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -204,6 +204,13 @@ struct drm_crtc_state {
>  	 * drm_crtc_arm_vblank_event(). See the documentation of that function
>  	 * for a detailed discussion of the constraints it needs to be used
>  	 * safely.
> +	 *
> +	 * If the device can't notify of flip completion in a race-free way in

s/ in$//

> +	 * at all, then the event should be armed just after the page flip is
> +	 * committed. In the worst case the driver will send the event to
> +	 * userspace one frame too late. This doesn't allow for a real atomic
> +	 * update, but it should avoid tearing. The R-Car Gen2 hardware falls
> +	 * in this category.

I'm not sure would special-case R-Car Gen2 here :-)

>  	 */
>  	struct drm_pending_vblank_event *event;
diff mbox

Patch

diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index bda9347554a1..444200017f8c 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -204,6 +204,13 @@  struct drm_crtc_state {
 	 * drm_crtc_arm_vblank_event(). See the documentation of that function
 	 * for a detailed discussion of the constraints it needs to be used
 	 * safely.
+	 *
+	 * If the device can't notify of flip completion in a race-free way in
+	 * at all, then the event should be armed just after the page flip is
+	 * committed. In the worst case the driver will send the event to
+	 * userspace one frame too late. This doesn't allow for a real atomic
+	 * update, but it should avoid tearing. The R-Car Gen2 hardware falls
+	 * in this category.
 	 */
 	struct drm_pending_vblank_event *event;