[Intel-xe] [RFC PATCH 00/20] Xe frontbuffer tracking

Jouni Högander jouni.hogander at intel.com
Fri May 5 08:29:36 UTC 2023


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.

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

Jouni Högander (20):
  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/display: Change __intel_frontbuffer_get parameter
  drm/i915: Add macros to get i915 device from i915_gem_object
  drm/xe: Add macro to get i915 device from xe_bo
  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 related headers
  drm/i915: Add function to clear scanout flag for vmas
  drm/xe: Add function to clear scanout flag
  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  | 132 ++++++++++++++++--
 .../gpu/drm/i915/display/intel_frontbuffer.h  |  72 ++++++++--
 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    |  25 ++++
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |  22 +++
 .../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            |   2 -
 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  |  12 ++
 .../compat-i915-headers/i915_active_types.h   |  12 ++
 .../gpu/drm/xe/compat-i915-headers/i915_vma.h |  13 +-
 drivers/gpu/drm/xe/display/xe_plane_initial.c |   2 +-
 drivers/gpu/drm/xe/xe_bo_types.h              |   7 +
 29 files changed, 442 insertions(+), 49 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_active.h

-- 
2.34.1



More information about the Intel-xe mailing list