From ac9b99c0c6545dd5c9be0407433668db824beef6 Mon Sep 17 00:00:00 2001 From: Evoke Zhang Date: Thu, 21 Jun 2018 14:21:03 +0800 Subject: [PATCH] vout_serve: add vinfo fr_adj_type support for vlock PD#168809: vout_serve: add vinfo fr_adj_type support for vlock Change-Id: Ib5b7b06110008a98a6cf9b16e2f14775aa3f1053 Signed-off-by: Evoke Zhang --- drivers/amlogic/media/enhancement/amvecm/amvecm.c | 7 +++--- drivers/amlogic/media/vout/cvbs/cvbs_out.c | 2 ++ .../vout/hdmitx/hdmi_common/hdmi_parameters.c | 29 ++++++++++++++++++++++ .../amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c | 21 ++++++++++++++++ drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c | 21 ++++++++++++++++ .../amlogic/media/vout/vout_serve/vout2_serve.c | 1 + drivers/amlogic/media/vout/vout_serve/vout_serve.c | 2 ++ include/linux/amlogic/media/vout/vinfo.h | 11 ++++++++ 8 files changed, 91 insertions(+), 3 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amvecm/amvecm.c b/drivers/amlogic/media/enhancement/amvecm/amvecm.c index fb54740..1d8060d 100644 --- a/drivers/amlogic/media/enhancement/amvecm/amvecm.c +++ b/drivers/amlogic/media/enhancement/amvecm/amvecm.c @@ -4811,10 +4811,11 @@ static int aml_vecm_probe(struct platform_device *pdev) else if (is_meson_txlx_cpu() && !is_meson_txlx_package_962E()) { struct vinfo_s *vinfo = get_current_vinfo(); - if (vinfo->width > 1920) - vlock_mode = VLOCK_MODE_MANUAL_PLL; - else + if ((vinfo->fr_adj_type != VOUT_FR_ADJ_HDMI) && + (vinfo->width <= 1920)) vlock_mode = VLOCK_MODE_MANUAL_SOFT_ENC; + else + vlock_mode = VLOCK_MODE_MANUAL_PLL; } else vlock_mode = VLOCK_MODE_MANUAL_PLL; diff --git a/drivers/amlogic/media/vout/cvbs/cvbs_out.c b/drivers/amlogic/media/vout/cvbs/cvbs_out.c index 63bfa10..c9eca53 100644 --- a/drivers/amlogic/media/vout/cvbs/cvbs_out.c +++ b/drivers/amlogic/media/vout/cvbs/cvbs_out.c @@ -73,6 +73,7 @@ static struct vinfo_s cvbs_info[] = { .video_clk = 27000000, .htotal = 1716, .vtotal = 525, + .fr_adj_type = VOUT_FR_ADJ_NONE, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCI, .vout_device = NULL, @@ -90,6 +91,7 @@ static struct vinfo_s cvbs_info[] = { .video_clk = 27000000, .htotal = 1728, .vtotal = 625, + .fr_adj_type = VOUT_FR_ADJ_NONE, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCI, .vout_device = NULL, diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c index ff3836a..89a3ce1 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c @@ -62,6 +62,7 @@ static struct hdmi_format_para fmt_para_1920x1080p60_16x9 = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -110,6 +111,7 @@ static struct hdmi_format_para fmt_para_1920x1080p30_16x9 = { .video_clk = 74250000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -157,6 +159,7 @@ static struct hdmi_format_para fmt_para_1920x1080p50_16x9 = { .video_clk = 148500000, .htotal = 2640, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -204,6 +207,7 @@ static struct hdmi_format_para fmt_para_1920x1080p25_16x9 = { .video_clk = 74250000, .htotal = 2640, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -252,6 +256,7 @@ static struct hdmi_format_para fmt_para_1920x1080p24_16x9 = { .video_clk = 74250000, .htotal = 2750, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -300,6 +305,7 @@ static struct hdmi_format_para fmt_para_3840x2160p30_16x9 = { .video_clk = 297000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -348,6 +354,7 @@ static struct hdmi_format_para fmt_para_3840x2160p60_16x9 = { .video_clk = 594000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -395,6 +402,7 @@ static struct hdmi_format_para fmt_para_3840x2160p50_16x9 = { .video_clk = 594000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -442,6 +450,7 @@ static struct hdmi_format_para fmt_para_3840x2160p25_16x9 = { .video_clk = 297000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -490,6 +499,7 @@ static struct hdmi_format_para fmt_para_3840x2160p24_16x9 = { .video_clk = 297000000, .htotal = 5500, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -538,6 +548,7 @@ static struct hdmi_format_para fmt_para_4096x2160p24_256x135 = { .video_clk = 297000000, .htotal = 5500, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -585,6 +596,7 @@ static struct hdmi_format_para fmt_para_4096x2160p25_256x135 = { .video_clk = 297000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -633,6 +645,7 @@ static struct hdmi_format_para fmt_para_4096x2160p30_256x135 = { .video_clk = 297000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -680,6 +693,7 @@ static struct hdmi_format_para fmt_para_4096x2160p50_256x135 = { .video_clk = 594000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -728,6 +742,7 @@ static struct hdmi_format_para fmt_para_4096x2160p60_256x135 = { .video_clk = 594000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -776,6 +791,7 @@ static struct hdmi_format_para fmt_para_1920x1080i60_16x9 = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -823,6 +839,7 @@ static struct hdmi_format_para fmt_para_1920x1080i50_16x9 = { .video_clk = 148500000, .htotal = 2640, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -871,6 +888,7 @@ static struct hdmi_format_para fmt_para_1280x720p60_16x9 = { .video_clk = 74250000, .htotal = 1650, .vtotal = 750, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -918,6 +936,7 @@ static struct hdmi_format_para fmt_para_1280x720p50_16x9 = { .video_clk = 74250000, .htotal = 1980, .vtotal = 750, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -966,6 +985,7 @@ static struct hdmi_format_para fmt_para_720x480p60_16x9 = { .video_clk = 27000000, .htotal = 858, .vtotal = 525, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1014,6 +1034,7 @@ static struct hdmi_format_para fmt_para_720x480i60_16x9 = { .video_clk = 27000000, .htotal = 1716, .vtotal = 525, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCI, }, @@ -1061,6 +1082,7 @@ static struct hdmi_format_para fmt_para_720x576p50_16x9 = { .video_clk = 27000000, .htotal = 864, .vtotal = 625, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1108,6 +1130,7 @@ static struct hdmi_format_para fmt_para_720x576i50_16x9 = { .video_clk = 27000000, .htotal = 1728, .vtotal = 625, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCI, }, @@ -1157,6 +1180,7 @@ static struct hdmi_format_para fmt_para_3840x2160p50_16x9_y420 = { .video_clk = 594000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1204,6 +1228,7 @@ static struct hdmi_format_para fmt_para_4096x2160p50_256x135_y420 = { .video_clk = 594000000, .htotal = 5280, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1252,6 +1277,7 @@ static struct hdmi_format_para fmt_para_3840x2160p60_16x9_y420 = { .video_clk = 594000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1301,6 +1327,7 @@ static struct hdmi_format_para fmt_para_4096x2160p60_256x135_y420 = { .video_clk = 594000000, .htotal = 4400, .vtotal = 2250, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1323,6 +1350,7 @@ static struct hdmi_format_para fmt_para_non_hdmi_fmt = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, @@ -1351,6 +1379,7 @@ static struct hdmi_format_para fmt_para_null_hdmi_fmt = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_HDMI, .viu_color_fmt = COLOR_FMT_YUV444, .viu_mux = VIU_MUX_ENCP, }, diff --git a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c index e88b484..8c37895 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c @@ -435,6 +435,26 @@ static void lcd_tablet_vinfo_update(void) vinfo->video_clk = pconf->lcd_timing.lcd_clk; vinfo->htotal = pconf->lcd_basic.h_period; vinfo->vtotal = pconf->lcd_basic.v_period; + switch (pconf->lcd_timing.fr_adjust_type) { + case 0: + vinfo->fr_adj_type = VOUT_FR_ADJ_CLK; + break; + case 1: + vinfo->fr_adj_type = VOUT_FR_ADJ_HTOTAL; + break; + case 2: + vinfo->fr_adj_type = VOUT_FR_ADJ_VTOTAL; + break; + case 3: + vinfo->fr_adj_type = VOUT_FR_ADJ_COMBO; + break; + case 4: + vinfo->fr_adj_type = VOUT_FR_ADJ_HDMI; + break; + default: + vinfo->fr_adj_type = VOUT_FR_ADJ_NONE; + break; + } lcd_hdr_vinfo_update(); } @@ -474,6 +494,7 @@ static void lcd_tablet_vinfo_update_default(void) vinfo->video_clk = 0; vinfo->htotal = h_total; vinfo->vtotal = v_total; + vinfo->fr_adj_type = VOUT_FR_ADJ_NONE; } } diff --git a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c index c38b340..d8f1a4b 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c @@ -239,6 +239,26 @@ static void lcd_vmode_vinfo_update(enum vmode_e mode) lcd_drv->lcd_info->htotal = pconf->lcd_basic.h_period; lcd_drv->lcd_info->vtotal = pconf->lcd_basic.v_period; lcd_drv->lcd_info->viu_mux = VIU_MUX_ENCL; + switch (pconf->lcd_timing.fr_adjust_type) { + case 0: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_CLK; + break; + case 1: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_HTOTAL; + break; + case 2: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_VTOTAL; + break; + case 3: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_COMBO; + break; + case 4: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_HDMI; + break; + default: + lcd_drv->lcd_info->fr_adj_type = VOUT_FR_ADJ_NONE; + break; + } lcd_hdr_vinfo_update(); } @@ -672,6 +692,7 @@ static void lcd_vinfo_update_default(void) vinfo->video_clk = 0; vinfo->htotal = h_total; vinfo->vtotal = v_total; + vinfo->fr_adj_type = VOUT_FR_ADJ_NONE; } } diff --git a/drivers/amlogic/media/vout/vout_serve/vout2_serve.c b/drivers/amlogic/media/vout/vout_serve/vout2_serve.c index 0c79202..18818ca 100644 --- a/drivers/amlogic/media/vout/vout_serve/vout2_serve.c +++ b/drivers/amlogic/media/vout/vout_serve/vout2_serve.c @@ -89,6 +89,7 @@ static struct vinfo_s nulldisp_vinfo = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_NONE, .viu_color_fmt = COLOR_FMT_RGB444, .viu_mux = VIU_MUX_MAX, .vout_device = NULL, diff --git a/drivers/amlogic/media/vout/vout_serve/vout_serve.c b/drivers/amlogic/media/vout/vout_serve/vout_serve.c index 285f30a..58f3a06 100644 --- a/drivers/amlogic/media/vout/vout_serve/vout_serve.c +++ b/drivers/amlogic/media/vout/vout_serve/vout_serve.c @@ -105,6 +105,7 @@ static struct vinfo_s nulldisp_vinfo[] = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_NONE, .viu_color_fmt = COLOR_FMT_RGB444, .viu_mux = VIU_MUX_MAX, .vout_device = NULL, @@ -122,6 +123,7 @@ static struct vinfo_s nulldisp_vinfo[] = { .video_clk = 148500000, .htotal = 2200, .vtotal = 1125, + .fr_adj_type = VOUT_FR_ADJ_NONE, .viu_color_fmt = COLOR_FMT_RGB444, .viu_mux = VIU_MUX_MAX, .vout_device = NULL, diff --git a/include/linux/amlogic/media/vout/vinfo.h b/include/linux/amlogic/media/vout/vinfo.h index 5181e53..a1198c3 100644 --- a/include/linux/amlogic/media/vout/vinfo.h +++ b/include/linux/amlogic/media/vout/vinfo.h @@ -43,6 +43,16 @@ enum viu_mux_e { VIU_MUX_MAX, }; +enum vout_fr_adj_type_e { + VOUT_FR_ADJ_CLK = 0, + VOUT_FR_ADJ_HTOTAL, + VOUT_FR_ADJ_VTOTAL, + VOUT_FR_ADJ_COMBO, /* vtotal + htotal + clk */ + VOUT_FR_ADJ_HDMI, /* 50<->60: htotal; 60<->59.94: clk */ + VOUT_FR_ADJ_NONE, /* disable fr_adj */ + VOUT_FR_ADJ_MAX, +}; + #define SUPPORT_2020 0x01 /* master_display_info for display device */ @@ -186,6 +196,7 @@ struct vinfo_s { u32 video_clk; u32 htotal; u32 vtotal; + enum vout_fr_adj_type_e fr_adj_type; enum color_fmt_e viu_color_fmt; enum viu_mux_e viu_mux; struct master_display_info_s master_display_info; -- 2.7.4