vidc:vdec: Clean extradata portion and invalidate whole buffer

This commit will ensure to clean the extradata portion in
output buffer changed by the CPU before sending the buffer
to Video hardware and invalidate the output buffer changed
by Video hardware before CPU access the buffer.

Change-Id: I05ea24fb381a164f6cfd520bd9071a94349ed2df
CRs-fixed: 366446
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
This commit is contained in:
Maheshwar Ajja 2012-06-22 12:27:04 +05:30 committed by Stephen Boyd
parent 3341801f5d
commit 2998394a12
2 changed files with 28 additions and 1 deletions

View file

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

View file

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