summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.h
diff options
context:
space:
mode:
authorChris Wilson2016-08-04 17:32:31 +0200
committerChris Wilson2016-08-04 21:19:58 +0200
commit59bfa1248e22d65e6273eec6f8043c8e4450c2ba (patch)
treed41f13b726fd0369d3916eb8ddda21ec0a2260af /drivers/gpu/drm/i915/i915_gem_gtt.h
parentdrm/i915: Wrap vma->pin_count accessors with small inline helpers (diff)
downloadkernel-qcow2-linux-59bfa1248e22d65e6273eec6f8043c8e4450c2ba.tar.gz
kernel-qcow2-linux-59bfa1248e22d65e6273eec6f8043c8e4450c2ba.tar.xz
kernel-qcow2-linux-59bfa1248e22d65e6273eec6f8043c8e4450c2ba.zip
drm/i915: Start passing around i915_vma from execbuffer
During execbuffer we look up the i915_vma in order to reserve them in the VM. However, we then do a double lookup of the vma in order to then pin them, all because we lack the necessary interfaces to operate on i915_vma - so introduce i915_vma_pin()! v2: Tidy parameter lists to remove one level of redirection in the hot path. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470324762-2545-15-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index eee22fcf5826..c63cc1b4c437 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -609,6 +609,20 @@ i915_ggtt_view_equal(const struct i915_ggtt_view *a,
return true;
}
+int __must_check
+i915_vma_pin(struct i915_vma *vma, u64 size, u64 alignment, u64 flags);
+/* Flags used by pin/bind&friends. */
+#define PIN_MAPPABLE BIT(0)
+#define PIN_NONBLOCK BIT(1)
+#define PIN_GLOBAL BIT(2)
+#define PIN_OFFSET_BIAS BIT(3)
+#define PIN_USER BIT(4)
+#define PIN_UPDATE BIT(5)
+#define PIN_ZONE_4G BIT(6)
+#define PIN_HIGH BIT(7)
+#define PIN_OFFSET_FIXED BIT(8)
+#define PIN_OFFSET_MASK (~4095)
+
static inline int i915_vma_pin_count(const struct i915_vma *vma)
{
return vma->pin_count;