@@ -29,6 +29,9 @@ subdir-ccflags-y += -I$(srctree)/$(src)
# Please keep these build lists sorted!
+# arch support
+include $(src)/platforms/Makefile
+
# core driver code
i915-y += i915_driver.o \
i915_config.o \
@@ -87,6 +87,8 @@
#include "gt/intel_workarounds.h"
#include "gt/uc/intel_uc.h"
+#include "platform/i915_hypervisor.h"
+
#include "intel_device_info.h"
#include "intel_memory_region.h"
#include "intel_pch.h"
@@ -1498,11 +1500,6 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
#define INTEL_DISPLAY_ENABLED(dev_priv) \
(drm_WARN_ON(&(dev_priv)->drm, !HAS_DISPLAY(dev_priv)), !(dev_priv)->params.disable_display)
-static inline bool run_as_guest(void)
-{
- return !hypervisor_is_type(X86_HYPER_NATIVE);
-}
-
#define HAS_D12_PLANE_MINIMIZATION(dev_priv) (IS_ROCKETLAKE(dev_priv) || \
IS_ALDERLAKE_S(dev_priv))
new file mode 100644
@@ -0,0 +1,8 @@
+ifdef CONFIG_X86
+ccflags-y += -I $(srctree)/$(src)/platforms/x86/include/
+endif
+
+ifdef CONFIG_ARM64
+ccflags-y += -I $(srctree)/$(src)/platforms/arm64/include/
+endif
+
new file mode 100644
@@ -0,0 +1,11 @@
+#ifndef _I915_HYPERVISOR_
+#define _I915_HYPERVISOR_
+
+
+/* Not supported for arm64, so we return */
+static inline bool run_as_guest(void)
+{
+ return false;
+}
+
+#endif
new file mode 100644
@@ -0,0 +1,9 @@
+#ifndef _I915_HYPERVISOR_
+#define _I915_HYPERVISOR_
+
+static inline bool run_as_guest(void)
+{
+ return !hypervisor_is_type(X86_HYPER_NATIVE);
+}
+
+#endif
Some x86 checks are unnecessary on arm64 systems, so they are being split out to avoid being used. We are starting the split with run_as_guest(), which has an x86-specific usage, while on arm64, we aren't using it. The split reflects the way the kernel currently handles platform-specific libraries, but these calls are localized to i915. Signed-off-by: Casey Bowman <casey.g.bowman@intel.com> --- 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