All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb
@ 2023-10-02  9:15 Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display Jouni Högander
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jouni Högander @ 2023-10-02  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Jouni Högander, Jani Nikula

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

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display
  2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
@ 2023-10-02  9:15 ` Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 2/4] Revert "FIXME: drm/i915: More display ugly wa needed after rebase" Jouni Högander
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jouni Högander @ 2023-10-02  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Jouni Högander

---
 .../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(-)

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
index 2361a6313308..227965e5f784 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
@@ -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
diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h
index 5090bdd1e462..e5e8173433c3 100644
--- a/drivers/gpu/drm/xe/xe_bo.h
+++ b/drivers/gpu/drm/xe/xe_bo.h
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-xe] [PATCH v2 2/4] Revert "FIXME: drm/i915: More display ugly wa needed after rebase"
  2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display Jouni Högander
@ 2023-10-02  9:15 ` Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 3/4] drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base Jouni Högander
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jouni Högander @ 2023-10-02  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Jouni Högander

This reverts commit 4bf10efdff69a34bfa55813593bfecbf6f5d6db9.

We have now emtpy define for i915_gem_object_flush_if_display about
to enable custom dirtyfb for Xe as well.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 961fa778ba88..abca5a3652d4 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -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,
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index b80cf8fb1c97..d64ce5bfeca8 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -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);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-xe] [PATCH v2 3/4] drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base
  2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 2/4] Revert "FIXME: drm/i915: More display ugly wa needed after rebase" Jouni Högander
@ 2023-10-02  9:15 ` Jouni Högander
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 4/4] fixup! FIXME: drm/i915/display: Remaining changes to make xe compile Jouni Högander
  2023-10-02  9:18 ` [Intel-xe] ✗ CI.Patch_applied: failure for Frontbuffer tracking and dirtyfb (rev2) Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Jouni Högander @ 2023-10-02  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Jouni Högander

Xe and i915 objects have differing implementation. Use intel_bo_to_drm_bo
instead of obj->base as xe_bo doesn't have base pointer.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index abca5a3652d4..6aa1a6ac0728 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-xe] [PATCH v2 4/4] fixup! FIXME: drm/i915/display: Remaining changes to make xe compile
  2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
                   ` (2 preceding siblings ...)
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 3/4] drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base Jouni Högander
@ 2023-10-02  9:15 ` Jouni Högander
  2023-10-02  9:18 ` [Intel-xe] ✗ CI.Patch_applied: failure for Frontbuffer tracking and dirtyfb (rev2) Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Jouni Högander @ 2023-10-02  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Jouni Högander

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). Switch to our custom dirtyfb implementation.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 6aa1a6ac0728..fd0b978dbef9 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -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,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-xe] ✗ CI.Patch_applied: failure for Frontbuffer tracking and dirtyfb (rev2)
  2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
                   ` (3 preceding siblings ...)
  2023-10-02  9:15 ` [Intel-xe] [PATCH v2 4/4] fixup! FIXME: drm/i915/display: Remaining changes to make xe compile Jouni Högander
@ 2023-10-02  9:18 ` Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-10-02  9:18 UTC (permalink / raw)
  To: Jouni Högander; +Cc: intel-xe

== 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".



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-02  9:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02  9:15 [Intel-xe] [PATCH v2 0/4] Frontbuffer tracking and dirtyfb Jouni Högander
2023-10-02  9:15 ` [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Add empty def for i915_gem_object_flush_if_display Jouni Högander
2023-10-02  9:15 ` [Intel-xe] [PATCH v2 2/4] Revert "FIXME: drm/i915: More display ugly wa needed after rebase" Jouni Högander
2023-10-02  9:15 ` [Intel-xe] [PATCH v2 3/4] drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base Jouni Högander
2023-10-02  9:15 ` [Intel-xe] [PATCH v2 4/4] fixup! FIXME: drm/i915/display: Remaining changes to make xe compile Jouni Högander
2023-10-02  9:18 ` [Intel-xe] ✗ CI.Patch_applied: failure for Frontbuffer tracking and dirtyfb (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.