[RFC PATCH 03/22] drm/i915: Wait dma fences in dirtyfb callback
Jouni Högander
jouni.hogander at intel.com
Fri Mar 24 08:07:23 UTC 2023
We are targeting to get rid of frontbuffer tracking code. this
becomes as a problem as GPU frontbuffer rendering together with
features like psr, fbc and drrs are relying on frontbuffer flush
being called when rendering completes.
This patch is adding wait for all dma fences related to buffer into
framebuffer dirtyfb callback: GPU rendering completion is waited in
dirtyfb callback. This is expecting user-space using frontbuffer
rendering is doing dirtyfb ioctl after starting the rendering.
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
drivers/gpu/drm/i915/display/intel_fb.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 69b19e4721c3..c739a1fb395d 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -7,6 +7,7 @@
#include <drm/drm_framebuffer.h>
#include <drm/drm_modeset_helper.h>
+#include "i915_config.h"
#include "i915_drv.h"
#include "intel_display.h"
#include "intel_display_types.h"
@@ -1860,6 +1861,12 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
unsigned int num_clips)
{
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+ struct drm_i915_private *i915 = to_i915(fb->dev);
+ long ret;
+
+ ret = dma_resv_wait_timeout(obj->base.resv, dma_resv_usage_rw(false),
+ true, i915_fence_timeout(i915));
+ drm_WARN_ON(&(i915)->drm, ret <= 0);
i915_gem_object_flush_if_display(obj);
intel_frontbuffer_flush(to_intel_framebuffer(fb), ORIGIN_DIRTYFB);
--
2.34.1
More information about the Intel-gfx-trybot
mailing list