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

Jouni Högander jouni.hogander at intel.com
Wed May 10 12:11:29 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. 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 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 (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



More information about the Intel-xe mailing list