diff mbox

[i-g-t,v3,1/2] tests/gem_mmap_gtt: clarify BO domain setting functions

Message ID 1428497741.7407.11.camel@jlahtine-mobl1 (mailing list archive)
State New, archived
Headers show

Commit Message

Joonas Lahtinen April 8, 2015, 12:55 p.m. UTC
Add suffix and complementary function for CPU domain.

v2:
- Change function signatures to be consistent with the rest

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_mmap_gtt.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Joonas Lahtinen April 13, 2015, 6:03 a.m. UTC | #1
These two patches still have something to work on, or could they be
committed?

On ke, 2015-04-08 at 15:55 +0300, Joonas Lahtinen wrote:
> Add suffix and complementary function for CPU domain.
> 
> v2:
> - Change function signatures to be consistent with the rest
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  tests/gem_mmap_gtt.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
> index 55c66a2..115e398 100644
> --- a/tests/gem_mmap_gtt.c
> +++ b/tests/gem_mmap_gtt.c
> @@ -43,11 +43,18 @@
>  
>  static int OBJECT_SIZE = 16*1024*1024;
>  
> -static void set_domain(int fd, uint32_t handle)
> +static void
> +set_domain_gtt(int fd, uint32_t handle)
>  {
>  	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
>  }
>  
> +static void
> +set_domain_cpu(int fd, uint32_t handle)
> +{
> +	gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
> +}
> +
>  static void *
>  mmap_bo(int fd, uint32_t handle)
>  {
> @@ -245,7 +252,7 @@ test_write_gtt(int fd)
>  
>  	/* prefault object into gtt */
>  	dst_gtt = mmap_bo(fd, dst);
> -	set_domain(fd, dst);
> +	set_domain_gtt(fd, dst);
>  	memset(dst_gtt, 0, OBJECT_SIZE);
>  	munmap(dst_gtt, OBJECT_SIZE);
>
diff mbox

Patch

diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 55c66a2..115e398 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -43,11 +43,18 @@ 
 
 static int OBJECT_SIZE = 16*1024*1024;
 
-static void set_domain(int fd, uint32_t handle)
+static void
+set_domain_gtt(int fd, uint32_t handle)
 {
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 }
 
+static void
+set_domain_cpu(int fd, uint32_t handle)
+{
+	gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+}
+
 static void *
 mmap_bo(int fd, uint32_t handle)
 {
@@ -245,7 +252,7 @@  test_write_gtt(int fd)
 
 	/* prefault object into gtt */
 	dst_gtt = mmap_bo(fd, dst);
-	set_domain(fd, dst);
+	set_domain_gtt(fd, dst);
 	memset(dst_gtt, 0, OBJECT_SIZE);
 	munmap(dst_gtt, OBJECT_SIZE);