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

Francois Dugast francois.dugast at intel.com
Tue Mar 14 15:51:08 UTC 2023


This patch series explores a code split between common code and
platform specific code. 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
separate functions, potentially in their own file.

v2:
  - Remove platform files and leave platform specific code along common
    code to ease the use of helpers
  - Break down global function pointer structure into smaller
    structures defined and initialized locally per area / compilation unit
    in order to limit exposure of inner details
  - Refactor functions in xe_guc_pc.c to provide more examples
  - Add fake new platform to show impact on code

Francois Dugast (3):
  drm/xe: Introduce function pointers in xe_gt.c with local structure
  drm/xe: Introduce function pointers in xe_guc_pc.c with local
    structure
  drm/xe: Add platform specific functions for a new platform

 drivers/gpu/drm/xe/Makefile            |  1 +
 drivers/gpu/drm/xe/xe_device_types.h   |  2 ++
 drivers/gpu/drm/xe/xe_gt.c             | 50 ++++++++++++++++++--------
 drivers/gpu/drm/xe/xe_guc_pc.c         | 48 ++++++++++++++++++++-----
 drivers/gpu/drm/xe/xe_newplatform.c    | 21 +++++++++++
 drivers/gpu/drm/xe/xe_newplatform.h    | 15 ++++++++
 drivers/gpu/drm/xe/xe_platform_types.h |  1 +
 7 files changed, 115 insertions(+), 23 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_newplatform.c
 create mode 100644 drivers/gpu/drm/xe/xe_newplatform.h

-- 
2.25.1



More information about the Intel-xe mailing list