F: drivers/amlogic/media/deinterlace/di_pqa.h
F: drivers/amlogic/media/di_local/*
+AMLOGIC DEINTERLACE DRIVER
+M: qianqian cai <qianqian.cai@amlogic.com>
+F: include/linux/amlogic/media/di/di.h
+
AMLOGIC ADD DI_MULTI DRIVER
M: Jihong Sui <jihong.sui@amlogic.com>
F: drivers/amlogic/media/di_multi/*
********************************************/
void di_trig_free_mirror_mem(void)
{
+ if (dil_get_diffver_flag())
+ return;
+
if (atomic_read(&di_flag_unreg)
&& de_devp->flag_cma != 2
&& de_devp->flag_cma != 0
dil_attach_ext_api(&di_ext);
di_patch_mov_ini();
+ dil_set_diffver_flag(0);
+
di_pr_info("%s:ok\n", __func__);
return ret;
extern int reg_cue_int_show(struct seq_file *seq, void *v);
bool dil_attach_ext_api(const struct di_ext_ops *di_api);
-/*---------------------*/
+/*--Different DI versions flag---*/
+void dil_set_diffver_flag(unsigned int para);
+unsigned int dil_get_diffver_flag(void);
+/*-------------------------*/
struct di_buf_s *get_di_buf(int queue_idx, int *start_pos);
#define queue_for_each_entry(di_buf, ptm, queue_idx, list) \
static const struct di_ext_ops *dil_api; //temp
+static unsigned int diffver_flag;
+
+/***************************************
+ * dil api for make a distinction between old/new DI function *
+ **************************************/
+void dil_set_diffver_flag(unsigned int para)
+{
+ diffver_flag = para;
+}
+EXPORT_SYMBOL(dil_set_diffver_flag);
+unsigned int dil_get_diffver_flag(void)
+{
+ return diffver_flag;
+}
+EXPORT_SYMBOL(dil_get_diffver_flag);
+
/***************************************
* di api for other module *
**************************************/
di_buf = &pbuf_post[di_buf_index];
if (!di_que_is_in_que(ch, QUE_POST_KEEP, di_buf)) {
- PR_ERR("%s:buf[%d] is not in keep\n", __func__, di_buf_index);
+ if (is_in_queue(ch, di_buf, QUEUE_DISPLAY)) {
+ di_buf->queue_index = -1;
+ di_que_in(ch, QUE_POST_BACK, di_buf);
+ dbg_keep("%s:to back[%d]\n", __func__, di_buf_index);
+ } else {
+ PR_ERR("%s:buf[%d] is not in keep or display\n",
+ __func__, di_buf_index);
+ }
return false;
}
di_que_out_not_fifo(ch, QUE_POST_KEEP, di_buf);
di_buf->index);
task_send_cmd(LCMD2(ECMD_RL_KEEP, di_buf->channel, di_buf->index));
}
-EXPORT_SYMBOL(dim_post_keep_cmd_release);
void dim_post_keep_cmd_release2(struct vframe_s *vframe)
{
struct di_buf_s *di_buf;
+ if (!dil_get_diffver_flag())
+ return;
+
if (!vframe)
return;
return;
}
- if (!di_que_is_in_que(di_buf->channel, QUE_POST_KEEP, di_buf)) {
- PR_ERR("%s:not keep buf %d\n", __func__, di_buf->index);
- } else {
- dbg_keep("release keep ch[%d],index[%d]\n",
- di_buf->channel,
- di_buf->index);
- task_send_cmd(LCMD2(ECMD_RL_KEEP, di_buf->channel,
- di_buf->index));
- }
+ dbg_keep("release keep ch[%d],index[%d]\n",
+ di_buf->channel,
+ di_buf->index);
+ task_send_cmd(LCMD2(ECMD_RL_KEEP, di_buf->channel,
+ di_buf->index));
}
EXPORT_SYMBOL(dim_post_keep_cmd_release2);
chst = dip_chst_get(ch);
switch (chst) {
case EDI_TOP_STATE_READY:
+ case eDI_TOP_STATE_UNREG_STEP2:
dim_post_keep_release_one(ch, index);
break;
case EDI_TOP_STATE_IDLE:
}
di_buf = &pbuf_post[index];
- di_buf->queue_index = -1;
- di_que_in(ch, QUE_POST_KEEP_BACK, di_buf);
+ if (is_in_queue(ch, di_buf, QUEUE_DISPLAY)) {
+ di_buf->queue_index = -1;
+ di_que_in(ch, QUE_POST_BACK, di_buf);
+ dbg_keep("%s:to back[%d]\n", __func__, index);
+ } else {
+ PR_ERR("%s:buf[%d] is not in display\n",
+ __func__, index);
+ }
break;
default:
PR_ERR("%s:do nothing? %s:%d\n",
dimh_patch_post_update_mc_sw(DI_MC_SW_IC, true);
+ dil_set_diffver_flag(1);
+
pr_info("%s:ok\n", __func__);
return ret;
bool dim_cma_top_alloc(unsigned int ch);
bool dim_cma_top_release(unsigned int ch);
bool dim_rev_mem_check(void);
+/*--Different DI versions flag---*/
+void dil_set_diffver_flag(unsigned int para);
+unsigned int dil_get_diffver_flag(void);
+/*-------------------------*/
#endif /*__DI_SYS_H__*/
--- /dev/null
+/*
+ * include/linux/amlogic/media/di/di.h
+ *
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#ifndef DI_H
+#define DI_H
+
+void dim_post_keep_cmd_release2(struct vframe_s *vframe);
+
+#endif /* VIDEO_H */