mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
amvecm: packet dnlp algorithm
PD#171026: amvecm: packet dnlp algorithm Change-Id: I29dec857c1ca2eed47fd27f6cb3ec986daeaab6a Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
This commit is contained in:
committed by
Yixun Lan
parent
f32a3e45bb
commit
3281c4c10b
@@ -13896,6 +13896,7 @@ M: Mingliang Dong <mingliang.dong@amlogic.com>
|
||||
F: drivers/amlogic/media/enhancement/amvecm/*
|
||||
F: drivers/amlogic/media/enhancement/amvecm/dolby_vision/*
|
||||
F: drivers/amlogic/media/enhancement/amvecm/arch/*
|
||||
F: drivers/amlogic/media/enhancement/amvecm/dnlp_algorithm/*
|
||||
F: include/linux/amlogic/media/amvecm/*
|
||||
|
||||
AMLOGIC GXL ADD SKT DTS
|
||||
|
||||
@@ -292,13 +292,14 @@ void ve_on_vs(struct vframe_s *vf)
|
||||
|
||||
if (dnlp_en_2 || ve_en) {
|
||||
/* calculate dnlp target data */
|
||||
ve_dnlp_calculate_tgtx_v3(vf);
|
||||
/* calculate dnlp low-pass-filter data */
|
||||
ve_dnlp_calculate_lpf();
|
||||
/* calculate dnlp reg data */
|
||||
ve_dnlp_calculate_reg();
|
||||
/* load dnlp reg data */
|
||||
ve_dnlp_load_reg();
|
||||
if (ve_dnlp_calculate_tgtx(vf)) {
|
||||
/* calculate dnlp low-pass-filter data */
|
||||
ve_dnlp_calculate_lpf();
|
||||
/* calculate dnlp reg data */
|
||||
ve_dnlp_calculate_reg();
|
||||
/* load dnlp reg data */
|
||||
ve_dnlp_load_reg();
|
||||
}
|
||||
}
|
||||
ve_hist_gamma_tgt(vf);
|
||||
|
||||
@@ -664,11 +665,13 @@ void ve_set_dnlp_2(void)
|
||||
{
|
||||
ulong i = 0;
|
||||
/* clear historic luma sum */
|
||||
ve_dnlp_luma_sum = 0;
|
||||
if (dnlp_insmod_ok == 0)
|
||||
return;
|
||||
*ve_dnlp_luma_sum_copy = 0;
|
||||
/* init tgt & lpf */
|
||||
for (i = 0; i < 64; i++) {
|
||||
ve_dnlp_tgt[i] = i << 2;
|
||||
ve_dnlp_lpf[i] = (ulong)ve_dnlp_tgt[i] << ve_dnlp_rt;
|
||||
ve_dnlp_tgt_copy[i] = i << 2;
|
||||
ve_dnlp_lpf[i] = (ulong)ve_dnlp_tgt_copy[i] << ve_dnlp_rt;
|
||||
}
|
||||
/* calculate dnlp reg data */
|
||||
ve_dnlp_calculate_reg();
|
||||
|
||||
@@ -946,6 +946,8 @@ int amvecm_on_vs(
|
||||
if (for_dolby_vision_certification())
|
||||
return 0;
|
||||
#endif
|
||||
if (!dnlp_insmod_ok)
|
||||
dnlp_alg_param_init();
|
||||
if (flags & CSC_FLAG_CHECK_OUTPUT) {
|
||||
if (toggle_vf)
|
||||
amvecm_fresh_overscan(toggle_vf);
|
||||
@@ -1333,6 +1335,12 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return 0;
|
||||
buf_orig = kstrdup(buf, GFP_KERNEL);
|
||||
parse_param_amvecm(buf_orig, (char **)&parm);
|
||||
|
||||
if (!dnlp_insmod_ok) {
|
||||
pr_info("dnlp insmod fial\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!strcmp(parm[0], "r")) {/*read param*/
|
||||
if (!strcmp(parm[1], "param")) {
|
||||
if (!strcmp(parm[2], "all")) {
|
||||
@@ -1354,6 +1362,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
break;
|
||||
}
|
||||
}
|
||||
dnlp_dbg_node_copy();
|
||||
}
|
||||
} else if (!strcmp(parm[0], "w")) {/*write param*/
|
||||
for (i = 0; dnlp_parse_cmd[i].value; i++) {
|
||||
@@ -1370,6 +1379,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
*(dnlp_parse_cmd[i].value));
|
||||
break;
|
||||
}
|
||||
dnlp_dbg_node_copy();
|
||||
}
|
||||
} else if (!strcmp(parm[0], "rc")) {/*read curve*/
|
||||
if (!strcmp(parm[1], "scurv_low")) {
|
||||
@@ -1380,7 +1390,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(dnlp_scurv_low[i],
|
||||
d_convert_str(dnlp_scurv_low_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1392,7 +1402,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 64) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", dnlp_scurv_low[val]);
|
||||
pr_info("%d\n",
|
||||
dnlp_scurv_low_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_mid1")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1402,7 +1413,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(dnlp_scurv_mid1[i],
|
||||
d_convert_str(dnlp_scurv_mid1_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1414,7 +1425,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 64) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", dnlp_scurv_mid1[val]);
|
||||
pr_info("%d\n",
|
||||
dnlp_scurv_mid1_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scu v_mid2")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1424,7 +1436,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(dnlp_scurv_mid2[i],
|
||||
d_convert_str(dnlp_scurv_mid2_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1436,7 +1448,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 64) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", dnlp_scurv_mid2[val]);
|
||||
pr_info("%d\n",
|
||||
dnlp_scurv_mid2_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_hgh1")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1446,7 +1459,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(dnlp_scurv_hgh1[i],
|
||||
d_convert_str(dnlp_scurv_hgh1_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1458,7 +1471,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 64) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", dnlp_scurv_hgh1[val]);
|
||||
pr_info("%d\n",
|
||||
dnlp_scurv_hgh1_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_hgh2")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1468,7 +1482,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(dnlp_scurv_hgh2[i],
|
||||
d_convert_str(dnlp_scurv_hgh2_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1480,7 +1494,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 64) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", dnlp_scurv_hgh2[val]);
|
||||
pr_info("%d\n",
|
||||
dnlp_scurv_hgh2_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "gain_var_lut49")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1490,7 +1505,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 49; i++)
|
||||
d_convert_str(gain_var_lut49[i],
|
||||
d_convert_str(gain_var_lut49_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1502,7 +1517,8 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 48) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", gain_var_lut49[val]);
|
||||
pr_info("%d\n",
|
||||
gain_var_lut49_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "wext_gain")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1512,7 +1528,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 48; i++)
|
||||
d_convert_str(wext_gain[i],
|
||||
d_convert_str(wext_gain_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else {
|
||||
@@ -1524,7 +1540,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if ((val > 47) || (val < 0))
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
pr_info("%d\n", wext_gain[val]);
|
||||
pr_info("%d\n", wext_gain_copy[val]);
|
||||
}
|
||||
} else if (!strcmp(parm[1], "ve_dnlp_tgt")) {
|
||||
/*read only curve*/
|
||||
@@ -1535,7 +1551,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(ve_dnlp_tgt[i],
|
||||
d_convert_str(ve_dnlp_tgt_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else
|
||||
@@ -1549,7 +1565,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(GmScurve[i],
|
||||
d_convert_str(GmScurve_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else
|
||||
@@ -1563,7 +1579,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(clash_curve[i],
|
||||
d_convert_str(clash_curve_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else
|
||||
@@ -1577,7 +1593,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(clsh_scvbld[i],
|
||||
d_convert_str(clsh_scvbld_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else
|
||||
@@ -1591,7 +1607,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
return -EINVAL;
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
for (i = 0; i < 65; i++)
|
||||
d_convert_str(blkwht_ebld[i],
|
||||
d_convert_str(blkwht_ebld_copy[i],
|
||||
i, stemp, 4);
|
||||
pr_info("%s\n", stemp);
|
||||
} else
|
||||
@@ -1622,7 +1638,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 65; i++)
|
||||
dnlp_scurv_low[i] = curve_val[i];
|
||||
dnlp_scurv_low_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1638,7 +1654,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 64)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
dnlp_scurv_low[num] = val;
|
||||
dnlp_scurv_low_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_mid1")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1649,7 +1665,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 65; i++)
|
||||
dnlp_scurv_mid1[i] = curve_val[i];
|
||||
dnlp_scurv_mid1_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1665,7 +1681,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 64)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
dnlp_scurv_mid1[num] = val;
|
||||
dnlp_scurv_mid1_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_mid2")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1676,7 +1692,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 65; i++)
|
||||
dnlp_scurv_mid2[i] = curve_val[i];
|
||||
dnlp_scurv_mid2_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(buf_orig);
|
||||
@@ -1692,7 +1708,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 64)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
dnlp_scurv_mid2[num] = val;
|
||||
dnlp_scurv_mid2_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_hgh1")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1703,7 +1719,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 65; i++)
|
||||
dnlp_scurv_hgh1[i] = curve_val[i];
|
||||
dnlp_scurv_hgh1_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1719,7 +1735,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 64)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
dnlp_scurv_hgh1[num] = val;
|
||||
dnlp_scurv_hgh1_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "scurv_hgh2")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1730,7 +1746,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 65; i++)
|
||||
dnlp_scurv_hgh2[i] = curve_val[i];
|
||||
dnlp_scurv_hgh2_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1746,7 +1762,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 64)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
dnlp_scurv_hgh2[num] = val;
|
||||
dnlp_scurv_hgh2_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "gain_var_lut49")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1757,7 +1773,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 49; i++)
|
||||
gain_var_lut49[i] = curve_val[i];
|
||||
gain_var_lut49_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1773,7 +1789,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 48)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
gain_var_lut49[num] = val;
|
||||
gain_var_lut49_copy[num] = val;
|
||||
}
|
||||
} else if (!strcmp(parm[1], "wext_gain")) {
|
||||
if (parm[2] == NULL) {
|
||||
@@ -1784,7 +1800,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
} else if (!strcmp(parm[2], "all")) {
|
||||
str_sapr_to_d(parm[3], curve_val, 5);
|
||||
for (i = 0; i < 48; i++)
|
||||
wext_gain[i] = curve_val[i];
|
||||
wext_gain_copy[i] = curve_val[i];
|
||||
} else {
|
||||
if (kstrtoul(parm[2], 10, &val) < 0) {
|
||||
kfree(stemp);
|
||||
@@ -1800,24 +1816,31 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
|
||||
if (num > 47)
|
||||
pr_info("error cmd\n");
|
||||
else
|
||||
wext_gain[num] = val;
|
||||
wext_gain_copy[num] = val;
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(parm[0], "ro")) {
|
||||
if (!strcmp(parm[1], "luma_avg4"))
|
||||
pr_info("%d\n", ro_luma_avg4);
|
||||
pr_info("%d\n", *ro_luma_avg4_copy);
|
||||
else if (!strcmp(parm[1], "var_d8"))
|
||||
pr_info("%d\n", ro_var_d8);
|
||||
pr_info("%d\n", *ro_var_d8_copy);
|
||||
else if (!strcmp(parm[1], "scurv_gain"))
|
||||
pr_info("%d\n", ro_scurv_gain);
|
||||
pr_info("%d\n", *ro_scurv_gain_copy);
|
||||
else if (!strcmp(parm[1], "blk_wht_ext0"))
|
||||
pr_info("%d\n", ro_blk_wht_ext0);
|
||||
pr_info("%d\n", *ro_blk_wht_ext0_copy);
|
||||
else if (!strcmp(parm[1], "blk_wht_ext1"))
|
||||
pr_info("%d\n", ro_blk_wht_ext1);
|
||||
pr_info("%d\n", *ro_blk_wht_ext1_copy);
|
||||
else if (!strcmp(parm[1], "dnlp_brightness"))
|
||||
pr_info("%d\n", ro_dnlp_brightness);
|
||||
pr_info("%d\n", *ro_dnlp_brightness_copy);
|
||||
else
|
||||
pr_info("error cmd\n");
|
||||
} else if (!strcmp(parm[0], "dnlp_print")) {
|
||||
if (kstrtoul(parm[1], 16, &val) < 0) {
|
||||
kfree(buf_orig);
|
||||
return -EINVAL;
|
||||
}
|
||||
*dnlp_printk_copy = val;
|
||||
pr_info("dnlp_print = %x\n", *dnlp_printk_copy);
|
||||
}
|
||||
kfree(buf_orig);
|
||||
kfree(stemp);
|
||||
@@ -3475,6 +3498,29 @@ static ssize_t amvecm_pq_user_store(struct class *cla,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t amvecm_dnlp_insmod_show(struct class *cla,
|
||||
struct class_attribute *attr, char *buf)
|
||||
{
|
||||
pr_info("usage: echo 1 > /sys/class/amvecm/dnlp_insmod\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t amvecm_dnlp_insmod_store(struct class *cla,
|
||||
struct class_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
size_t r;
|
||||
int val;
|
||||
|
||||
r = sscanf(buf, "%x\n", &val);
|
||||
if ((r != 1))
|
||||
return -EINVAL;
|
||||
|
||||
if (val == 1)
|
||||
dnlp_alg_param_init();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t amvecm_vpp_demo_show(struct class *cla,
|
||||
struct class_attribute *attr, char *buf)
|
||||
@@ -4637,6 +4683,8 @@ static struct class_attribute amvecm_class_attrs[] = {
|
||||
amvecm_write_reg_show, amvecm_write_reg_store),
|
||||
__ATTR(get_hdr_type, 0644,
|
||||
amvecm_get_hdr_type_show, amvecm_get_hdr_type_store),
|
||||
__ATTR(dnlp_insmod, 0644,
|
||||
amvecm_dnlp_insmod_show, amvecm_dnlp_insmod_store),
|
||||
__ATTR_NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
CONFIG_AMLOGIC_DNLP_ALG=m
|
||||
obj-$(CONFIG_AMLOGIC_DNLP_ALG) += dnlp_alg.o
|
||||
|
||||
dnlp-objs = dnlp_alg.o
|
||||
|
||||
TARGET_PRODUCT=t962x_r311
|
||||
KERNEL_ARCH=arm64
|
||||
CROSS_COMPILE=aarch64-linux-gnu-
|
||||
PRODUCT_OUT=./../../../../../../../out/target/product/$(TARGET_PRODUCT)
|
||||
TARGET_PATCH=$(shell pwd)
|
||||
|
||||
ccflags-y += -Idrivers/amlogic/media/enhancement/amvecm/
|
||||
|
||||
all:
|
||||
rm -rf *.o .*.o.d *.order *.symvers *.mod.* .*.o.cmd .*.ko.cmd *.tmp_versions *.ko
|
||||
make -C $(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(TARGET_PATCH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
|
||||
rm -rf *.o .*.o.d *.order *.symvers *.mod.* .*.o.cmd .*.ko.cmd *.tmp_versions/
|
||||
@@ -0,0 +1,160 @@
|
||||
|
||||
#ifndef __AM_DNLP_AGL_H
|
||||
#define __AM_DNLP_AGL_H
|
||||
|
||||
struct param_for_dnlp_s {
|
||||
unsigned int dnlp_alg_enable;
|
||||
unsigned int dnlp_respond;
|
||||
unsigned int dnlp_sel;
|
||||
unsigned int dnlp_respond_flag;
|
||||
unsigned int dnlp_smhist_ck;
|
||||
unsigned int dnlp_mvreflsh;
|
||||
unsigned int dnlp_pavg_btsft;
|
||||
unsigned int dnlp_dbg_i2r;
|
||||
unsigned int dnlp_cuvbld_min;
|
||||
unsigned int dnlp_cuvbld_max;
|
||||
unsigned int dnlp_schg_sft;
|
||||
unsigned int dnlp_bbd_ratio_low;
|
||||
unsigned int dnlp_bbd_ratio_hig;
|
||||
unsigned int dnlp_limit_rng;
|
||||
unsigned int dnlp_range_det;
|
||||
unsigned int dnlp_blk_cctr;
|
||||
unsigned int dnlp_brgt_ctrl;
|
||||
unsigned int dnlp_brgt_range;
|
||||
unsigned int dnlp_brght_add;
|
||||
unsigned int dnlp_brght_max;
|
||||
unsigned int dnlp_dbg_adjavg;
|
||||
unsigned int dnlp_auto_rng;
|
||||
unsigned int dnlp_lowrange;
|
||||
unsigned int dnlp_hghrange;
|
||||
unsigned int dnlp_satur_rat;
|
||||
unsigned int dnlp_satur_max;
|
||||
unsigned int dnlp_set_saturtn;
|
||||
unsigned int dnlp_sbgnbnd;
|
||||
unsigned int dnlp_sendbnd;
|
||||
unsigned int dnlp_clashBgn;
|
||||
unsigned int dnlp_clashEnd;
|
||||
unsigned int dnlp_var_th;
|
||||
unsigned int dnlp_clahe_gain_neg;
|
||||
unsigned int dnlp_clahe_gain_pos;
|
||||
unsigned int dnlp_clahe_gain_delta;
|
||||
unsigned int dnlp_mtdbld_rate;
|
||||
unsigned int dnlp_adpmtd_lbnd;
|
||||
unsigned int dnlp_adpmtd_hbnd;
|
||||
unsigned int dnlp_blkext_ofst;
|
||||
unsigned int dnlp_whtext_ofst;
|
||||
unsigned int dnlp_blkext_rate;
|
||||
unsigned int dnlp_whtext_rate;
|
||||
unsigned int dnlp_bwext_div4x_min;
|
||||
unsigned int dnlp_iRgnBgn;
|
||||
unsigned int dnlp_iRgnEnd;
|
||||
unsigned int dnlp_dbg_map;
|
||||
unsigned int dnlp_final_gain;
|
||||
unsigned int dnlp_cliprate_v3;
|
||||
unsigned int dnlp_cliprate_min;
|
||||
unsigned int dnlp_adpcrat_lbnd;
|
||||
unsigned int dnlp_adpcrat_hbnd;
|
||||
unsigned int dnlp_scurv_low_th;
|
||||
unsigned int dnlp_scurv_mid1_th;
|
||||
unsigned int dnlp_scurv_mid2_th;
|
||||
unsigned int dnlp_scurv_hgh1_th;
|
||||
unsigned int dnlp_scurv_hgh2_th;
|
||||
unsigned int dnlp_mtdrate_adp_en;
|
||||
};
|
||||
|
||||
#if 0
|
||||
struct dnlp_alg_input_param_s {
|
||||
unsigned int pre_1_gamma[65];
|
||||
unsigned int pre_0_gamma[65];
|
||||
unsigned int nTstCnt;
|
||||
unsigned int ve_dnlp_luma_sum;
|
||||
int RBASE;
|
||||
unsigned int ve_dnlp_luma_sum;
|
||||
bool menu_chg_en;
|
||||
};
|
||||
|
||||
struct dnlp_alg_output_param_s {
|
||||
unsigned char ve_dnlp_tgt[65];
|
||||
};
|
||||
|
||||
struct dnlp_debug_ro_param_s {
|
||||
int ro_luma_avg4;
|
||||
int ro_var_d8;
|
||||
int ro_scurv_gain;
|
||||
int ro_blk_wht_ext0;
|
||||
int ro_blk_wht_ext1;
|
||||
int ro_dnlp_brightness;
|
||||
int GmScurve[65];
|
||||
int clash_curve[65];
|
||||
int clsh_scvbld[65];
|
||||
int blkwht_ebld[65];
|
||||
};
|
||||
|
||||
struct dnlp_debug_rw_param_s {
|
||||
int dnlp_scurv_low[65];
|
||||
int dnlp_scurv_mid1[65];
|
||||
int dnlp_scurv_mid2[65];
|
||||
int dnlp_scurv_hgh1[65];
|
||||
int dnlp_scurv_hgh2[65];
|
||||
int gain_var_lut49[49];
|
||||
int wext_gain[48];
|
||||
};
|
||||
|
||||
struct dnlp_debug_param_s {
|
||||
struct dnlp_debug_ro_param_s ro_param;
|
||||
struct dnlp_debug_rw_param_s rw_param;
|
||||
};
|
||||
#endif
|
||||
struct dnlp_alg_input_param_s {
|
||||
unsigned int *pre_1_gamma;
|
||||
unsigned int *pre_0_gamma;
|
||||
unsigned int *nTstCnt;
|
||||
unsigned int *ve_dnlp_luma_sum;
|
||||
int *RBASE;
|
||||
bool *menu_chg_en;
|
||||
};
|
||||
|
||||
struct dnlp_alg_output_param_s {
|
||||
unsigned char *ve_dnlp_tgt;
|
||||
};
|
||||
|
||||
struct dnlp_dbg_ro_param_s {
|
||||
int *ro_luma_avg4;
|
||||
int *ro_var_d8;
|
||||
int *ro_scurv_gain;
|
||||
int *ro_blk_wht_ext0;
|
||||
int *ro_blk_wht_ext1;
|
||||
int *ro_dnlp_brightness;
|
||||
int *GmScurve;
|
||||
int *clash_curve;
|
||||
int *clsh_scvbld;
|
||||
int *blkwht_ebld;
|
||||
};
|
||||
|
||||
struct dnlp_dbg_rw_param_s {
|
||||
int *dnlp_scurv_low;
|
||||
int *dnlp_scurv_mid1;
|
||||
int *dnlp_scurv_mid2;
|
||||
int *dnlp_scurv_hgh1;
|
||||
int *dnlp_scurv_hgh2;
|
||||
int *gain_var_lut49;
|
||||
int *wext_gain;
|
||||
};
|
||||
|
||||
struct dnlp_dbg_print_s {
|
||||
int *dnlp_printk;
|
||||
};
|
||||
|
||||
struct dnlp_alg_s {
|
||||
void (*dnlp_algorithm_main)(unsigned int raw_hst_sum);
|
||||
void (*dnlp_para_set)(struct dnlp_alg_output_param_s **dnlp_output,
|
||||
struct dnlp_alg_input_param_s **dnlp_input,
|
||||
struct dnlp_dbg_rw_param_s **rw_param,
|
||||
struct dnlp_dbg_ro_param_s **ro_param,
|
||||
struct param_for_dnlp_s **rw_node,
|
||||
struct dnlp_dbg_print_s **dbg_print);
|
||||
void (*dnlp3_param_refrsh)(void);
|
||||
};
|
||||
extern struct dnlp_alg_s *dnlp_alg_init(struct dnlp_alg_s **dnlp_alg);
|
||||
extern struct dnlp_alg_s *dnlp_alg_function;
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -70,11 +70,6 @@ struct dnlp_parse_cmd_s {
|
||||
extern struct ve_dnlp_table_s am_ve_new_dnlp;
|
||||
extern struct ve_dnlp_curve_param_s dnlp_curve_param_load;
|
||||
extern unsigned int ve_dnlp_rt;
|
||||
extern unsigned char ve_dnlp_tgt[65];
|
||||
extern int GmScurve[65];
|
||||
extern int clash_curve[65];
|
||||
extern int clsh_scvbld[65];
|
||||
extern int blkwht_ebld[65];
|
||||
extern bool ve_en;
|
||||
extern unsigned int ve_dnlp_rt;
|
||||
extern unsigned int ve_dnlp_luma_sum;
|
||||
@@ -83,26 +78,37 @@ extern ulong ve_dnlp_reg[16];
|
||||
extern ulong ve_dnlp_reg_def[16];
|
||||
extern struct dnlp_parse_cmd_s dnlp_parse_cmd[];
|
||||
|
||||
extern int dnlp_scurv_low[65];
|
||||
extern int dnlp_scurv_mid1[65];
|
||||
extern int dnlp_scurv_mid2[65];
|
||||
extern int dnlp_scurv_hgh1[65];
|
||||
extern int dnlp_scurv_hgh2[65];
|
||||
extern int gain_var_lut49[49];
|
||||
extern int wext_gain[48];
|
||||
|
||||
extern int ro_luma_avg4;
|
||||
extern int ro_var_d8;
|
||||
extern int ro_scurv_gain;
|
||||
extern int ro_blk_wht_ext0;
|
||||
extern int ro_blk_wht_ext1;
|
||||
extern int ro_dnlp_brightness;
|
||||
|
||||
extern void ve_dnlp_calculate_tgtx_v3(struct vframe_s *vf);
|
||||
extern int ve_dnlp_calculate_tgtx(struct vframe_s *vf);
|
||||
extern void ve_set_v3_dnlp(struct ve_dnlp_curve_param_s *p);
|
||||
extern void ve_dnlp_calculate_lpf(void);
|
||||
extern void ve_dnlp_calculate_reg(void);
|
||||
extern void dnlp_alg_param_init(void);
|
||||
|
||||
extern int *dnlp_scurv_low_copy;
|
||||
extern int *dnlp_scurv_mid1_copy;
|
||||
extern int *dnlp_scurv_mid2_copy;
|
||||
extern int *dnlp_scurv_hgh1_copy;
|
||||
extern int *dnlp_scurv_hgh2_copy;
|
||||
extern int *gain_var_lut49_copy;
|
||||
extern int *wext_gain_copy;
|
||||
|
||||
extern int *ro_luma_avg4_copy;
|
||||
extern int *ro_var_d8_copy;
|
||||
extern int *ro_scurv_gain_copy;
|
||||
extern int *ro_blk_wht_ext0_copy;
|
||||
extern int *ro_blk_wht_ext1_copy;
|
||||
extern int *ro_dnlp_brightness_copy;
|
||||
extern int *GmScurve_copy;
|
||||
extern int *clash_curve_copy;
|
||||
extern int *clsh_scvbld_copy;
|
||||
extern int *blkwht_ebld_copy;
|
||||
|
||||
extern unsigned int *ve_dnlp_luma_sum_copy;
|
||||
extern unsigned char *ve_dnlp_tgt_copy;
|
||||
|
||||
extern void dnlp_dbg_node_copy(void);
|
||||
extern bool dnlp_insmod_ok; /*0:fail, 1:ok*/
|
||||
extern int *dnlp_printk_copy;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user