From: 陈恒明 Date: Tue, 10 Apr 2012 01:38:08 +0000 (+0800) Subject: rk30: vpu_service: add vpu_reset() before encode one frame X-Git-Tag: firefly_0821_release~9445 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50d42a515b560d774fee008ea3259fed246e6235;p=firefly-linux-kernel-4.4.55.git rk30: vpu_service: add vpu_reset() before encode one frame --- diff --git a/arch/arm/plat-rk/vpu_service.c b/arch/arm/plat-rk/vpu_service.c index 0e3d3849ce27..ce6ed0648106 100644 --- a/arch/arm/plat-rk/vpu_service.c +++ b/arch/arm/plat-rk/vpu_service.c @@ -113,13 +113,14 @@ typedef struct vpu_session { * * @author ChenHengming (2011-5-4) */ +#define VPU_REG_NUM_MAX (((VPU_REG_NUM_ENC)>(VPU_REG_NUM_DEC_PP))?(VPU_REG_NUM_ENC):(VPU_REG_NUM_DEC_PP)) typedef struct vpu_reg { VPU_CLIENT_TYPE type; vpu_session *session; struct list_head session_link; /* link to vpu service session */ struct list_head status_link; /* link to register set list */ unsigned long size; - unsigned long reg[VPU_REG_NUM_DEC_PP]; + unsigned long reg[VPU_REG_NUM_MAX]; } vpu_reg; typedef struct vpu_device { @@ -449,6 +450,8 @@ void reg_copy_to_hw(vpu_reg *reg) u32 *dst = (u32 *)enc_dev.hwregs; service.reg_codec = reg; + vpu_reset(); + dst[VPU_REG_EN_ENC] = src[VPU_REG_EN_ENC] & 0x6; for (i = 0; i < VPU_REG_EN_ENC; i++)