From 30d23f220c75cf58584b19929bd8460b4edc9771 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 5 Apr 2018 17:44:46 +0200 Subject: drm/atomic: better doc for implicit vs explicit fencing Note that a pile of drivers don't seem to take implicit fencing into account, or at least don't call drm_atoimc_set_fence_for_plane(). Cc'ing relevant people, or at least some. Some drivers also look like they don't disable implicit fencing (e.g. amdgpu) because the explicit fences and implicit fences are handled by entirely independent code paths. I also wonder whether we shouldn't just make the recommended helpers the default ones, since a lot of drivers don't bother to handle the implicit fences at all it seems. The helpers won't blow up even for non-GEM drivers or GEM drivers which don't fill out the gem bo pointers in struct drm_framebuffer. v2: Comments from Eric. Cc: Gerd Hoffmann Cc: Alex Deucher Cc: Harry Wentland Cc: Sinclair Yeh Cc: Thomas Hellstrom Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180405154449.23038-7-daniel.vetter@ffwll.ch --- include/drm/drm_plane.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/drm/drm_plane.h') diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 9563bd25f19b..26fa50c2a50e 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -80,8 +80,15 @@ struct drm_plane_state { /** * @fence: * - * Optional fence to wait for before scanning out @fb. Do not write this - * directly, use drm_atomic_set_fence_for_plane() + * Optional fence to wait for before scanning out @fb. The core atomic + * code will set this when userspace is using explicit fencing. Do not + * write this directly for a driver's implicit fence, use + * drm_atomic_set_fence_for_plane() to ensure that an explicit fence is + * preserved. + * + * Drivers should store any implicit fence in this from their + * &drm_plane_helper.prepare_fb callback. See drm_gem_fb_prepare_fb() + * and drm_gem_fb_simple_display_pipe_prepare_fb() for suitable helpers. */ struct dma_fence *fence; -- cgit v1.2.3