[Intel-xe] [RFC PATCH 0/4] Split code between common and platform specific

Francois Dugast francois.dugast at intel.com
Fri Mar 3 14:50:11 UTC 2023


This patch series explores a code split between common code and
platform specific code, which is moved to separate files. The
minimal hardware abstraction layer is implemented with a structure
of function pointers, similarly to what is done in accel/habanalabs
and in drm/amd/amdgpu.

The objective is to ease the addition of new platforms by limiting
the need to modify the common code and centralizing specific code in
a platform file, potentially in its platform directory.

For now only one function has been refactored as an example
(setup_private_ppat) but this shows already how platform specific
code and platform switches can be moved out of xe_gt.c.

Francois Dugast (4):
  drm/xe/gt: Move ppat defines to a common file
  drm/xe: Move setup_private_ppat functions to platform files
  drm/xe: Add function pointers for platform specific code
  drm/xe: Add function pointers for all supported platforms

 drivers/gpu/drm/xe/Makefile           |  8 +++
 drivers/gpu/drm/xe/xe_device.c        | 32 ++++++++++
 drivers/gpu/drm/xe/xe_device_types.h  |  2 +
 drivers/gpu/drm/xe/xe_gt.c            | 87 +++------------------------
 drivers/gpu/drm/xe/xe_gt_ppat.h       | 33 ++++++++++
 drivers/gpu/drm/xe/xe_platform.h      | 31 ++++++++++
 drivers/gpu/drm/xe/xe_platform_adlp.c | 18 ++++++
 drivers/gpu/drm/xe/xe_platform_adls.c | 18 ++++++
 drivers/gpu/drm/xe/xe_platform_dg1.c  | 18 ++++++
 drivers/gpu/drm/xe/xe_platform_dg2.c  | 18 ++++++
 drivers/gpu/drm/xe/xe_platform_mtl.c  | 32 ++++++++++
 drivers/gpu/drm/xe/xe_platform_pvc.c  | 35 +++++++++++
 drivers/gpu/drm/xe/xe_platform_rkl.c  | 18 ++++++
 drivers/gpu/drm/xe/xe_platform_tgl.c  | 32 ++++++++++
 drivers/gpu/drm/xe/xe_platform_tgl.h  | 13 ++++
 15 files changed, 316 insertions(+), 79 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_gt_ppat.h
 create mode 100644 drivers/gpu/drm/xe/xe_platform.h
 create mode 100644 drivers/gpu/drm/xe/xe_platform_adlp.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_adls.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_dg1.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_dg2.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_mtl.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_pvc.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_rkl.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_tgl.c
 create mode 100644 drivers/gpu/drm/xe/xe_platform_tgl.h

-- 
2.25.1



More information about the Intel-xe mailing list