Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [RFC PATCH v2 00/23] Xe frontbuffer tracking
@ 2023-05-10 12:11 Jouni Högander
  2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 01/23] fixup! drm/i915/display: Remaining changes to make xe compile Jouni Högander
                   ` (26 more replies)
  0 siblings, 27 replies; 30+ messages in thread
From: Jouni Högander @ 2023-05-10 12:11 UTC (permalink / raw)
  To: intel-xe
  Cc: jani.nikula, Lucas De Marchi, Jouni Högander, Uma Shankar,
	Rodrigo Vivi, rodrigo.vivi, ville.syrjala

This patch set is taking frontbuffer tracking into use for Xe driver as
well.  This allows using custom dirtyfb ioctl implemented for i915 instead
of doing full atomic commit on dirtyfb ioctl. It also provides support for
CPU/GPU frontbuffer rendering with features like PSR, DRRS and FBC. Even as
frontbuffer tracking is targeted being discontinued it is seen as too risky
to remove it completely at this point.

DirtyFB IOCTL
Dirtyfb ioctl is modified to be dma fence aware:
1. If all the fences for the buffer dirtyfb ioctl is called on are all signaled
perform flush.
2. If there are unsignaled fences for the buffer perform invalidate and add
dma fence callback for them and initiate flushes when these each of these
happens. Also perfrom flush immediately on each fence which are already
signaled.

i915
Patch set is keeping current frontbuffer tracking implementation as it
is. It is just refactoring the code to allow using it with Xe driver as
well. I915 is currently using hooks in gem code to perform frontbuffer
tracking flush when GPU rendering completes. Patch set is initiating extra
flushes which are perform on dma fence signaling. This will be triggering
extra updates for features like PSR and FBC addition to the flush
triggerd by the gem hooks.

Xe
Instead of modifying frontbuffer tracking for Xe driver this patch set is
doing minimalistic changes to current implemenation and using it as needed
for Xe as well. Functionality is pretty much same as with i915 driver. As
Xe doesn't have gem hooks to trigger frontbuffer tracking flush it will be
relying completely on dirtyfb ioctl and frontbuffer tracking flush
initiated by the ioctl. This requires user-space using GPU frontbuffer
rendering to import completion fence using dmabuf_import_sync_file. Also
carrying intel_frontbuffer pointer in xe_bo is not done because we don't
really need that as we don't have those gem hooks.

Build Breakage
In current form this patch set is breaking build between patches 2-20. I
couldn't find reasonable way to keep build working as originally reverted
frontbuffer tracking removal patches (2-3) are breaking build. Then this
broken build is fixed later in several patches.

v2: Remove intel_frontbuffer pointer from struct xe_bo

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>

Jouni Högander (23):
  fixup! drm/i915/display: Remaining changes to make xe compile
  Revert "drm/i915/display: Neuter frontbuffer tracking harder"
  Revert "drm/i915: Remove gem and overlay frontbuffer tracking"
  fixup! drm/i915/display: Remaining changes to make xe compile
  fixup! drm/xe/display: Implement display support
  drm/i915: Add macros to get i915 device from i915_gem_object
  drm/xe: Add macro to get i915 device from xe_bo
  drm/i915: Add getter for i915_gem_object->frontbuffer
  drm/xe: Add frontbuffer setter/getter for xe_bo
  drm/i915/display: Remove i915_gem_object_types.h from
    intel_frontbuffer.h
  drm/xe: Add intel_bo_flush_if_display define for Xe
  drm/i915: Add intel_bo_flush_if_display define for i915
  drm/xe: Add struct i915_active for Xe
  drm/xe: Add i915_active.h compatibility header
  drm/xe/display: Include i916_active header
  drm/i915: Add function to clear scanout flag for vmas
  drm/xe: Add empty define for i915_ggtt_clear_scanout
  drm/i915/display: Use i915_ggtt_clear_scanout
  drm/i915/display: Use drm_gem_object_get/put
  drm/xe/display: Use frontbuffer tracking for Xe as well
  drm/i915: Add new frontbuffer tracking interface to queue flush
  drm/i915: Handle dma fences in dirtyfb callback
  drm/xe/display: Use custom dirtyfb for Xe as well

 drivers/gpu/drm/i915/display/i9xx_plane.c     |   1 -
 drivers/gpu/drm/i915/display/intel_cursor.c   |   6 +-
 drivers/gpu/drm/i915/display/intel_display.c  |   4 +-
 .../drm/i915/display/intel_display_types.h    |   8 +-
 drivers/gpu/drm/i915/display/intel_fb.c       |  75 +++++++++--
 drivers/gpu/drm/i915/display/intel_fb_pin.c   |   8 +-
 drivers/gpu/drm/i915/display/intel_fbdev.c    |   7 +-
 .../gpu/drm/i915/display/intel_frontbuffer.c  | 127 ++++++++++++++++--
 .../gpu/drm/i915/display/intel_frontbuffer.h  |  43 ++++--
 drivers/gpu/drm/i915/display/intel_overlay.c  |  14 ++
 .../drm/i915/display/intel_plane_initial.c    |   3 +-
 drivers/gpu/drm/i915/display/intel_sprite.c   |   1 -
 drivers/gpu/drm/i915/gem/i915_gem_clflush.c   |   4 +
 drivers/gpu/drm/i915/gem/i915_gem_domain.c    |   7 +
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_object.c    |  91 +++++++++++++
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |  28 ++++
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   5 +
 drivers/gpu/drm/i915/gem/i915_gem_phys.c      |   4 +
 drivers/gpu/drm/i915/i915_driver.c            |   1 -
 drivers/gpu/drm/i915/i915_gem.c               |   8 ++
 drivers/gpu/drm/i915/i915_gem_gtt.c           |   1 +
 drivers/gpu/drm/i915/i915_vma.c               |  32 +++++
 drivers/gpu/drm/i915/i915_vma.h               |   2 +
 .../drm/xe/compat-i915-headers/i915_active.h  |  22 +++
 .../compat-i915-headers/i915_active_types.h   |  13 ++
 .../gpu/drm/xe/compat-i915-headers/i915_vma.h |   2 +
 drivers/gpu/drm/xe/display/xe_plane_initial.c |   2 +-
 drivers/gpu/drm/xe/xe_bo.h                    |   9 ++
 drivers/gpu/drm/xe/xe_bo_types.h              |   5 +
 30 files changed, 488 insertions(+), 47 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_active.h

-- 
2.34.1


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

end of thread, other threads:[~2023-07-27  5:46 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 12:11 [Intel-xe] [RFC PATCH v2 00/23] Xe frontbuffer tracking Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 01/23] fixup! drm/i915/display: Remaining changes to make xe compile Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 02/23] Revert "drm/i915/display: Neuter frontbuffer tracking harder" Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 03/23] Revert "drm/i915: Remove gem and overlay frontbuffer tracking" Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 04/23] fixup! drm/i915/display: Remaining changes to make xe compile Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 05/23] fixup! drm/xe/display: Implement display support Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 06/23] drm/i915: Add macros to get i915 device from i915_gem_object Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 07/23] drm/xe: Add macro to get i915 device from xe_bo Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 08/23] drm/i915: Add getter for i915_gem_object->frontbuffer Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 09/23] drm/xe: Add frontbuffer setter/getter for xe_bo Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 10/23] drm/i915/display: Remove i915_gem_object_types.h from intel_frontbuffer.h Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 11/23] drm/xe: Add intel_bo_flush_if_display define for Xe Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 12/23] drm/i915: Add intel_bo_flush_if_display define for i915 Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 13/23] drm/xe: Add struct i915_active for Xe Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 14/23] drm/xe: Add i915_active.h compatibility header Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 15/23] drm/xe/display: Include i916_active header Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 16/23] drm/i915: Add function to clear scanout flag for vmas Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 17/23] drm/xe: Add empty define for i915_ggtt_clear_scanout Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 18/23] drm/i915/display: Use i915_ggtt_clear_scanout Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 19/23] drm/i915/display: Use drm_gem_object_get/put Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 20/23] drm/xe/display: Use frontbuffer tracking for Xe as well Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 21/23] drm/i915: Add new frontbuffer tracking interface to queue flush Jouni Högander
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 22/23] drm/i915: Handle dma fences in dirtyfb callback Jouni Högander
2023-07-13 20:08   ` Ville Syrjälä
2023-07-27  5:44     ` Hogander, Jouni
2023-05-10 12:11 ` [Intel-xe] [RFC PATCH v2 23/23] drm/xe/display: Use custom dirtyfb for Xe as well Jouni Högander
2023-05-10 12:16 ` [Intel-xe] ✓ CI.Patch_applied: success for Xe frontbuffer tracking (rev2) Patchwork
2023-05-10 12:18 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-10 12:21 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-10 12:47 ` [Intel-xe] ○ CI.BAT: info " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox