[PATCH 14/14] drm/i915: Add reservation object to gen6_ppgtt

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Jan 20 13:14:42 UTC 2020


Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 3 +++
 drivers/gpu/drm/i915/gt/gen6_ppgtt.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
index 8248efa9229f..0379a2aca3cb 100644
--- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
@@ -283,6 +283,7 @@ static void gen6_ppgtt_cleanup(struct i915_address_space *vm)
 
 	mutex_destroy(&ppgtt->flush);
 	mutex_destroy(&ppgtt->pin_mutex);
+	dma_resv_fini(&ppgtt->resv);
 	kfree(ppgtt->base.pd);
 }
 
@@ -367,6 +368,7 @@ static struct i915_vma *pd_vma_create(struct gen6_ppgtt *ppgtt, int size)
 
 	vma->size = size;
 	vma->fence_size = size;
+	vma->resv = &ppgtt->resv;
 	atomic_set(&vma->flags, I915_VMA_GGTT);
 	vma->ggtt_view.type = I915_GGTT_VIEW_ROTATED; /* prevent fencing */
 
@@ -470,6 +472,7 @@ struct i915_ppgtt *gen6_ppgtt_create(struct intel_gt *gt)
 		goto err_scratch;
 	}
 
+	dma_resv_init(&ppgtt->resv);
 	return &ppgtt->base;
 
 err_scratch:
diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.h b/drivers/gpu/drm/i915/gt/gen6_ppgtt.h
index 00032a931bae..6bde370ab44e 100644
--- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.h
+++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.h
@@ -7,12 +7,14 @@
 #define __GEN6_PPGTT_H__
 
 #include "intel_gtt.h"
+#include <linux/dma-resv.h>
 
 struct i915_gem_ww_ctx;
 
 struct gen6_ppgtt {
 	struct i915_ppgtt base;
 
+	struct dma_resv resv;
 	struct mutex flush;
 	struct i915_vma *vma;
 	gen6_pte_t __iomem *pd_addr;
-- 
2.24.1



More information about the Intel-gfx-trybot mailing list