public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
Date: Fri, 11 Jan 2019 14:01:15 +0000	[thread overview]
Message-ID: <8f5f0224-5545-67db-aeda-03c5060afe82@linux.intel.com> (raw)
In-Reply-To: <20190111135723.25991-1-chris@chris-wilson.co.uk>


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

  reply	other threads:[~2019-01-11 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 13:57 [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling Chris Wilson
2019-01-11 14:01 ` Tvrtko Ursulin [this message]
2019-01-11 14:30 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f5f0224-5545-67db-aeda-03c5060afe82@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox