]> git.baikalelectronics.ru Git - kernel.git/commit
gpu: ipu-v3: Fix U/V offset macros for planar 4:2:0
authorSteve Longerbeam <slongerbeam@gmail.com>
Wed, 1 Aug 2018 19:12:17 +0000 (12:12 -0700)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 2 Aug 2018 09:47:39 +0000 (11:47 +0200)
commitdcb4fe994869d96201dad9143cf05b4f04a79f91
tree2910eff025629de3a075ec1511af6505f08ace76
parentd3408f05b34c7037f748bcff81b94e0440bcd9c5
gpu: ipu-v3: Fix U/V offset macros for planar 4:2:0

The U and V offset macros for planar 4:2:0 (U_OFFSET, V_OFFSET, and
UV_OFFSET), are not correct. The height component to the offset was
calculated as:

(pix->width * y / 4)

But this does not produce correct offsets for odd values of y (luma
line #). The luma line # must be decimated by two to produce the
correct U/V line #, so the correct formula is:

(pix->width * (y / 2) / 2)

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/ipu-v3/ipu-cpmem.c