OSDN Git Service

vc4: fix vc4_resource_from_handle() stride calculation
authorRob Herring <robh@kernel.org>
Tue, 14 Jun 2016 21:17:44 +0000 (16:17 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:44 +0000 (11:39 +0100)
commit7c583f85e15532a5511cfa57ea4d9204de593bf6
tree6d3a3e7481780677ac241ccebf60227f09d93ef5
parentcdfd7c7b723103457e79936a676a696a545e2ae5
vc4: fix vc4_resource_from_handle() stride calculation

The expected stride calculation is completely wrong. It should
ultimately be multiplying cpp and width rather than dividing. The width
also needs to be aligned to the tiling width first before converting to
stride bytes.

The whole stride check here is possibly pointless. Any buffers which
were allocated outside of vc4 may have strides with larger alignment
requirements.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 067c5b10b690b949ac28c4aea237f398f8251fff)
src/gallium/drivers/vc4/vc4_resource.c