From 44a10edbee8a71154bc4022e059b122b8c79cdce Mon Sep 17 00:00:00 2001 From: Alpha Lin Date: Tue, 15 Sep 2015 19:01:29 +0800 Subject: [PATCH] IEP: re-caculate the uv address when 4k video input in iommu enable case. In above case, old code will generate a fault address for uv address if 4k video input or output. Change-Id: I22e9793fbaa2da250097ba69a3fd4fdf58585b78 Signed-off-by: Alpha Lin --- drivers/video/rockchip/iep/hw_iep_reg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/video/rockchip/iep/hw_iep_reg.c b/drivers/video/rockchip/iep/hw_iep_reg.c index 9df61660b9e0..d44d0c890151 100644 --- a/drivers/video/rockchip/iep/hw_iep_reg.c +++ b/drivers/video/rockchip/iep/hw_iep_reg.c @@ -1494,6 +1494,8 @@ static int iep_reg_address_translate(iep_service_info *pservice, struct iep_reg void iep_config(iep_session *session, struct IEP_MSG *iep_msg) { struct iep_reg *reg = kzalloc(sizeof(struct iep_reg), GFP_KERNEL); + int w; + int h; reg->session = session; iep_msg->base = reg->reg; @@ -1567,6 +1569,16 @@ void iep_config(iep_session *session, struct IEP_MSG *iep_msg) } } #endif + /* workaround for iommu enable case when 4k video input */ + w = (iep_msg->src.act_w + 15) & (0xfffffff0); + h = (iep_msg->src.act_h + 15) & (0xfffffff0); + if (w > 1920 && iep_msg->src.format == IEP_FORMAT_YCbCr_420_SP) + reg->reg[33] = reg->reg[32] + w * h; + + w = (iep_msg->dst.act_w + 15) & (0xfffffff0); + h = (iep_msg->dst.act_h + 15) & (0xfffffff0); + if (w > 1920 && iep_msg->dst.format == IEP_FORMAT_YCbCr_420_SP) + reg->reg[45] = reg->reg[44] + w * h; mutex_lock(&iep_service.lock); -- 2.34.1