[igt-dev] [PATCH i-g-t 2/2] benchmarks/gem_busy: use gem_mmap__device_coherent()

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Jan 30 05:11:54 UTC 2020


On Wed, Jan 29, 2020 at 08:36:42PM -0800, Ashutosh Dixit wrote:
> Use gem_mmap__device_coherent() in benchmarks/gem_busy for use with
> devices without a mappable aperture.
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
> ---
>  benchmarks/gem_busy.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/benchmarks/gem_busy.c b/benchmarks/gem_busy.c
> index 2fb1edf98..405cc9b09 100644
> --- a/benchmarks/gem_busy.c
> +++ b/benchmarks/gem_busy.c
> @@ -185,10 +185,7 @@ static int loop(unsigned ring, int reps, int ncpus, unsigned flags)
>  	if (flags & WRITE)
>  		obj[0].flags = EXEC_OBJECT_WRITE;
>  	obj[1].handle = gem_create(fd, 4096);
> -	if (gem_mmap__has_wc(fd))
> -		batch = gem_mmap__wc(fd, obj[1].handle, 0, 4096, PROT_WRITE);
> -	else
> -		batch = gem_mmap__gtt(fd, obj[1].handle, 4096, PROT_WRITE);
> +	batch = gem_mmap__device_coherent(fd, obj[1].handle, 0, 4096, PROT_WRITE);
>  	gem_set_domain(fd, obj[1].handle,
>  			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
>  	batch[0] = MI_BATCH_BUFFER_END;
> -- 
> 2.25.0
>

LGTM.
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com> 


More information about the igt-dev mailing list