msm: vidc: Memset and flush codec context buffers

This change will memset and flush the codec context
buffers for non-secure case to resolve video driver
timer expire issues.

Change-Id: I6669481da3076a392061868475fc9844f2c41064
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
This commit is contained in:
Maheshwar Ajja 2012-09-11 19:44:53 -04:00 committed by Artem Borisov
parent 31456ea019
commit 50f8458679

View file

@ -15,6 +15,7 @@
#include "vcd_ddl_metadata.h"
#include "vcd_ddl_shared_mem.h"
#include "vcd_core.h"
#include "vcd_res_tracker_api.h"
#if defined(PIX_CACHE_DISABLE)
#define DDL_PIX_CACHE_ENABLE false
@ -108,7 +109,9 @@ void ddl_vidc_channel_set(struct ddl_client_context *ddl)
dec_pix_cache = VIDC_1080P_DECODE_PCACHE_DISABLE;
const enum vidc_1080p_encode_p_cache_enable
enc_pix_cache = VIDC_1080P_ENCODE_PCACHE_ENABLE;
u32 pix_cache_ctrl, ctxt_mem_offset, ctxt_mem_size;
u32 pix_cache_ctrl, ctxt_mem_offset, ctxt_mem_size, arg1 = 0;
u8 *hw_ctxt = NULL;
struct ion_handle *alloc_handle;
if (ddl->decoding) {
ddl_set_core_start_time(__func__, DEC_OP_TIME);
@ -116,15 +119,30 @@ void ddl_vidc_channel_set(struct ddl_client_context *ddl)
pix_cache_ctrl = (u32)dec_pix_cache;
ctxt_mem_offset = DDL_ADDR_OFFSET(ddl_context->dram_base_a,
ddl->codec_data.decoder.hw_bufs.context) >> 11;
hw_ctxt =
ddl->codec_data.decoder.hw_bufs.context.align_virtual_addr;
ctxt_mem_size =
ddl->codec_data.decoder.hw_bufs.context.buffer_size;
alloc_handle =
ddl->codec_data.decoder.hw_bufs.context.alloc_handle;
} else {
vcd_codec = &(ddl->codec_data.encoder.codec.codec);
pix_cache_ctrl = (u32)enc_pix_cache;
ctxt_mem_offset = DDL_ADDR_OFFSET(ddl_context->dram_base_a,
ddl->codec_data.encoder.hw_bufs.context) >> 11;
hw_ctxt =
ddl->codec_data.encoder.hw_bufs.context.align_virtual_addr;
ctxt_mem_size =
ddl->codec_data.encoder.hw_bufs.context.buffer_size;
alloc_handle =
ddl->codec_data.encoder.hw_bufs.context.alloc_handle;
}
if (!res_trk_check_for_sec_session() && hw_ctxt) {
memset(hw_ctxt, 0, ctxt_mem_size);
msm_ion_do_cache_op(ddl_context->video_ion_client,
alloc_handle, hw_ctxt, ctxt_mem_size,
ION_IOC_CLEAN_INV_CACHES);
arg1 = 1 << 29;
}
switch (*vcd_codec) {
default:
@ -184,8 +202,9 @@ void ddl_vidc_channel_set(struct ddl_client_context *ddl)
DDL_MSG_LOW("ddl_state_transition: %s ~~> DDL_CLIENT_WAIT_FOR_CHDONE",
ddl_get_state_string(ddl->client_state));
ddl->client_state = DDL_CLIENT_WAIT_FOR_CHDONE;
arg1 |= (u32)codec;
vidc_1080p_set_host2risc_cmd(VIDC_1080P_HOST2RISC_CMD_OPEN_CH,
(u32)codec, pix_cache_ctrl, ctxt_mem_offset,
arg1, pix_cache_ctrl, ctxt_mem_offset,
ctxt_mem_size);
}