public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
Date: Wed, 13 Nov 2019 20:38:04 +0000	[thread overview]
Message-ID: <789bee54be0f0ccfb083aaeb5158f56b08205bba.camel@intel.com> (raw)
In-Reply-To: <20191109151002.20767-1-chris@chris-wilson.co.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1271 bytes --]

On Sat, 2019-11-09 at 15:10 +0000, Chris Wilson wrote:
> igt_aux.h already provides the optimal igt_fls(), so use that in
> preference to open coding the brute force version.
> 
> Reported-by: Stuart Summers <stuart.summers@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Stuart Summers <stuart.summers@intel.com>

Thanks for the look here Chris :)

-Stuart

> ---
>  tests/i915/gem_blits.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/tests/i915/gem_blits.c b/tests/i915/gem_blits.c
> index e0346a7c7..f9cb12bb8 100644
> --- a/tests/i915/gem_blits.c
> +++ b/tests/i915/gem_blits.c
> @@ -57,16 +57,6 @@ enum mode {
>  	WC,
>  };
>  
> -static int fls(uint64_t x)
> -{
> -	int t;
> -
> -	for (t = 0; x >> t; t++)
> -		;
> -
> -	return t;
> -}
> -
>  static unsigned int
>  get_tiling_stride(const struct device *device,
>  		  unsigned int width, unsigned int tiling)
> @@ -81,7 +71,7 @@ get_tiling_stride(const struct device *device,
>  		else
>  			stride = ALIGN(stride, 128);
>  		if (device->gen < 4)
> -			stride = 1 << fls(stride - 1);
> +			stride = 1 << igt_fls(stride - 1);
>  	} else {
>  		if (device->gen >= 8)
>  			stride = ALIGN(stride, 64);

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3270 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

      parent reply	other threads:[~2019-11-13 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 15:10 [igt-dev] [PATCH i-g-t] i915/gem_blits: Use common igt_fls() Chris Wilson
2019-11-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-10 22:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-11-11 10:47 ` [Intel-gfx] [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2019-11-13 20:38 ` Summers, Stuart [this message]

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=789bee54be0f0ccfb083aaeb5158f56b08205bba.camel@intel.com \
    --to=stuart.summers@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