drm/i915: Add new frontbuffer tracking interface to queue flush
authorJouni Högander <jouni.hogander@intel.com>
Fri, 1 Sep 2023 09:34:59 +0000 (12:34 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Mon, 4 Sep 2023 09:04:07 +0000 (12:04 +0300)
commit40320844ca8bda4def0f04d2bd8c2022c867ed86
tree6aea1d5b78848f8b8334e40f2985444dce2633ee
parent35a97f56d6ccf1870e666fb6efa12a7ec201b9e4
drm/i915: Add new frontbuffer tracking interface to queue flush

We want to wait dma fences in dirtyfb ioctl. As we don't want to make
dirtyfb ioctl as blocking call we need to use
dma_fence_add_callback. Callback used for dma_fence_add_callback is
called from atomic context. Due to this we need to add a new
frontbuffer tracking interface to queue flush.

v3:
 - Check schedule work success rather than work being pending
 - Init flush work when frontbuffer struct is initialized
v2: Check if flush work is already pending

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901093500.3463046-4-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_frontbuffer.c
drivers/gpu/drm/i915/display/intel_frontbuffer.h