summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <b17645@freescale.com>2010-01-12 13:00:02 -0500
committerLiu Ying <b17645@freescale.com>2010-01-13 09:22:23 -0500
commit178fda494b6f5819a3bae2e4dbe95cdec769a518 (patch)
treef78687a5cbcf49b0a8c2d89d19dbcedaf1f2ee14
parent47ea36de9cd9796ec58da4cdb0eff0b597554287 (diff)
ENGR00119975 IPUv3:Inform user when IDMAC UV-offset overflows
UBO and VBO are 22-bit in CPMEM. When processing a high resolution frame in YUV format, the value of UV-offset may overflow, but the driver keeps silent. Signed-off-by: Liu Ying <b17645@freescale.com>
-rw-r--r--drivers/mxc/ipu3/ipu_param_mem.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mxc/ipu3/ipu_param_mem.h b/drivers/mxc/ipu3/ipu_param_mem.h
index 28358fd2f3b6..74bb9d9eb31f 100644
--- a/drivers/mxc/ipu3/ipu_param_mem.h
+++ b/drivers/mxc/ipu3/ipu_param_mem.h
@@ -284,6 +284,14 @@ static inline void _ipu_ch_param_init(int ch,
v_offset = v;
}
+ /* UBO and VBO are 22-bit */
+ if (u_offset/8 > 0x3fffff)
+ dev_err(g_ipu_dev,
+ "The value of U offset exceeds IPU limitation\n");
+ if (v_offset/8 > 0x3fffff)
+ dev_err(g_ipu_dev,
+ "The value of V offset exceeds IPU limitation\n");
+
ipu_ch_param_set_field(&params, 0, 46, 22, u_offset / 8);
ipu_ch_param_set_field(&params, 0, 68, 22, v_offset / 8);
@@ -500,6 +508,15 @@ static inline void _ipu_ch_offset_update(int ch,
if (v_fix > v_offset)
v_offset = v_fix;
+
+ /* UBO and VBO are 22-bit */
+ if (u_offset/8 > 0x3fffff)
+ dev_err(g_ipu_dev,
+ "The value of U offset exceeds IPU limitation\n");
+ if (v_offset/8 > 0x3fffff)
+ dev_err(g_ipu_dev,
+ "The value of V offset exceeds IPU limitation\n");
+
ipu_ch_param_mod_field(ipu_ch_param_addr(ch), 0, 46, 22, u_offset / 8);
ipu_ch_param_mod_field(ipu_ch_param_addr(ch), 0, 68, 22, v_offset / 8);