etnaviv: Make sure rs alignment checks match
authorGuido Günther <agx@sigxcpu.org>
Mon, 17 Sep 2018 14:06:57 +0000 (16:06 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 15 Nov 2018 15:38:35 +0000 (16:38 +0100)
commitab5653680e169434a730ff23f3facdae0ca2632d
tree559792dec62183935a2ed33f0ba10fb689bf2935
parent52368ef83a1b9998707cdc1703e38768a8c5b06d
etnaviv: Make sure rs alignment checks match

etna_resource_alloc and etna_resource_from_handle currently use different checks.
This leads to

   etna_resource_from_handle:492: target=2, format=PIPE_FORMAT_B8G8R8X8_UNORM, 1080x1920x1, array_size=1, last_level=0, nr_samples=0, usage=0, bind=8000a, flags=0
   etna_resource_from_handle:541: BO stride 4320 is too small for RS engine width padding (4352, format PIPE_FORMAT_B8G8R8X8_UNORM)

since etna_resource_from_handle wants to be aligned to a 16 byte
boundary while the etna_resource_alloc does not.

Adjust the two checks by using a common function.

Broken by baff59ebf07a114f95ad66d1f54e4b1f409eebee

Signed-off-by: Guido Günther <guido.gunther@puri.sm>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_resource.c