drm/i915/guc: Assert that all GGTT offsets used by the GuC are mappable

Add an assertion to the plain i915_ggtt_offset() to double check that
any offset we hand to the GuC is outside of its unmappable ranges.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161224193146.4402-1-chris@chris-wilson.co.uk
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
This commit is contained in:
Chris Wilson
2016-12-24 19:31:46 +00:00
parent f061ff077e
commit 4741da925f
3 changed files with 19 additions and 10 deletions

View File

@@ -28,6 +28,8 @@
#include "i915_guc_reg.h"
#include "intel_ringbuffer.h"
#include "i915_vma.h"
struct drm_i915_gem_request;
/*
@@ -198,4 +200,11 @@ void i915_guc_register(struct drm_i915_private *dev_priv);
void i915_guc_unregister(struct drm_i915_private *dev_priv);
int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
static inline u32 guc_ggtt_offset(struct i915_vma *vma)
{
u32 offset = i915_ggtt_offset(vma);
GEM_BUG_ON(offset < GUC_WOPCM_TOP);
return offset;
}
#endif