Skip to content
Snippets Groups Projects
Commit 620365ab authored by Chris Wilson's avatar Chris Wilson :thinking:
Browse files

i915/gem_blits: Use common igt_fls()


igt_aux.h already provides the optimal igt_fls(), so use that in
preference to open coding the brute force version.

Reported-by: default avatarStuart Summers <stuart.summers@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Stuart Summers <stuart.summers@intel.com>
Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent ad2c18fe
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment