summaryrefslogtreecommitdiff
authorBrian Zhu <brian.zhu@amlogic.com>2019-10-10 11:44:46 (GMT)
committer Jianxin Pan <jianxin.pan@amlogic.com>2019-10-16 02:49:17 (GMT)
commit6a7c34e694b64f8f93052394a2e820156971d1d3 (patch)
tree1c28c20d934942dda1d4fae01e2b765b693b8968
parentee078ac5dcd3fc4ce9d48d4af1aa4c7a9dfe7a43 (diff)
downloadcommon-6a7c34e694b64f8f93052394a2e820156971d1d3.zip
common-6a7c34e694b64f8f93052394a2e820156971d1d3.tar.gz
common-6a7c34e694b64f8f93052394a2e820156971d1d3.tar.bz2
amcsc: need force to send fake frame for matrix updating [1/1]
PD#SWPL-14947 Problem: When switch the display mode of VIU1 from panel to hdmi. The csc matrix did not update correctly without video on. Solution: Force to trigger a fake frame to update csc matrix correctly. Verify: Verified on u202 Change-Id: I3e75a2d396ee1c752ed30bf01852afc8b9499f41 Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/enhancement/amvecm/amcsc.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/amlogic/media/enhancement/amvecm/amcsc.c b/drivers/amlogic/media/enhancement/amvecm/amcsc.c
index aa2f6d2..4095f69 100644
--- a/drivers/amlogic/media/enhancement/amvecm/amcsc.c
+++ b/drivers/amlogic/media/enhancement/amvecm/amcsc.c
@@ -7291,10 +7291,15 @@ int amvecm_matrix_process(
bool send_fake_frame = false;
if ((get_cpu_type() < MESON_CPU_MAJOR_ID_GXTVBB) ||
- is_meson_gxl_package_905M2() || (csc_en == 0) ||
- !vinfo || vinfo->mode == VMODE_NULL ||
- vinfo->mode == VMODE_INVALID)
+ is_meson_gxl_package_905M2() || (csc_en == 0) || !vinfo)
+ return 0;
+
+ if (vinfo->mode == VMODE_NULL ||
+ vinfo->mode == VMODE_INVALID) {
+ current_hdr_cap[vd_path] = 0;
+ current_sink_available[vd_path] = 0;
return 0;
+ }
if (reload_mtx) {
for (i = 0; i < NUM_MATRIX; i++)
@@ -7427,6 +7432,8 @@ int amvecm_matrix_process(
null_vf_cnt[vd_path] = 0;
fg_vf_sw_dbg = 3;
} else {
+ bool force_fake = false;
+
last_vf[vd_path] = NULL;
if (null_vf_cnt[vd_path] <= null_vf_max)
@@ -7436,6 +7443,8 @@ int amvecm_matrix_process(
if (cap_changed) {
if (is_video_layer_on(vd_path))
null_vf_cnt[vd_path] = 0;
+ else
+ force_fake = true;
pr_csc(4, "vd%d: sink cap changed when idle\n",
vd_path + 1);
}
@@ -7444,6 +7453,8 @@ int amvecm_matrix_process(
if (prev_color_fmt != vinfo->viu_color_fmt) {
if (is_video_layer_on(vd_path))
null_vf_cnt[vd_path] = 0;
+ else
+ force_fake = true;
prev_color_fmt = vinfo->viu_color_fmt;
pr_csc(4, "vd%d: output color format changed\n",
vd_path + 1);
@@ -7451,9 +7462,11 @@ int amvecm_matrix_process(
/* handle eye protect mode */
if ((cur_eye_protect_mode != wb_val[0]) &&
- (vd_path == VD1_PATH) &&
- is_video_layer_on(vd_path)) {
- null_vf_cnt[vd_path] = 0;
+ (vd_path == VD1_PATH)) {
+ if (is_video_layer_on(vd_path))
+ null_vf_cnt[vd_path] = 0;
+ else
+ force_fake = true;
pr_csc(4, "vd%d: eye_protect_mode changed\n",
vd_path + 1);
}
@@ -7494,6 +7507,9 @@ int amvecm_matrix_process(
== HDR_MODULE_ON)) {
null_vf_cnt[vd_path] = 1;
toggle_frame = 1;
+ } else if (force_fake) {
+ null_vf_cnt[vd_path] = 1;
+ toggle_frame = 1;
} else if (csc_en & 0x10) {
toggle_frame = null_vf_max;
} else {