public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent()
@ 2020-01-28 12:21 Chris Wilson
  2020-01-28 12:45 ` [igt-dev] [Intel-gfx] " Mika Kuoppala
  2020-01-28 15:29 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-01-28 12:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Replace gem_mmap_gtt and write-once mmaps with
gem_mmap__device_coherent.

For use as an invalid pointer, we need only worry about having an
mmap_offset (gtt or wc) as they work alike inside the kernel with
respect to locking. (GTT has the extra vm->mutex, but if there's no
aperture, there's never going to be such a mutex to worry about!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_exec_balancer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 6b0c47f09..150eba0db 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -278,7 +278,8 @@ static void invalid_balancer(int i915)
 		igt_assert_eq(__gem_context_set_param(i915, &p), -EFAULT);
 
 		handle = gem_create(i915, 4096 * 3);
-		ptr = gem_mmap__gtt(i915, handle, 4096 * 3, PROT_WRITE);
+		ptr = gem_mmap__device_coherent(i915, handle, 0, 4096 * 3,
+						PROT_WRITE);
 		gem_close(i915, handle);
 
 		memset(&engines, 0, sizeof(engines));
@@ -369,7 +370,7 @@ static void invalid_bonds(int i915)
 	gem_context_set_param(i915, &p);
 
 	handle = gem_create(i915, 4096 * 3);
-	ptr = gem_mmap__gtt(i915, handle, 4096 * 3, PROT_WRITE);
+	ptr = gem_mmap__device_coherent(i915, handle, 0, 4096 * 3, PROT_WRITE);
 	gem_close(i915, handle);
 
 	memcpy(ptr + 4096, &bonds[0], sizeof(bonds[0]));
@@ -720,7 +721,7 @@ static uint32_t create_semaphore_to_spinner(int i915, igt_spin_t *spin)
 	uint64_t addr;
 
 	handle = gem_create(i915, 4096);
-	cs = map = gem_mmap__cpu(i915, handle, 0, 4096, PROT_WRITE);
+	cs = map = gem_mmap__device_coherent(i915, handle, 0, 4096, PROT_WRITE);
 
 	/* Wait until the spinner is running */
 	addr = spin->obj[0].offset + 4 * SPIN_POLL_START_IDX;
-- 
2.25.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent()
  2020-01-28 12:21 [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent() Chris Wilson
@ 2020-01-28 12:45 ` Mika Kuoppala
  2020-01-28 15:29 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Kuoppala @ 2020-01-28 12:45 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Replace gem_mmap_gtt and write-once mmaps with
> gem_mmap__device_coherent.
>
> For use as an invalid pointer, we need only worry about having an
> mmap_offset (gtt or wc) as they work alike inside the kernel with
> respect to locking. (GTT has the extra vm->mutex, but if there's no
> aperture, there's never going to be such a mutex to worry about!)
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  tests/i915/gem_exec_balancer.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
> index 6b0c47f09..150eba0db 100644
> --- a/tests/i915/gem_exec_balancer.c
> +++ b/tests/i915/gem_exec_balancer.c
> @@ -278,7 +278,8 @@ static void invalid_balancer(int i915)
>  		igt_assert_eq(__gem_context_set_param(i915, &p), -EFAULT);
>  
>  		handle = gem_create(i915, 4096 * 3);
> -		ptr = gem_mmap__gtt(i915, handle, 4096 * 3, PROT_WRITE);
> +		ptr = gem_mmap__device_coherent(i915, handle, 0, 4096 * 3,
> +						PROT_WRITE);
>  		gem_close(i915, handle);
>  
>  		memset(&engines, 0, sizeof(engines));
> @@ -369,7 +370,7 @@ static void invalid_bonds(int i915)
>  	gem_context_set_param(i915, &p);
>  
>  	handle = gem_create(i915, 4096 * 3);
> -	ptr = gem_mmap__gtt(i915, handle, 4096 * 3, PROT_WRITE);
> +	ptr = gem_mmap__device_coherent(i915, handle, 0, 4096 * 3, PROT_WRITE);
>  	gem_close(i915, handle);
>  
>  	memcpy(ptr + 4096, &bonds[0], sizeof(bonds[0]));
> @@ -720,7 +721,7 @@ static uint32_t create_semaphore_to_spinner(int i915, igt_spin_t *spin)
>  	uint64_t addr;
>  
>  	handle = gem_create(i915, 4096);
> -	cs = map = gem_mmap__cpu(i915, handle, 0, 4096, PROT_WRITE);
> +	cs = map = gem_mmap__device_coherent(i915, handle, 0, 4096, PROT_WRITE);
>  
>  	/* Wait until the spinner is running */
>  	addr = spin->obj[0].offset + 4 * SPIN_POLL_START_IDX;
> -- 
> 2.25.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent()
  2020-01-28 12:21 [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent() Chris Wilson
  2020-01-28 12:45 ` [igt-dev] [Intel-gfx] " Mika Kuoppala
@ 2020-01-28 15:29 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-01-28 15:29 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent()
URL   : https://patchwork.freedesktop.org/series/72659/
State : failure

== Summary ==

Series 72659 revision 1 was fully merged or fully failed: no git log

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-28 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-28 12:21 [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Convert to use gem_mmap__device_coherent() Chris Wilson
2020-01-28 12:45 ` [igt-dev] [Intel-gfx] " Mika Kuoppala
2020-01-28 15:29 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox