Frontbuffer tracking and dirtyfb
v2 cover Frontbuffer tracking and dirtyfb
Generic dirtyfb implementation which Xe is currently using is doing atomic commit which is inefficient. We have now dma fence handling in our dirtyfb implementation. This works with Xe and CPU/GPU frontbuffer rendering as long as sync objects are imported by userspace (dma_buf_import_sync_file).
v2: rebased
Jouni Högander (4):
fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display Revert "FIXME: drm/i915: More display ugly wa needed after rebase" drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base fixup! FIXME: drm/i915/display: Remaining changes to make xe compile
drivers/gpu/drm/i915/display/intel_fb.c | 10 ++-------- drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 -- .../gem/i915_gem_object_frontbuffer.h | 1 - drivers/gpu/drm/xe/xe_bo.h | 2 ++ 4 files changed, 4 insertions(+), 11 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/4 fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display
--- .../xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h | 1 - drivers/gpu/drm/xe/xe_bo.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h +0 -1
@@ -8,6 +8,5 @@#define i915_gem_object_get_frontbuffer (obj) NULL#define i915_gem_object_set_frontbuffer (obj, front) (front) -#define i915_gem_object_flush_if_display (obj) ((void)(obj))#endif
drivers/gpu/drm/xe/xe_bo.h +2 -0
@@ -316,6 +316,8 @@ static inline unsigned int xe_sg_segment_size(struct device *dev)return round_down (max /2 ,PAGE_SIZE ); } +#define i915_gem_object_flush_if_display (obj) ((void)(obj)) +#if IS_ENABLED (CONFIG_DRM_XE_KUNIT_TEST )/** * xe_bo_is_mem_type - Whether the bo currently resides in the given
Signature · 1 line
2.34.1
PATCH v2 2/4 Revert "FIXME: drm/i915: More display ugly wa needed after rebase"
In reply to Jouni HöganderThis reverts commit 4bf10efdff69a34bfa55813593bfecbf6f5d6db9.
We have now emtpy define for i915_gem_object_flush_if_display about to enable custom dirtyfb for Xe as well.
--- drivers/gpu/drm/i915/display/intel_fb.c | 2 +- drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_fb.c +1 -1
@@ -1939,7 +1939,6 @@ struct frontbuffer_fence_cb {struct intel_frontbuffer *front; }; -#ifdef I915 static void intel_user_framebuffer_fence_wake (struct dma_fence *dma,struct dma_fence_cb *data) {
@@ -1950,6 +1949,7 @@ static void intel_user_framebuffer_fence_wake(struct dma_fence *dma,dma_fence_put (dma); } +#ifdef I915 static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, struct drm_file *file, unsigned int flags, unsigned int color,
drivers/gpu/drm/i915/display/intel_frontbuffer.c +0 -2
@@ -209,9 +209,7 @@ static void intel_frontbuffer_flush_work(struct work_struct *work)struct intel_frontbuffer *front = container_of(work, struct intel_frontbuffer, flush_work); -#ifdef I915 i915_gem_object_flush_if_display (front->obj); -#endif intel_frontbuffer_flush (front,ORIGIN_DIRTYFB );intel_frontbuffer_put (front); }
Signature · 1 line
2.34.1
PATCH v2 3/4 drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base
In reply to Jouni HöganderXe and i915 objects have differing implementation. Use intel_bo_to_drm_bo instead of obj->base as xe_bo doesn't have base pointer.
--- drivers/gpu/drm/i915/display/intel_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_fb.c +2 -2
@@ -1965,10 +1965,10 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,if (!atomic_read (&front->bits))return 0 ; -if (dma_resv_test_signaled (obj->base.resv,dma_resv_usage_rw (false))) +if (dma_resv_test_signaled (intel_bo_to_drm_bo (obj)->resv,dma_resv_usage_rw (false))) goto flush; - ret =dma_resv_get_singleton (obj->base.resv,dma_resv_usage_rw (false), + ret =dma_resv_get_singleton (intel_bo_to_drm_bo (obj)->resv,dma_resv_usage_rw (false), &fence);if (ret || !fence) goto flush;
Signature · 1 line
2.34.1
PATCH v2 4/4 fixup! FIXME: drm/i915/display: Remaining changes to make xe compile
In reply to Jouni HöganderGeneric dirtyfb implementation which Xe is currently using is doing atomic commit which is inefficient. We have now dma fence handling in our dirtyfb implementation. This works with Xe and CPU/GPU frontbuffer rendering as long as sync objects are imported by userspace (dma_buf_import_sync_file). Switch to our custom dirtyfb implementation.
--- drivers/gpu/drm/i915/display/intel_fb.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/i915/display/intel_fb.c +0 -6
@@ -1949,7 +1949,6 @@ static void intel_user_framebuffer_fence_wake(struct dma_fence *dma,dma_fence_put (dma); } -#ifdef I915 static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, struct drm_file *file, unsigned int flags, unsigned int color,
@@ -1999,16 +1998,11 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,intel_frontbuffer_flush (front,ORIGIN_DIRTYFB );return ret; } -#endif static const struct drm_framebuffer_funcs intel_fb_funcs = { .destroy = intel_user_framebuffer_destroy, .create_handle = intel_user_framebuffer_create_handle, -#ifdef I915 .dirty = intel_user_framebuffer_dirty, -#else - .dirty = drm_atomic_helper_dirtyfb, -#endif }; int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
Signature · 1 line
2.34.1
Patchwork
CI[Intel-xe] ✗ CI.Patch_applied: failure for Frontbuffer tracking and dirtyfb (rev2)
In reply to Jouni Högander== Series Details ==
== Series Details ==
Series: Frontbuffer tracking and dirtyfb (rev2)
URL : https://patchwork.freedesktop.org/series/123751/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: 22fcf2404 drm/xe: timeout needs to be a signed value
=== git am output follows ===
error: patch failed: drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h:8
error: drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display
Patch failed at 0001 fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".