MLK-22399 mxc IPUv3: cpmem: Get 0 u/v_offset in __ipu_ch_offset_calc() for some pfmts
authorLiu Ying <victor.liu@nxp.com>
Wed, 23 Oct 2019 09:41:06 +0000 (17:41 +0800)
committerLiu Ying <victor.liu@nxp.com>
Thu, 24 Oct 2019 01:36:33 +0000 (09:36 +0800)
commit0c72abc3c3bf63922902805b13b4ab5c47a7cb4e
tree8d0bdd11b95732fd1c5d5110e3f1904bdaee91a8
parent40abeb9faa34c43efb4393201efad8a8d5ebbfa6
MLK-22399 mxc IPUv3: cpmem: Get 0 u/v_offset in __ipu_ch_offset_calc() for some pfmts

There are no u/v planars in the pixel formats
IPU_PIX_FMT_BGRA4444/IPU_PIX_FMT_BGRA5551/IPU_PIX_FMT_AYUV,
so we should explicitly get zero u/v_offset from __ipu_ch_offset_calc()
for those pixel formats.  Without this patch, '-EINVAL' will be
returned from __ipu_ch_offset_calc() as the function return value
and input parameter u/v_offset will not be touched, which is not a
good behavior, because the caller is likely to ignore the function
return value and take the u/v_offset as valid value.  The MXC IPUv3 fb
driver is a such kind of caller, which may get the u/v_offset
for those pixel formats without checking the function return value,
and hence wrongly pass the u/v_offset to PRE driver(finally causes
malfunction).

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit c1ff0b03944e5196497be4f606979f5cb0c1b413)
drivers/mxc/ipu3/ipu_param_mem.h