intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/2] drm/i915: Remove guard page insertion around unevictable nodes
@ 2021-01-24 13:54 Chris Wilson
  2021-01-24 13:54 ` [Intel-gfx] [PATCH 2/2] drm/i915/gt: Always try to reserve GGTT address 0x0 Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Chris Wilson @ 2021-01-24 13:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

Assume that unevictable nodes are not in the GTT and so we can ignore
page boundary concerns, and so allow regular nodes to abutt against
irregular unevictable nodes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.h       | 2 --
 drivers/gpu/drm/i915/i915_gem_evict.c | 6 ++++--
 drivers/gpu/drm/i915/i915_vma.h       | 9 ++++++++-
 drivers/gpu/drm/i915/i915_vma_types.h | 2 ++
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 99cf861df92d..69c5a185ecff 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -357,8 +357,6 @@ enum i915_cache_level {
 	I915_CACHE_WT, /* hsw:gt3e WriteThrough for scanouts */
 };
 
-#define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
-
 struct intel_fbc {
 	/* This is always the inner lock when overlapping with struct_mutex and
 	 * it's the outer lock when overlapping with stolen_lock. */
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 4d2d59a9942b..aef88fdb9f66 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -313,11 +313,13 @@ int i915_gem_evict_for_node(struct i915_address_space *vm,
 		 */
 		if (i915_vm_has_cache_coloring(vm)) {
 			if (node->start + node->size == target->start) {
-				if (node->color == target->color)
+				if (i915_node_color_matches(node,
+							    target->color))
 					continue;
 			}
 			if (node->start == target->start + target->size) {
-				if (node->color == target->color)
+				if (i915_node_color_matches(node,
+							    target->color))
 					continue;
 			}
 		}
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index a64adc8c883b..609e8be142e6 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -283,10 +283,17 @@ static inline bool i915_vma_is_bound(const struct i915_vma *vma,
 	return atomic_read(&vma->flags) & where;
 }
 
+static inline bool i915_node_color_matches(const struct drm_mm_node *node,
+					   unsigned long color)
+{
+	return color == I915_COLOR_UNEVICTABLE || node->color == color;
+}
+
 static inline bool i915_node_color_differs(const struct drm_mm_node *node,
 					   unsigned long color)
 {
-	return drm_mm_node_allocated(node) && node->color != color;
+	return drm_mm_node_allocated(node) &&
+		!i915_node_color_matches(node, color);
 }
 
 /**
diff --git a/drivers/gpu/drm/i915/i915_vma_types.h b/drivers/gpu/drm/i915/i915_vma_types.h
index f5cb848b7a7e..e72a07692a64 100644
--- a/drivers/gpu/drm/i915/i915_vma_types.h
+++ b/drivers/gpu/drm/i915/i915_vma_types.h
@@ -95,6 +95,8 @@ enum i915_cache_level;
  *
  */
 
+#define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
+
 struct intel_remapped_plane_info {
 	/* in gtt pages */
 	unsigned int width, height, stride, offset;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-25 12:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 13:54 [Intel-gfx] [PATCH 1/2] drm/i915: Remove guard page insertion around unevictable nodes Chris Wilson
2021-01-24 13:54 ` [Intel-gfx] [PATCH 2/2] drm/i915/gt: Always try to reserve GGTT address 0x0 Chris Wilson
2021-01-25 11:28   ` Matthew Auld
2021-01-25 11:34     ` Chris Wilson
2021-01-24 13:57 ` [Intel-gfx] [PATCH] drm/i915: Remove guard page insertion around unevictable nodes Chris Wilson
2021-01-25 11:16   ` Matthew Auld
2021-01-25 11:24     ` Chris Wilson
2021-01-25 11:28       ` Chris Wilson
2021-01-25 11:35         ` Matthew Auld
2021-01-25 12:50           ` Chris Wilson
2021-01-24 14:16 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with drm/i915: Remove guard page insertion around unevictable nodes (rev2) Patchwork
2021-01-24 14:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-01-24 14:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-24 16:14 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).