static dev_t di_devno;
static struct class *di_clsp;
-static const char version_s[] = "2018-08-03a";
+static const char version_s[] = "2018-08-06a";
static int bypass_state = 1;
static int bypass_all;
for (i = 0; i < MAX_IN_BUF_NUM; i++)
vframe_in[i] = NULL;
di_pre_stru.pre_de_process_done = 0;
- di_pre_stru.pre_de_busy = 0;
di_pre_stru.pre_de_process_flag = 0;
if (post_wr_en && post_wr_support) {
di_post_stru.cur_post_buf = NULL;
#endif
static void pre_de_process(void)
{
+ ulong irq_flag2 = 0;
unsigned short pre_width = 0, pre_height = 0;
unsigned char chan2_field_num = 1;
int canvases_idex = di_pre_stru.field_count_for_cont % 2;
vdin_ops->tvin_vdin_func(0, &vdin_arg);
}
#endif
- enable_di_pre_mif(true, mcpre_en);
+ /* must make sure follow part issue without iterrupts,
+ * otherwise may cause watch dog reboot
+ */
+ di_lock_irqfiq_save(irq_flag2);
if (cpu_after_eq(MESON_CPU_MAJOR_ID_G12A)) {
pre_frame_reset_g12(di_pre_stru.madi_enable,
di_pre_stru.mcdi_enable);
/* enable mc pre mif*/
enable_di_pre_mif(true, mcpre_en);
}
+ di_unlock_irqfiq_restore(irq_flag2);
/*reinit pre busy flag*/
di_pre_stru.pre_de_busy_timer_count = 0;
di_pre_stru.pre_de_busy = 1;
if (unreg_cnt > 0x3fffffff)
unreg_cnt = 0;
pr_dbg("%s unreg stop %d.\n", __func__, reg_flag);
- di_pre_stru.pre_de_busy = 0;
di_pre_stru.unreg_req_flag_irq = 1;
reg_flag = 0;
trigger_pre_di_process(TRIGGER_PRE_BY_UNREG);
di_top_gate_control(true, false);
}
de_devp->flags |= DI_VPU_CLKB_SET;
- enable_di_pre_mif(true, mcpre_en);
+ enable_di_pre_mif(false, mcpre_en);
di_pre_gate_control(true, mcpre_en);
nr_gate_control(true);
} else {
int i;
if (active_flag) {
- if (pre_stru_p->unreg_req_flag_irq)
+ /* must wait pre de done or time out to clear the de_busy
+ * otherwise may appear watch dog reboot probablity
+ * caused by disable mif in unreg_process_irq
+ */
+ if (pre_stru_p->unreg_req_flag_irq &&
+ (di_pre_stru.pre_de_busy == 0))
di_unreg_process_irq();
if (init_flag == 0 && pre_stru_p->reg_req_flag_irq == 0)
di_reg_process_irq();
if (vf->type & VIDTYPE_COMPRESS) {
r = (3 << 24) |
- (17 << 16) |
+ (10 << 16) |
(1 << 14) | /*burst1 1*/
vf->bitdepth;
r |= 0x88;
RDMA_WR(AFBC_MODE, r);
- RDMA_WR(AFBC_ENABLE, 0x1700);
RDMA_WR(AFBC_CONV_CTRL, 0x100);
u = (vf->bitdepth >> (BITDEPTH_U_SHIFT)) & 0x3;
v = (vf->bitdepth >> (BITDEPTH_V_SHIFT)) & 0x3;
RDMA_WR_BITS(DI_INP_GEN_REG, 0, 0, 1);
/* afbc to di enable */
if (!cpu_after_eq(MESON_CPU_MAJOR_ID_G12A)) {
- if (Rd_reg_bits(VIU_MISC_CTRL0, 19, 1) != 1)
- RDMA_WR_BITS(VIU_MISC_CTRL0, 1, 19, 1);
/* DI inp(current data) switch to AFBC */
- RDMA_WR_BITS(VIUB_MISC_CTRL0, 1, 16, 1);
+ if (RDMA_RD_BITS(VIU_MISC_CTRL0, 29, 1) != 1)
+ RDMA_WR_BITS(VIU_MISC_CTRL0, 1, 29, 1);
+ if (RDMA_RD_BITS(VIUB_MISC_CTRL0, 16, 1) != 1)
+ RDMA_WR_BITS(VIUB_MISC_CTRL0, 1, 16, 1);
+ if (RDMA_RD_BITS(VIU_MISC_CTRL1, 0, 1) != 1)
+ RDMA_WR_BITS(VIU_MISC_CTRL1, 1, 0, 1);
+ if (RDMA_RD(VD2_AFBC_ENABLE) != 0x1600)
+ RDMA_WR(VD2_AFBC_ENABLE, 0x1600);
}
} else {
RDMA_WR(AFBC_ENABLE, 0);
/* afbc to vpp(replace vd1) enable */
if (!cpu_after_eq(MESON_CPU_MAJOR_ID_G12A)) {
- if (Rd_reg_bits(VIU_MISC_CTRL0, 19, 1) != 0)
- RDMA_WR_BITS(VIU_MISC_CTRL0, 0, 19, 1);
- /* DI inp(current data) switch to memory */
- RDMA_WR_BITS(VIUB_MISC_CTRL0, 0, 16, 1);
+ if (RDMA_RD_BITS(VIU_MISC_CTRL1, 0, 1) != 0 ||
+ RDMA_RD_BITS(VIUB_MISC_CTRL0, 16, 1) != 0) {
+ RDMA_WR_BITS(VIU_MISC_CTRL1, 0, 0, 1);
+ RDMA_WR_BITS(VIUB_MISC_CTRL0, 0, 16, 1);
+ }
}
}
}
/* enable input mif*/
DI_Wr(DI_CHAN2_GEN_REG, Rd(DI_CHAN2_GEN_REG) | 0x1);
DI_Wr(DI_MEM_GEN_REG, Rd(DI_MEM_GEN_REG) | 0x1);
- DI_Wr(DI_INP_GEN_REG, Rd(DI_INP_GEN_REG) | 0x1);
+ if (Rd_reg_bits(VIU_MISC_CTRL1, 0, 1) == 1) {
+ DI_Wr(DI_INP_GEN_REG, Rd(DI_INP_GEN_REG) & ~0x1);
+ RDMA_WR_BITS(VD2_AFBC_ENABLE, 1, 8, 1);
+ } else {
+ DI_Wr(DI_INP_GEN_REG, Rd(DI_INP_GEN_REG) | 0x1);
+ RDMA_WR_BITS(VD2_AFBC_ENABLE, 0, 8, 1);
+ }
/* nrwr no clk gate en=0 */
RDMA_WR_BITS(DI_NRWR_CTRL, 0, 24, 1);
} else {
DI_Wr(DI_CHAN2_GEN_REG, Rd(DI_CHAN2_GEN_REG) & ~0x1);
DI_Wr(DI_MEM_GEN_REG, Rd(DI_MEM_GEN_REG) & ~0x1);
DI_Wr(DI_INP_GEN_REG, Rd(DI_INP_GEN_REG) & ~0x1);
+ /* disable AFBC input */
+ if (Rd_reg_bits(VIU_MISC_CTRL1, 0, 1) == 1)
+ RDMA_WR_BITS(VD2_AFBC_ENABLE, 0, 8, 1);
}
}