[igt-dev] [Intel-gfx] [PATCH i-g-t] i915/gem_ctx_engine: Skip redundant clear of a fresh buffer

Liu, Chuansheng chuansheng.liu at intel.com
Tue Jan 14 00:05:09 UTC 2020



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Chris
> Wilson
> Sent: Tuesday, January 7, 2020 7:29 PM
> To: intel-gfx at lists.freedesktop.org
> Cc: igt-dev at 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 at 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 at intel.com>

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



More information about the igt-dev mailing list