* [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects
@ 2016-11-14 8:54 Chris Wilson
2016-11-14 8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
2016-11-14 10:17 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects Patchwork
0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2016-11-14 8:54 UTC (permalink / raw)
To: intel-gfx
Generalise the skip for physical and stolen objects by skipping anything
we do not have a valid address inside the sg.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5afa3ea29ce7..4931bfcff2a2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2963,14 +2963,19 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
* to GPU, and we can ignore the cache flush because it'll happen
* again at bind time.
*/
- if (!obj->mm.pages)
+ if (!obj->mm.pages) {
+ GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU);
return;
+ }
/*
* Stolen memory is always coherent with the GPU as it is explicitly
* marked as wc by the system, or the system is cache-coherent.
+ * Similarly, we only access struct pages through the CPU cache, so
+ * anything not backed by physical memory we consider to be always
+ * coherent and not need clflushing.
*/
- if (obj->stolen || obj->phys_handle)
+ if (!i915_gem_object_has_struct_page(obj))
return;
/* If the GPU is snooping the contents of the CPU cache,
--
2.10.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent
2016-11-14 8:54 [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects Chris Wilson
@ 2016-11-14 8:54 ` Chris Wilson
2016-11-14 13:57 ` Ville Syrjälä
2016-11-14 10:17 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects Patchwork
1 sibling, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2016-11-14 8:54 UTC (permalink / raw)
To: intel-gfx
If the LLC is coherent with the object, we do not need to worry about
whether main memory and cache mismatch when we hand the object back to
the system.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4931bfcff2a2..3b021e9e3379 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -228,7 +228,8 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
if (obj->mm.madv == I915_MADV_DONTNEED)
obj->mm.dirty = false;
- if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0)
+ if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 &&
+ !cpu_cache_is_coherent(obj->base.dev, obj->cache_level))
drm_clflush_sg(pages);
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
--
2.10.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent
2016-11-14 8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
@ 2016-11-14 13:57 ` Ville Syrjälä
0 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2016-11-14 13:57 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Mon, Nov 14, 2016 at 08:54:53AM +0000, Chris Wilson wrote:
> If the LLC is coherent with the object, we do not need to worry about
> whether main memory and cache mismatch when we hand the object back to
> the system.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Makes sense to me.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 4931bfcff2a2..3b021e9e3379 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -228,7 +228,8 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
> if (obj->mm.madv == I915_MADV_DONTNEED)
> obj->mm.dirty = false;
>
> - if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0)
> + if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 &&
> + !cpu_cache_is_coherent(obj->base.dev, obj->cache_level))
> drm_clflush_sg(pages);
>
> obj->base.read_domains = I915_GEM_DOMAIN_CPU;
> --
> 2.10.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects
2016-11-14 8:54 [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects Chris Wilson
2016-11-14 8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
@ 2016-11-14 10:17 ` Patchwork
1 sibling, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-11-14 10:17 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects
URL : https://patchwork.freedesktop.org/series/15255/
State : warning
== Summary ==
Series 15255v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/15255/revisions/1/mbox/
Test kms_force_connector_basic:
Subgroup force-edid:
pass -> DMESG-WARN (fi-snb-2520m)
fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:244 pass:204 dwarn:0 dfail:0 fail:0 skip:40
fi-bxt-t5700 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-j1900 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-n2820 total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-hsw-4770 total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-hsw-4770r total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-ilk-650 total:244 pass:191 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-ivb-3770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-kbl-7200u total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:244 pass:223 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6700k total:244 pass:222 dwarn:1 dfail:0 fail:0 skip:21
fi-snb-2520m total:244 pass:211 dwarn:1 dfail:0 fail:0 skip:32
fi-snb-2600 total:244 pass:211 dwarn:0 dfail:0 fail:0 skip:33
020e291d72d4aaf3e0f8f5168a60ac05daa43a77 drm-intel-nightly: 2016y-11m-14d-08h-02m-22s UTC integration manifest
1641a6b drm/i915: Skip final clflush if LLC is coherent
185fa2b drm/i915: Skip clflushes for all non-page backed objects
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2978/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects
@ 2017-02-17 14:07 Chris Wilson
2017-02-20 18:28 ` Matthew Auld
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-02-17 14:07 UTC (permalink / raw)
To: intel-gfx
Generalise the skip for physical and stolen objects by skipping anything
we do not have a valid address inside the sg.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6745dcbf3799..96098a7e0bc3 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3162,14 +3162,19 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
* to GPU, and we can ignore the cache flush because it'll happen
* again at bind time.
*/
- if (!obj->mm.pages)
+ if (!obj->mm.pages) {
+ GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU);
return;
+ }
/*
* Stolen memory is always coherent with the GPU as it is explicitly
* marked as wc by the system, or the system is cache-coherent.
+ * Similarly, we only access struct pages through the CPU cache, so
+ * anything not backed by physical memory we consider to be always
+ * coherent and not need clflushing.
*/
- if (obj->stolen || obj->phys_handle)
+ if (!i915_gem_object_has_struct_page(obj))
return;
/* If the GPU is snooping the contents of the CPU cache,
--
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] 6+ messages in thread
end of thread, other threads:[~2017-02-20 18:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 8:54 [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects Chris Wilson
2016-11-14 8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
2016-11-14 13:57 ` Ville Syrjälä
2016-11-14 10:17 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects Patchwork
2017-02-17 14:07 [PATCH 1/2] " Chris Wilson
2017-02-20 18:28 ` Matthew Auld
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.