diff options
author | Jouni Högander <jouni.hogander@intel.com> | 2023-09-01 12:34:59 +0300 |
---|---|---|
committer | Jouni Högander <jouni.hogander@intel.com> | 2023-09-04 12:04:07 +0300 |
commit | 40320844ca8bda4def0f04d2bd8c2022c867ed86 (patch) | |
tree | 6aea1d5b78848f8b8334e40f2985444dce2633ee /drivers/gpu/drm/i915/display/intel_frontbuffer.h | |
parent | 35a97f56d6ccf1870e666fb6efa12a7ec201b9e4 (diff) | |
download | linux-40320844ca8bda4def0f04d2bd8c2022c867ed86.tar.gz linux-40320844ca8bda4def0f04d2bd8c2022c867ed86.tar.bz2 linux-40320844ca8bda4def0f04d2bd8c2022c867ed86.zip |
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
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_frontbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_frontbuffer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.h b/drivers/gpu/drm/i915/display/intel_frontbuffer.h index 72d89be3284b..abb51e8bb920 100644 --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.h +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.h @@ -46,6 +46,8 @@ struct intel_frontbuffer { struct i915_active write; struct drm_i915_gem_object *obj; struct rcu_head rcu; + + struct work_struct flush_work; }; /* @@ -135,6 +137,8 @@ static inline void intel_frontbuffer_flush(struct intel_frontbuffer *front, __intel_fb_flush(front, origin, frontbuffer_bits); } +void intel_frontbuffer_queue_flush(struct intel_frontbuffer *front); + void intel_frontbuffer_track(struct intel_frontbuffer *old, struct intel_frontbuffer *new, unsigned int frontbuffer_bits); |