From fffc7b1bc980efef468c26f82c6907a0a6b7e75d Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Fri, 11 Sep 2015 16:09:57 +0800 Subject: [PATCH] MLK-11316-2 mxc IPUv3: PRE: Define small Y resolution In order to workaround the PRE SoC bug recorded by errata ERR009624, the software cannot write the PRE_CTRL register when the PRE writes the PRE_CTRL register automatically to set the ENABLE bit(bit0) to 1 in the PRE repeat mode. The software mechanism to set the PRE_CTRL register is different for PRE Y resolution higher than 9 lines and lower than or equal to 9 lines. So, this patch defines the small Y resolution and adds a helper to check the Y resolution. Signed-off-by: Liu Ying (cherry picked from commit cf7df46e3b1d2142ff354498982194247bf07fea) --- include/linux/ipu-v3-pre.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/ipu-v3-pre.h b/include/linux/ipu-v3-pre.h index 2b36d34d25fc..1bf50aeda170 100644 --- a/include/linux/ipu-v3-pre.h +++ b/include/linux/ipu-v3-pre.h @@ -13,6 +13,7 @@ #define IPU_PRE_MAX_WIDTH 1920 #define IPU_PRE_MAX_BPP 4 +#define IPU_PRE_SMALL_LINE 9 /* to workaround errata ERR009624*/ struct ipu_rect { int left; @@ -66,6 +67,20 @@ struct ipu_pre_context { unsigned long store_addr; }; +/* + * In order to workaround the PRE SoC bug recorded by errata ERR009624, + * the software cannot write the PRE_CTRL register when the PRE writes + * the PRE_CTRL register automatically to set the ENABLE bit(bit0) to 1 + * in the PRE repeat mode. + * The software mechanism to set the PRE_CTRL register is different for + * PRE Y resolution higher than 9 lines and lower or equal to 9 lines. + * Use this helper to check the Y resolution. + */ +static inline bool ipu_pre_yres_is_small(unsigned int yres) +{ + return yres <= IPU_PRE_SMALL_LINE; +} + #ifdef CONFIG_MXC_IPU_V3_PRE int ipu_pre_alloc(int ipu_id, ipu_channel_t ipu_ch); void ipu_pre_free(unsigned int *id); -- 2.17.1