[i-g-t] i915/gem_ctx_engine: Skip redundant clear of a fresh buffer
diff mbox series

Message ID 20200107112913.2726371-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [i-g-t] i915/gem_ctx_engine: Skip redundant clear of a fresh buffer
Related show

Commit Message

Chris Wilson Jan. 7, 2020, 11:29 a.m. UTC
No need to memset(0) the mapping of a fresh buffer, as we expect it to
be 0 already.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_ctx_engines.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Liu, Chuansheng Jan. 14, 2020, 12:05 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Chris
> Wilson
> Sent: Tuesday, January 7, 2020 7:29 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: igt-dev@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_ctx_engine: Skip redundant clear of
> a fresh buffer
> 
> No need to memset(0) the mapping of a fresh buffer, as we expect it to
> be 0 already.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_ctx_engines.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c
> index 55794a438..86c4bea5a 100644
> --- a/tests/i915/gem_ctx_engines.c
> +++ b/tests/i915/gem_ctx_engines.c
> @@ -454,7 +454,6 @@ static void independent(int i915)
>  	map = gem_mmap__cpu(i915, results.handle, 0, 4096, PROT_READ);
>  	gem_set_domain(i915, results.handle,
>  		       I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
> -	memset(map, 0, 4096);

Reviewed-by: Chuansheng Liu <chuansheng.liu@intel.com>

This patch can fix the problem of memsetting read-only map memory.
Just curious when it can get merged?
Thanks.

Patch
diff mbox series

diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c
index 55794a438..86c4bea5a 100644
--- a/tests/i915/gem_ctx_engines.c
+++ b/tests/i915/gem_ctx_engines.c
@@ -454,7 +454,6 @@  static void independent(int i915)
 	map = gem_mmap__cpu(i915, results.handle, 0, 4096, PROT_READ);
 	gem_set_domain(i915, results.handle,
 		       I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
-	memset(map, 0, 4096);
 
 	for (int i = 0; i < I915_EXEC_RING_MASK + 1; i++) {
 		struct drm_i915_gem_exec_object2 obj[2] = {