All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
@ 2019-01-11 13:57 ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2019-01-11 13:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

get_tiling == gem_get_tiling + igt_require; so do that instead of
opencoding the ioctl.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_tiled_wc.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
index 65ac38510..21390729d 100644
--- a/tests/i915/gem_tiled_wc.c
+++ b/tests/i915/gem_tiled_wc.c
@@ -104,27 +104,6 @@ calculate_expected(int offset)
 	return (base_y + tile_y) * WIDTH + base_x + tile_x;
 }
 
-static void
-get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
-{
-	struct drm_i915_gem_get_tiling2 {
-		uint32_t handle;
-		uint32_t tiling_mode;
-		uint32_t swizzle_mode;
-		uint32_t phys_swizzle_mode;
-	} arg;
-#define DRM_IOCTL_I915_GEM_GET_TILING2	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2)
-
-	memset(&arg, 0, sizeof(arg));
-	arg.handle = handle;
-
-	do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg);
-	igt_require(arg.phys_swizzle_mode == arg.swizzle_mode);
-
-	*tiling = arg.tiling_mode;
-	*swizzle = arg.swizzle_mode;
-}
-
 igt_simple_main
 {
 	int fd;
@@ -136,7 +115,7 @@ igt_simple_main
 	gem_require_mmap_wc(fd);
 
 	handle = create_bo(fd);
-	get_tiling(fd, handle, &tiling, &swizzle);
+	igt_require(gem_get_tiling(fd, handle, &tiling, &swizzle));
 
 	if (IS_GEN2(intel_get_drm_devid(fd))) {
 		tile_height = 16;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
@ 2019-01-11 13:57 ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2019-01-11 13:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin

get_tiling == gem_get_tiling + igt_require; so do that instead of
opencoding the ioctl.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_tiled_wc.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
index 65ac38510..21390729d 100644
--- a/tests/i915/gem_tiled_wc.c
+++ b/tests/i915/gem_tiled_wc.c
@@ -104,27 +104,6 @@ calculate_expected(int offset)
 	return (base_y + tile_y) * WIDTH + base_x + tile_x;
 }
 
-static void
-get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
-{
-	struct drm_i915_gem_get_tiling2 {
-		uint32_t handle;
-		uint32_t tiling_mode;
-		uint32_t swizzle_mode;
-		uint32_t phys_swizzle_mode;
-	} arg;
-#define DRM_IOCTL_I915_GEM_GET_TILING2	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2)
-
-	memset(&arg, 0, sizeof(arg));
-	arg.handle = handle;
-
-	do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg);
-	igt_require(arg.phys_swizzle_mode == arg.swizzle_mode);
-
-	*tiling = arg.tiling_mode;
-	*swizzle = arg.swizzle_mode;
-}
-
 igt_simple_main
 {
 	int fd;
@@ -136,7 +115,7 @@ igt_simple_main
 	gem_require_mmap_wc(fd);
 
 	handle = create_bo(fd);
-	get_tiling(fd, handle, &tiling, &swizzle);
+	igt_require(gem_get_tiling(fd, handle, &tiling, &swizzle));
 
 	if (IS_GEN2(intel_get_drm_devid(fd))) {
 		tile_height = 16;
-- 
2.20.1

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

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
  2019-01-11 13:57 ` [igt-dev] " Chris Wilson
@ 2019-01-11 14:01   ` Tvrtko Ursulin
  -1 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2019-01-11 14:01 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 11/01/2019 13:57, Chris Wilson wrote:
> get_tiling == gem_get_tiling + igt_require; so do that instead of
> opencoding the ioctl.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/i915/gem_tiled_wc.c | 23 +----------------------
>   1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
> index 65ac38510..21390729d 100644
> --- a/tests/i915/gem_tiled_wc.c
> +++ b/tests/i915/gem_tiled_wc.c
> @@ -104,27 +104,6 @@ calculate_expected(int offset)
>   	return (base_y + tile_y) * WIDTH + base_x + tile_x;
>   }
>   
> -static void
> -get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
> -{
> -	struct drm_i915_gem_get_tiling2 {
> -		uint32_t handle;
> -		uint32_t tiling_mode;
> -		uint32_t swizzle_mode;
> -		uint32_t phys_swizzle_mode;
> -	} arg;
> -#define DRM_IOCTL_I915_GEM_GET_TILING2	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2)
> -
> -	memset(&arg, 0, sizeof(arg));
> -	arg.handle = handle;
> -
> -	do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg);
> -	igt_require(arg.phys_swizzle_mode == arg.swizzle_mode);
> -
> -	*tiling = arg.tiling_mode;
> -	*swizzle = arg.swizzle_mode;
> -}
> -
>   igt_simple_main
>   {
>   	int fd;
> @@ -136,7 +115,7 @@ igt_simple_main
>   	gem_require_mmap_wc(fd);
>   
>   	handle = create_bo(fd);
> -	get_tiling(fd, handle, &tiling, &swizzle);
> +	igt_require(gem_get_tiling(fd, handle, &tiling, &swizzle));
>   
>   	if (IS_GEN2(intel_get_drm_devid(fd))) {
>   		tile_height = 16;
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
@ 2019-01-11 14:01   ` Tvrtko Ursulin
  0 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2019-01-11 14:01 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 11/01/2019 13:57, Chris Wilson wrote:
> get_tiling == gem_get_tiling + igt_require; so do that instead of
> opencoding the ioctl.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/i915/gem_tiled_wc.c | 23 +----------------------
>   1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
> index 65ac38510..21390729d 100644
> --- a/tests/i915/gem_tiled_wc.c
> +++ b/tests/i915/gem_tiled_wc.c
> @@ -104,27 +104,6 @@ calculate_expected(int offset)
>   	return (base_y + tile_y) * WIDTH + base_x + tile_x;
>   }
>   
> -static void
> -get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
> -{
> -	struct drm_i915_gem_get_tiling2 {
> -		uint32_t handle;
> -		uint32_t tiling_mode;
> -		uint32_t swizzle_mode;
> -		uint32_t phys_swizzle_mode;
> -	} arg;
> -#define DRM_IOCTL_I915_GEM_GET_TILING2	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2)
> -
> -	memset(&arg, 0, sizeof(arg));
> -	arg.handle = handle;
> -
> -	do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg);
> -	igt_require(arg.phys_swizzle_mode == arg.swizzle_mode);
> -
> -	*tiling = arg.tiling_mode;
> -	*swizzle = arg.swizzle_mode;
> -}
> -
>   igt_simple_main
>   {
>   	int fd;
> @@ -136,7 +115,7 @@ igt_simple_main
>   	gem_require_mmap_wc(fd);
>   
>   	handle = create_bo(fd);
> -	get_tiling(fd, handle, &tiling, &swizzle);
> +	igt_require(gem_get_tiling(fd, handle, &tiling, &swizzle));
>   
>   	if (IS_GEN2(intel_get_drm_devid(fd))) {
>   		tile_height = 16;
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_tiled_wc: Reuse common gem_get_tiling
  2019-01-11 13:57 ` [igt-dev] " Chris Wilson
  (?)
  (?)
@ 2019-01-11 14:30 ` Patchwork
  -1 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-01-11 14:30 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: i915/gem_tiled_wc: Reuse common gem_get_tiling
URL   : https://patchwork.freedesktop.org/series/55063/
State : failure

== Summary ==

Series 55063 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] 5+ messages in thread

end of thread, other threads:[~2019-01-11 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 13:57 [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling Chris Wilson
2019-01-11 13:57 ` [igt-dev] " Chris Wilson
2019-01-11 14:01 ` Tvrtko Ursulin
2019-01-11 14:01   ` [Intel-gfx] " Tvrtko Ursulin
2019-01-11 14:30 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.