* [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
@ 2019-11-09 15:10 Chris Wilson
2019-11-09 15:10 ` [Intel-gfx] " Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2019-11-09 15:10 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
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>
---
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);
--
2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Intel-gfx] [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
2019-11-09 15:10 [PATCH i-g-t] i915/gem_blits: Use common igt_fls() Chris Wilson
@ 2019-11-09 15:10 ` Chris Wilson
2019-11-11 10:47 ` [igt-dev] " Arkadiusz Hiler
2019-11-13 20:38 ` Summers, Stuart
2 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2019-11-09 15:10 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
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>
---
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);
--
2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
2019-11-09 15:10 [PATCH i-g-t] i915/gem_blits: Use common igt_fls() Chris Wilson
2019-11-09 15:10 ` [Intel-gfx] " Chris Wilson
@ 2019-11-11 10:47 ` Arkadiusz Hiler
2019-11-11 10:47 ` [Intel-gfx] " Arkadiusz Hiler
2019-11-13 20:38 ` Summers, Stuart
2 siblings, 1 reply; 6+ messages in thread
From: Arkadiusz Hiler @ 2019-11-11 10:47 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Sat, Nov 09, 2019 at 03:10:02PM +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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
2019-11-11 10:47 ` [igt-dev] " Arkadiusz Hiler
@ 2019-11-11 10:47 ` Arkadiusz Hiler
0 siblings, 0 replies; 6+ messages in thread
From: Arkadiusz Hiler @ 2019-11-11 10:47 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Sat, Nov 09, 2019 at 03:10:02PM +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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
2019-11-09 15:10 [PATCH i-g-t] i915/gem_blits: Use common igt_fls() Chris Wilson
2019-11-09 15:10 ` [Intel-gfx] " Chris Wilson
2019-11-11 10:47 ` [igt-dev] " Arkadiusz Hiler
@ 2019-11-13 20:38 ` Summers, Stuart
2019-11-13 20:38 ` [Intel-gfx] " Summers, Stuart
2 siblings, 1 reply; 6+ messages in thread
From: Summers, Stuart @ 2019-11-13 20:38 UTC (permalink / raw)
To: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk
Cc: igt-dev@lists.freedesktop.org
[-- 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: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915/gem_blits: Use common igt_fls()
2019-11-13 20:38 ` Summers, Stuart
@ 2019-11-13 20:38 ` Summers, Stuart
0 siblings, 0 replies; 6+ messages in thread
From: Summers, Stuart @ 2019-11-13 20:38 UTC (permalink / raw)
To: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk
Cc: igt-dev@lists.freedesktop.org
[-- 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: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-11-13 20:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-09 15:10 [PATCH i-g-t] i915/gem_blits: Use common igt_fls() Chris Wilson
2019-11-09 15:10 ` [Intel-gfx] " Chris Wilson
2019-11-11 10:47 ` [igt-dev] " Arkadiusz Hiler
2019-11-11 10:47 ` [Intel-gfx] " Arkadiusz Hiler
2019-11-13 20:38 ` Summers, Stuart
2019-11-13 20:38 ` [Intel-gfx] " Summers, Stuart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox