rk30: vpu_service: add vpu_reset() before encode one frame
author陈恒明 <chm@rock-chips.com>
Tue, 10 Apr 2012 01:38:08 +0000 (09:38 +0800)
committer陈恒明 <chm@rock-chips.com>
Tue, 10 Apr 2012 01:38:08 +0000 (09:38 +0800)
arch/arm/plat-rk/vpu_service.c

index 0e3d3849ce27a4c08d2f3a7ef796a05528490fe5..ce6ed064810681d7353e20745b06917ee3afb95c 100644 (file)
@@ -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++)