pq: add pq demo interface [1/1]

PD#TV-7491

Problem:
pq demo function

Solution:
add pq demo interface

Verify:
verify on TL1

Change-Id: If53fbba5f59a278394f71420e5cdc9c481abc0f7
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
This commit is contained in:
MingLiang Dong
2019-07-08 23:21:03 -04:00
committed by Tao Zeng
parent 608b4e081c
commit e878c82dff
6 changed files with 71 additions and 0 deletions

View File

@@ -33,6 +33,8 @@
#include "deinterlace.h"
#include "register.h"
#include "register_nr4.h"
#include "nr_drv.h"
#ifdef DET3D
#include "detect3d.h"
#endif
@@ -3873,6 +3875,11 @@ void di_load_regs(struct di_pq_parm_s *di_pq_ptr)
addr = regs_p->addr;
value = regs_p->val;
mask = regs_p->mask;
if (nr_demo_flag) {
if (addr == NR4_TOP_CTRL)
mask &= ~(0x7 << 6);
}
if (pq_load_dbg == 2)
pr_info("[%u][0x%x] = [0x%x]&[0x%x]\n",
i, addr, value, mask);

View File

@@ -46,6 +46,8 @@ module_param_named(nr2_en, nr2_en, uint, 0644);
static bool nr_ctrl_reg;
bool nr_demo_flag;
int global_bs_calc_sw(int *pGbsVldCnt,
int *pGbsVldFlg,
int *pGbs,
@@ -1173,6 +1175,18 @@ static void nr_all_ctrl(bool enable)
DI_Wr_reg_bits(DNR_CTRL, value, 16, 1);
}
static void nr_demo_mode(bool enable)
{
if (enable) {
DI_Wr_reg_bits(NR4_TOP_CTRL, 0, 6, 3);
nr_demo_flag = 1;
} else {
DI_Wr_reg_bits(NR4_TOP_CTRL, 7, 6, 3);
nr_demo_flag = 0;
}
}
static ssize_t nr_dbg_store(struct device *dev,
struct device_attribute *attr,
const char *buff, size_t count)
@@ -1185,6 +1199,15 @@ static ssize_t nr_dbg_store(struct device *dev,
nr_all_ctrl(false);
else if (!strcmp(parm[0], "enable"))
nr_all_ctrl(true);
else if (!strcmp(parm[0], "demo")) {
if (!strcmp(parm[1], "enable")) {
nr_demo_mode(true);
pr_info("nr demo enable\n");
} else if (!strcmp(parm[1], "disable")) {
nr_demo_mode(false);
pr_info("nr demo disable\n");
}
}
kfree(buf_orig);
return count;

View File

@@ -185,5 +185,6 @@ bool set_nr_ctrl_reg_table(unsigned int addr, unsigned int value);
extern void cue_int(void);
extern bool nr_demo_flag;
#endif

View File

@@ -253,6 +253,13 @@ void am_set_regmap(struct am_regs_s *p)
} else {
if (p->am_reg[i].addr == 0x1d26)
break;
if (sr_demo_flag) {
if ((p->am_reg[i].addr ==
SHARP0_DEMO_CRTL) ||
(p->am_reg[i].addr ==
SHARP1_DEMO_CRTL))
break;
}
/*if the bit 4 of SRSHARP1_LC_TOP_CTRL is 1,
*it means that lc is enable in db,
*so need to change lc_en to 1;

View File

@@ -189,6 +189,8 @@ enum hdr_type_e hdr_source_type = HDRTYPE_NONE;
#define SR1_OFFSET 0xc80
unsigned int sr_offset[2] = {0, 0};
unsigned int sr_demo_flag;
static int wb_init_bypass_coef[24] = {
0, 0, 0, /* pre offset */
1024, 0, 0,
@@ -4453,6 +4455,28 @@ void amvecm_sharpness_enable(int sel)
}
}
void amvecm_sr_demo(int enable)
{
if (enable) {
sr_demo_flag = 1;
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 2, 17, 2);
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 1, 16, 1);
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 0x438, 0, 13);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 2, 17, 2);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 1, 16, 1);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 0x438, 0, 13);
} else {
sr_demo_flag = 0;
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 2, 17, 2);
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 0, 16, 1);
WRITE_VPP_REG_BITS(SHARP0_DEMO_CRTL, 0x438, 0, 13);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 2, 17, 2);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 0, 16, 1);
WRITE_VPP_REG_BITS(SHARP1_DEMO_CRTL, 0x438, 0, 13);
}
}
void amvecm_clip_range_limit(bool limit_en)
{
/*fix mbox av out flicker black dot*/
@@ -5250,6 +5274,14 @@ static ssize_t amvecm_debug_store(struct class *cla,
amvecm_sharpness_enable(11);
amvecm_sharpness_enable(13);
pr_info("SR disable\n");
} else if (!strncmp(parm[1], "demo", 4)) {
if (!strncmp(parm[2], "enable", 6)) {
amvecm_sr_demo(1);
pr_info("sr demo enable\n");
} else if (!strncmp(parm[2], "disable", 7)) {
amvecm_sr_demo(0);
pr_info("sr demo disable\n");
}
}
} else if (!strcmp(parm[0], "cm")) {
if (!strncmp(parm[1], "enable", 6)) {

View File

@@ -460,6 +460,7 @@ extern signed int vd1_brightness, vd1_contrast;
extern bool gamma_en;
extern unsigned int atv_source_flg;
extern unsigned int sr_demo_flag;
extern enum hdr_type_e hdr_source_type;