aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_utils.h
diff options
context:
space:
mode:
authorCasey Bowman2022-03-31 13:43:43 -0700
committerLucas De Marchi2022-04-06 09:02:37 -0700
commitc900a670362be43258a4a2ab8c37d5f0da714487 (patch)
treeac12142c323336e2d1926c555bc01c279e0b76d6 /drivers/gpu/drm/i915/i915_utils.h
parent805f04d42a6b5f4187935b43c9c39ae03ccfa761 (diff)
drm/i915: Split i915_run_as_guest into x86 and non-x86
Split i915_run_as_guest() into a more arch-friendly function as non-x86 builds do not support this functionality. Signed-off-by: Casey Bowman <casey.g.bowman@intel.com> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220331204343.1256150-2-casey.g.bowman@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_utils.h')
-rw-r--r--drivers/gpu/drm/i915/i915_utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index b2d89c43f24d..ea7648e3aa0e 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -32,7 +32,10 @@
#include <linux/types.h>
#include <linux/workqueue.h>
#include <linux/sched/clock.h>
+
+#ifdef CONFIG_X86
#include <asm/hypervisor.h>
+#endif
struct drm_i915_private;
struct timer_list;
@@ -428,7 +431,12 @@ static inline bool timer_expired(const struct timer_list *t)
static inline bool i915_run_as_guest(void)
{
+#if IS_ENABLED(CONFIG_X86)
return !hypervisor_is_type(X86_HYPER_NATIVE);
+#else
+ /* Not supported yet */
+ return false;
+#endif
}
bool i915_vtd_active(struct drm_i915_private *i915);