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 <alpha.lin@rock-chips.com>
This commit is contained in:
Alpha Lin
2015-09-15 19:01:29 +08:00
committed by Gerrit Code Review
parent 0eb015892d
commit 44a10edbee

View File

@@ -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);