OSDN Git Service

drm/i915: define i915_ggtt_has_aperture
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Tue, 29 Oct 2019 09:58:50 +0000 (09:58 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 29 Oct 2019 10:31:40 +0000 (10:31 +0000)
The following patches in the series will use it to avoid certain
operations when the mappable aperture is not available in HW.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191029095856.25431-1-matthew.auld@intel.com
drivers/gpu/drm/i915/i915_gem_gtt.h

index f074f1d..402283c 100644 (file)
@@ -575,6 +575,11 @@ void i915_ggtt_disable_guc(struct i915_ggtt *ggtt);
 int i915_init_ggtt(struct drm_i915_private *dev_priv);
 void i915_ggtt_driver_release(struct drm_i915_private *dev_priv);
 
+static inline bool i915_ggtt_has_aperture(const struct i915_ggtt *ggtt)
+{
+       return ggtt->mappable_end > 0;
+}
+
 int i915_ppgtt_init_hw(struct intel_gt *gt);
 
 struct i915_ppgtt *i915_ppgtt_create(struct drm_i915_private *dev_priv);