[Intel-gfx] [RFC PATCH v2 0/1] Splitting up platform-specific calls

Jani Nikula jani.nikula at intel.com
Fri Feb 11 11:55:02 UTC 2022

On Thu, 10 Feb 2022, Casey Bowman <casey.g.bowman at intel.com> wrote:
> In this RFC I would like to ask the community their thoughts
> on how we can best handle splitting architecture-specific
> calls.
> I would like to address the following:
> 1. How do we want to split architecture calls? Different object files
> per platform? Separate function calls within the same object file?
> 2. How do we address dummy functions? If we have a function call that is
> used for one or more platforms, but is not used in another, what should
> we do for this case?
> I've given an example of splitting an architecture call
> in my patch with run_as_guest() being split into different
> implementations for x86 and arm64 in separate object files, sharing
> a single header.
> Another suggestion from Michael (michael.cheng at intel.com) involved
> using a single object file, a single header, and splitting various
> functions calls via ifdefs in the header file.
> I would appreciate any input on how we can avoid scaling issues when
> including multiple architectures and multiple functions (as the number
> of function calls will inevitably increase with more architectures).
> v2: Revised to use kernel's platform-splitting scheme.

I think this is overengineering.

Just add different implementations of the functions per architecture
next to where they are now, like I suggested before.

If we need to split them better later, it'll be a trivial undertaking,
and we'll be in a better position to do it because we'll know how many
functions there'll be and where they are and what they do.

Adding a bunch of overhead from the start seems like the wrong thing to


> Casey Bowman (1):
>   i915/drm: Split out x86 and arm64 functionality
>  drivers/gpu/drm/i915/Makefile                         |  3 +++
>  drivers/gpu/drm/i915/i915_drv.h                       |  7 ++-----
>  drivers/gpu/drm/i915/platforms/Makefile               |  8 ++++++++
>  .../arm64/include/platform/i915_hypervisor.h          | 11 +++++++++++
>  .../platforms/x86/include/platform/i915_hypervisor.h  |  9 +++++++++
>  5 files changed, 33 insertions(+), 5 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/platforms/Makefile
>  create mode 100644 drivers/gpu/drm/i915/platforms/arm64/include/platform/i915_hypervisor.h
>  create mode 100644 drivers/gpu/drm/i915/platforms/x86/include/platform/i915_hypervisor.h

Jani Nikula, Intel Open Source Graphics Center

More information about the Intel-gfx mailing list