* [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
@ 2018-06-05 9:34 Chris Wilson
2018-06-05 9:38 ` Mika Kuoppala
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Chris Wilson @ 2018-06-05 9:34 UTC (permalink / raw)
To: intel-gfx
To spare ourselves a long line later, refactor the repeated check of
bind_count vs pin_count to a helper.
Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
---
drivers/gpu/drm/i915/i915_vma.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 9324d476e0a7..0b3de2f19e1c 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -459,6 +459,17 @@ bool i915_gem_valid_gtt_space(struct i915_vma *vma, unsigned long cache_level)
return true;
}
+static void assert_bind_count(struct drm_i915_gem_object *obj)
+{
+ /*
+ * Combine the assertion that the object is bound and that we have
+ * pinned its pages. But we should never have pinned the pages
+ * more than we have bound the object. (This, of course, assumes that
+ * no one else decides to pin the pages!)
+ */
+ GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+}
+
/**
* i915_vma_insert - finds a slot for the vma in its address space
* @vma: the vma
@@ -595,7 +606,7 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
obj->bind_count++;
spin_unlock(&dev_priv->mm.obj_lock);
- GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+ assert_bind_count(obj);
return 0;
@@ -633,7 +644,7 @@ i915_vma_remove(struct i915_vma *vma)
* reaped by the shrinker.
*/
i915_gem_object_unpin_pages(obj);
- GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+ assert_bind_count(obj);
}
int __i915_vma_do_pin(struct i915_vma *vma,
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
@ 2018-06-05 9:38 ` Mika Kuoppala
2018-06-05 9:40 ` Chris Wilson
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Mika Kuoppala @ 2018-06-05 9:38 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> To spare ourselves a long line later, refactor the repeated check of
> bind_count vs pin_count to a helper.
>
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
2018-06-05 9:38 ` Mika Kuoppala
@ 2018-06-05 9:40 ` Chris Wilson
2018-06-05 9:41 ` [PATCH v2] " Chris Wilson
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-06-05 9:40 UTC (permalink / raw)
To: intel-gfx
Quoting Chris Wilson (2018-06-05 10:34:20)
> To spare ourselves a long line later, refactor the repeated check of
> bind_count vs pin_count to a helper.
>
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> ---
> drivers/gpu/drm/i915/i915_vma.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 9324d476e0a7..0b3de2f19e1c 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -459,6 +459,17 @@ bool i915_gem_valid_gtt_space(struct i915_vma *vma, unsigned long cache_level)
> return true;
> }
>
> +static void assert_bind_count(struct drm_i915_gem_object *obj)
> +{
> + /*
> + * Combine the assertion that the object is bound and that we have
> + * pinned its pages. But we should never have pinned the pages
bound the object more than we have pinned its pages.
That makes more sense.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
2018-06-05 9:38 ` Mika Kuoppala
2018-06-05 9:40 ` Chris Wilson
@ 2018-06-05 9:41 ` Chris Wilson
2018-06-05 10:22 ` Mika Kuoppala
2018-06-05 11:37 ` ✓ Fi.CI.BAT: success for drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2) Patchwork
2018-06-05 12:26 ` ✗ Fi.CI.IGT: failure " Patchwork
4 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-06-05 9:41 UTC (permalink / raw)
To: intel-gfx
To spare ourselves a long line later, refactor the repeated check of
bind_count vs pin_count to a helper.
v2: Fix up the commentary!
Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
---
drivers/gpu/drm/i915/i915_vma.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 9324d476e0a7..10bf654cd023 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -459,6 +459,18 @@ bool i915_gem_valid_gtt_space(struct i915_vma *vma, unsigned long cache_level)
return true;
}
+static void assert_bind_count(const struct drm_i915_gem_object *obj)
+{
+ /*
+ * Combine the assertion that the object is bound and that we have
+ * pinned its pages. But we should never have bound the object
+ * more than we have pinned its pages. (For complete accuracy, we
+ * assume that no else is pinning the pages, but as a rough assertion
+ * that we will not run into problems later, this will do!)
+ */
+ GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+}
+
/**
* i915_vma_insert - finds a slot for the vma in its address space
* @vma: the vma
@@ -595,7 +607,7 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
obj->bind_count++;
spin_unlock(&dev_priv->mm.obj_lock);
- GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+ assert_bind_count(obj);
return 0;
@@ -633,7 +645,7 @@ i915_vma_remove(struct i915_vma *vma)
* reaped by the shrinker.
*/
i915_gem_object_unpin_pages(obj);
- GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
+ assert_bind_count(obj);
}
int __i915_vma_do_pin(struct i915_vma *vma,
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
2018-06-05 9:41 ` [PATCH v2] " Chris Wilson
@ 2018-06-05 10:22 ` Mika Kuoppala
0 siblings, 0 replies; 7+ messages in thread
From: Mika Kuoppala @ 2018-06-05 10:22 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> To spare ourselves a long line later, refactor the repeated check of
> bind_count vs pin_count to a helper.
>
> v2: Fix up the commentary!
Matches the code now, didn't notice on the first round *blush*
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> ---
> drivers/gpu/drm/i915/i915_vma.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 9324d476e0a7..10bf654cd023 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -459,6 +459,18 @@ bool i915_gem_valid_gtt_space(struct i915_vma *vma, unsigned long cache_level)
> return true;
> }
>
> +static void assert_bind_count(const struct drm_i915_gem_object *obj)
> +{
> + /*
> + * Combine the assertion that the object is bound and that we have
> + * pinned its pages. But we should never have bound the object
> + * more than we have pinned its pages. (For complete accuracy, we
> + * assume that no else is pinning the pages, but as a rough assertion
> + * that we will not run into problems later, this will do!)
> + */
> + GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
> +}
> +
> /**
> * i915_vma_insert - finds a slot for the vma in its address space
> * @vma: the vma
> @@ -595,7 +607,7 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
> obj->bind_count++;
> spin_unlock(&dev_priv->mm.obj_lock);
>
> - GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
> + assert_bind_count(obj);
>
> return 0;
>
> @@ -633,7 +645,7 @@ i915_vma_remove(struct i915_vma *vma)
> * reaped by the shrinker.
> */
> i915_gem_object_unpin_pages(obj);
> - GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
> + assert_bind_count(obj);
> }
>
> int __i915_vma_do_pin(struct i915_vma *vma,
> --
> 2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2)
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
` (2 preceding siblings ...)
2018-06-05 9:41 ` [PATCH v2] " Chris Wilson
@ 2018-06-05 11:37 ` Patchwork
2018-06-05 12:26 ` ✗ Fi.CI.IGT: failure " Patchwork
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-06-05 11:37 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2)
URL : https://patchwork.freedesktop.org/series/44259/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4278 -> Patchwork_9197 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/44259/revisions/2/mbox/
== Known issues ==
Here are the changes found in Patchwork_9197 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_module_reload@basic-no-display:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106725)
==== Possible fixes ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-cfl-s3: FAIL (fdo#100368) -> PASS
igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
fi-glk-j4005: FAIL (fdo#103481) -> PASS
igt@kms_pipe_crc_basic@read-crc-pipe-c:
fi-glk-j4005: DMESG-WARN (fdo#106000) -> PASS
igt@prime_vgem@basic-fence-flip:
fi-ilk-650: FAIL (fdo#104008) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
== Participating hosts (40 -> 37) ==
Additional (2): fi-bxt-dsi fi-hsw-4200u
Missing (5): fi-ctg-p8600 fi-byt-squawks fi-kbl-7560u fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4278 -> Patchwork_9197
CI_DRM_4278: 6832f9f1d1d74ea696ae703d6ce9aa195be663f2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4506: 6c9d04797b7ef972b1b3746df6985071d1d2de26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9197: 74e53dfeb74f0d3abb96bccf3eaef9e64bd4f7e8 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
74e53dfeb74f drm/i915/vma: Move the bind_count vs pin_count assertion to a helper
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9197/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✗ Fi.CI.IGT: failure for drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2)
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
` (3 preceding siblings ...)
2018-06-05 11:37 ` ✓ Fi.CI.BAT: success for drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2) Patchwork
@ 2018-06-05 12:26 ` Patchwork
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-06-05 12:26 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2)
URL : https://patchwork.freedesktop.org/series/44259/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4278_full -> Patchwork_9197_full =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9197_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_9197_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/44259/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9197_full:
=== IGT changes ===
==== Possible regressions ====
igt@drv_selftest@live_hangcheck:
shard-kbl: PASS -> DMESG-FAIL
==== Warnings ====
igt@drv_selftest@live_guc:
shard-kbl: PASS -> SKIP +3
== Known issues ==
Here are the changes found in Patchwork_9197_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
shard-glk: PASS -> FAIL (fdo#105363)
igt@kms_flip@2x-modeset-vs-vblank-race-interruptible:
shard-hsw: PASS -> FAIL (fdo#103060)
shard-glk: PASS -> FAIL (fdo#103060)
igt@kms_flip_tiling@flip-to-y-tiled:
shard-glk: PASS -> FAIL (fdo#104724)
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
igt@perf@blocking:
shard-hsw: PASS -> FAIL (fdo#102252)
==== Possible fixes ====
igt@gem_exec_big:
shard-hsw: INCOMPLETE (fdo#103540) -> PASS
igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
shard-glk: FAIL (fdo#105703) -> PASS
igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
shard-hsw: FAIL (fdo#103355) -> PASS
igt@kms_flip@2x-flip-vs-wf_vblank-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#105363) -> PASS
igt@kms_flip_tiling@flip-y-tiled:
shard-glk: FAIL (fdo#104724) -> PASS
igt@perf@polling:
shard-hsw: FAIL (fdo#102252) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4278 -> Patchwork_9197
CI_DRM_4278: 6832f9f1d1d74ea696ae703d6ce9aa195be663f2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4506: 6c9d04797b7ef972b1b3746df6985071d1d2de26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9197: 74e53dfeb74f0d3abb96bccf3eaef9e64bd4f7e8 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9197/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-06-05 12:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-05 9:34 [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper Chris Wilson
2018-06-05 9:38 ` Mika Kuoppala
2018-06-05 9:40 ` Chris Wilson
2018-06-05 9:41 ` [PATCH v2] " Chris Wilson
2018-06-05 10:22 ` Mika Kuoppala
2018-06-05 11:37 ` ✓ Fi.CI.BAT: success for drm/i915/vma: Move the bind_count vs pin_count assertion to a helper (rev2) Patchwork
2018-06-05 12:26 ` ✗ Fi.CI.IGT: failure " 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.