diff --git a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c index 6fd5656071ba..d7ebd54593ac 100644 --- a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c +++ b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c @@ -168,6 +168,28 @@ u32 ddl_decoder_dpb_transact(struct ddl_decoder_data *decoder, } else if (operation == DDL_DPB_OP_MARK_FREE) { dpb_mask->client_mask |= (0x1 << loopc); *found_frame = *in_out_frame; + if ((decoder->meta_data_enable_flag) && + (in_out_frame->vcd_frm.buff_ion_handle)) { + struct ddl_context *ddl_context = + ddl_get_context(); + unsigned long *vaddr = + (unsigned long *)((u32) + in_out_frame->vcd_frm.virtual + + decoder->meta_data_offset); + DDL_MSG_LOW("%s: Cache clean: vaddr"\ + " (%p), offset %u, size %u", + __func__, + in_out_frame->vcd_frm.virtual, + decoder->meta_data_offset, + decoder->suffix); + msm_ion_do_cache_op( + ddl_context->video_ion_client, + in_out_frame->vcd_frm.\ + buff_ion_handle, + vaddr, + (unsigned long)decoder->suffix, + ION_IOC_CLEAN_CACHES); + } } } else { in_out_frame->vcd_frm.physical = NULL; diff --git a/drivers/video/msm/vidc/common/dec/vdec.c b/drivers/video/msm/vidc/common/dec/vdec.c index 3076aa1afe2d..ed8b452f0754 100644 --- a/drivers/video/msm/vidc/common/dec/vdec.c +++ b/drivers/video/msm/vidc/common/dec/vdec.c @@ -348,10 +348,15 @@ static void vid_dec_output_frame_done(struct video_client_ctx *client_ctx, pmem_fd, kernel_vaddr, buffer_index, &buff_handle); if (ion_flag == CACHED && buff_handle) { + DBG("%s: Cache invalidate: vaddr (%p), "\ + "size %u\n", __func__, + (void *)kernel_vaddr, + vcd_frame_data->alloc_len); msm_ion_do_cache_op(client_ctx->user_ion_client, buff_handle, (unsigned long *) kernel_vaddr, - (unsigned long)vcd_frame_data->data_len, + (unsigned long)vcd_frame_data->\ + alloc_len, ION_IOC_INV_CACHES); } }