* [PATCH 1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE
@ 2017-02-04 0:29 Chris Wilson
2017-02-04 0:29 ` [PATCH 2/3] drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2017-02-04 0:29 UTC (permalink / raw)
To: intel-gfx
I incorrectly converted the exclusion of the last 4096 bytes (that avoids
any potential prefetching past the end of the GTT) to PAGE_SIZE and not
to I915_GTT_PAGE_SIZE as it should be.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 68ecfc193747..9bed5e9ee31b 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3241,9 +3241,9 @@ int i915_ggtt_init_hw(struct drm_i915_private *dev_priv)
* shrink the range used by drm_mm.
*/
mutex_lock(&dev_priv->drm.struct_mutex);
- ggtt->base.total -= PAGE_SIZE;
+ ggtt->base.total -= I915_GTT_PAGE_SIZE;
i915_address_space_init(&ggtt->base, dev_priv, "[global]");
- ggtt->base.total += PAGE_SIZE;
+ ggtt->base.total += I915_GTT_PAGE_SIZE;
if (!HAS_LLC(dev_priv))
ggtt->base.mm.color_adjust = i915_gtt_color_adjust;
mutex_unlock(&dev_priv->drm.struct_mutex);
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node
2017-02-04 0:29 [PATCH 1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Chris Wilson
@ 2017-02-04 0:29 ` Chris Wilson
2017-02-04 0:29 ` [PATCH 3/3] drm/i915: Sanity check inputs to i915_gem_evict_for_node() Chris Wilson
2017-02-04 0:54 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-02-04 0:29 UTC (permalink / raw)
To: intel-gfx
The drm_mm range manager (within i915_address_space) uses a special
drm_mm_node that excludes the unavailable range (beyond the end of the
drm_mm). However, we play games with the global GTT to use the head_node
to exclude the tail page but tell ourselves that the whole range is
available. This causes an issue when we try to evict using the full
range of the global GTT which is wider than the drm_mm, resulting in
complete confusion and castrophe. One way to resolve this would be to
use a reserved node to exclude the guard page, or we can treat the
drm_mm's head_node as our guard page and assign it the appropriate
colour.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 9bed5e9ee31b..75cd2a56b8b4 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2160,10 +2160,14 @@ static void i915_address_space_init(struct i915_address_space *vm,
const char *name)
{
i915_gem_timeline_init(dev_priv, &vm->timeline, name);
+
drm_mm_init(&vm->mm, vm->start, vm->total);
+ vm->mm.head_node.color = I915_COLOR_UNEVICTABLE;
+
INIT_LIST_HEAD(&vm->active_list);
INIT_LIST_HEAD(&vm->inactive_list);
INIT_LIST_HEAD(&vm->unbound_list);
+
list_add_tail(&vm->global_link, &dev_priv->vm_list);
}
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] drm/i915: Sanity check inputs to i915_gem_evict_for_node()
2017-02-04 0:29 [PATCH 1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Chris Wilson
2017-02-04 0:29 ` [PATCH 2/3] drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node Chris Wilson
@ 2017-02-04 0:29 ` Chris Wilson
2017-02-04 0:54 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-02-04 0:29 UTC (permalink / raw)
To: intel-gfx
Assert that the node is correctly aligned and that we are within the
bounds of the VM.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/i915_gem_evict.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index c181b1bb3d2c..49390862bb19 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -258,6 +258,9 @@ int i915_gem_evict_for_node(struct i915_address_space *vm,
int ret = 0;
lockdep_assert_held(&vm->i915->drm.struct_mutex);
+ GEM_BUG_ON(!IS_ALIGNED(start, I915_GTT_PAGE_SIZE));
+ GEM_BUG_ON(!IS_ALIGNED(end, I915_GTT_PAGE_SIZE));
+
trace_i915_gem_evict_node(vm, target, flags);
/* Retire before we search the active list. Although we have
@@ -276,6 +279,9 @@ int i915_gem_evict_for_node(struct i915_address_space *vm,
if (end < vm->start + vm->total)
end += I915_GTT_PAGE_SIZE;
}
+ GEM_BUG_ON(start < vm->start);
+ GEM_BUG_ON(end > vm->start + vm->total);
+ GEM_BUG_ON(start >= end);
drm_mm_for_each_node_in_range(node, &vm->mm, start, end) {
/* If we find any non-objects (!vma), we cannot evict them */
@@ -284,6 +290,7 @@ int i915_gem_evict_for_node(struct i915_address_space *vm,
break;
}
+ GEM_BUG_ON(!node->allocated);
vma = container_of(node, typeof(*vma), node);
/* If we are using coloring to insert guard pages between
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE
2017-02-04 0:29 [PATCH 1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Chris Wilson
2017-02-04 0:29 ` [PATCH 2/3] drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node Chris Wilson
2017-02-04 0:29 ` [PATCH 3/3] drm/i915: Sanity check inputs to i915_gem_evict_for_node() Chris Wilson
@ 2017-02-04 0:54 ` Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-02-04 0:54 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE
URL : https://patchwork.freedesktop.org/series/19093/
State : warning
== Summary ==
Series 19093v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/19093/revisions/1/mbox/
Test gem_cs_tlb:
Subgroup basic-default:
incomplete -> PASS (fi-ilk-650)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-ivb-3770)
fi-bdw-5557u total:252 pass:238 dwarn:0 dfail:0 fail:0 skip:14
fi-bsw-n3050 total:252 pass:213 dwarn:0 dfail:0 fail:0 skip:39
fi-bxt-j4205 total:252 pass:230 dwarn:0 dfail:0 fail:0 skip:22
fi-bxt-t5700 total:83 pass:70 dwarn:0 dfail:0 fail:0 skip:12
fi-byt-j1900 total:252 pass:225 dwarn:0 dfail:0 fail:0 skip:27
fi-byt-n2820 total:252 pass:221 dwarn:0 dfail:0 fail:0 skip:31
fi-hsw-4770 total:252 pass:233 dwarn:0 dfail:0 fail:0 skip:19
fi-hsw-4770r total:252 pass:233 dwarn:0 dfail:0 fail:0 skip:19
fi-ilk-650 total:252 pass:199 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:252 pass:231 dwarn:0 dfail:0 fail:0 skip:21
fi-ivb-3770 total:252 pass:230 dwarn:1 dfail:0 fail:0 skip:21
fi-kbl-7500u total:252 pass:229 dwarn:0 dfail:0 fail:2 skip:21
fi-skl-6260u total:252 pass:239 dwarn:0 dfail:0 fail:0 skip:13
fi-skl-6700hq total:252 pass:232 dwarn:0 dfail:0 fail:0 skip:20
fi-skl-6700k total:252 pass:227 dwarn:4 dfail:0 fail:0 skip:21
fi-skl-6770hq total:252 pass:239 dwarn:0 dfail:0 fail:0 skip:13
fi-snb-2520m total:252 pass:221 dwarn:0 dfail:0 fail:0 skip:31
fi-snb-2600 total:252 pass:220 dwarn:0 dfail:0 fail:0 skip:32
7d165238a46e6376f77bad1f7f54879bb414cb23 drm-tip: 2017y-02m-03d-17h-56m-24s UTC integration manifest
9a27636 drm/i915: Sanity check inputs to i915_gem_evict_for_node()
14006e7 drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node
8db125c drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3702/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-04 0:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-04 0:29 [PATCH 1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Chris Wilson
2017-02-04 0:29 ` [PATCH 2/3] drm/i915: Assign I915_COLOR_UNEVICTABLE to the address space head_node Chris Wilson
2017-02-04 0:29 ` [PATCH 3/3] drm/i915: Sanity check inputs to i915_gem_evict_for_node() Chris Wilson
2017-02-04 0:54 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Manipulate the Global GTT size using I915_GTT_PAGE_SIZE Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.