From 49665d106fb0b34731804a6620c065693ba29ce6 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Tue, 10 May 2016 11:09:35 +0800 Subject: [PATCH] video: rockchip: hdmi: fix compile warning Change-Id: I3573f4d42074b656420cc5567d73e660232f2b84 Signed-off-by: Zheng Yang --- .../video/rockchip/hdmi/rockchip-hdmi-edid.c | 2 +- .../video/rockchip/hdmi/rockchip-hdmi-lcdc.c | 2 +- .../hdmi/rockchip-hdmiv1/rockchip_hdmiv1_hw.c | 3 ++- .../hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c | 17 ++++++++++++----- .../hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.h | 1 + 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c index 6ce7171bf45a..33b007148d86 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c @@ -339,7 +339,7 @@ static void hdmi_edid_parse_yuv420cmdb(unsigned char *buf, int count, { struct list_head *pos; struct display_modelist *modelist; - int i, j, yuv420_mask, vic; + int i, j, yuv420_mask = 0, vic; for (i = 0; i < count - 1; i++) { EDBG("vic which support yuv420 mode is %x\n", buf[i]); diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c index 3fb7d689d66a..db6d0a4b6f31 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c @@ -882,7 +882,7 @@ static int hdmi_set_info(struct rk_screen *screen, struct hdmi *hdmi) int hdmi_find_best_mode(struct hdmi *hdmi, int vic) { struct list_head *pos, *head = &hdmi->edid.modelist; - struct display_modelist *modelist; + struct display_modelist *modelist = NULL; int found = 0; if (vic) { diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1_hw.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1_hw.c index ac87b3c9ff56..714f2789ba65 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1_hw.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1_hw.c @@ -514,7 +514,8 @@ static void rockchip_hdmiv1_config_avi(struct hdmi *hdmi_drv, avi_color_mode = AVI_COLOR_MODE_YCBCR444; else if (output_color == HDMI_COLOR_YCBCR422) avi_color_mode = AVI_COLOR_MODE_YCBCR422; - + else + avi_color_mode = HDMI_COLOR_RGB_0_255; info[4] = (avi_color_mode << 5); info[5] = (AVI_COLORIMETRY_NO_DATA << 6) | diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c index 3fdf25e53df4..ac77022baf83 100755 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c @@ -159,7 +159,7 @@ static void rockchip_hdmiv2_i2cm_read_request(struct hdmi_dev *hdmi_dev, static void rockchip_hdmiv2_i2cm_write_data(struct hdmi_dev *hdmi_dev, u8 data, u8 offset) { - u8 interrupt; + u8 interrupt = 0; int trytime = 2; int i = 20; @@ -192,7 +192,7 @@ static void rockchip_hdmiv2_i2cm_write_data(struct hdmi_dev *hdmi_dev, static int rockchip_hdmiv2_i2cm_read_data(struct hdmi_dev *hdmi_dev, u8 offset) { - u8 interrupt, val; + u8 interrupt = 0, val; int trytime = 2; int i = 20; @@ -1215,6 +1215,11 @@ static const char coeff_csc[][24] = { * B1 | B2 | B3 | B4 | * C1 | C2 | C3 | C4 | */ + { /* CSC_BYPASS */ + 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, + }, { /* CSC_RGB_0_255_TO_RGB_16_235_8BIT */ 0x36, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, /*G*/ 0x00, 0x00, 0x36, 0xf7, 0x00, 0x00, 0x00, 0x40, /*R*/ @@ -1261,7 +1266,7 @@ static const char coeff_csc[][24] = { static int rockchip_hdmiv2_video_csc(struct hdmi_dev *hdmi_dev, struct hdmi_video *vpara) { - int i, mode, interpolation, decimation, csc_scale; + int i, mode, interpolation, decimation, csc_scale = 0; const char *coeff = NULL; unsigned char color_depth = 0; @@ -1287,6 +1292,9 @@ static int rockchip_hdmiv2_video_csc(struct hdmi_dev *hdmi_dev, m_CSC_DECIMODE, v_CSC_DECIMODE(decimation)); } + mode = CSC_BYPASS; + csc_scale = 0; + switch (vpara->vic) { case HDMI_720X480I_60HZ_4_3: case HDMI_720X576I_50HZ_4_3: @@ -1455,7 +1463,7 @@ exit: static void hdmi_dev_config_avi(struct hdmi_dev *hdmi_dev, struct hdmi_video *vpara) { - unsigned char colorimetry, ext_colorimetry, aspect_ratio, y1y0; + unsigned char colorimetry, ext_colorimetry = 0, aspect_ratio, y1y0; unsigned char rgb_quan_range = AVI_QUANTIZATION_RANGE_DEFAULT; hdmi_msk_reg(hdmi_dev, FC_DATAUTO3, m_AVI_AUTO, v_AVI_AUTO(0)); @@ -1505,7 +1513,6 @@ static void hdmi_dev_config_avi(struct hdmi_dev *hdmi_dev, } else if (vpara->color_output == HDMI_COLOR_RGB_16_235 || vpara->color_output == HDMI_COLOR_RGB_0_255) { colorimetry = AVI_COLORIMETRY_NO_DATA; - ext_colorimetry = 0; } else if (vpara->colorimetry != HDMI_COLORIMETRY_NO_DATA) { colorimetry = vpara->colorimetry; } diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.h b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.h index af3b834215f1..37a015b851c8 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.h +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.h @@ -17,6 +17,7 @@ enum { /* Color Space Conversion Mode */ enum { + CSC_BYPASS, CSC_RGB_0_255_TO_RGB_16_235_8BIT, /* RGB 0-255 input to RGB * 16-235 output that is 8bit * clolor depth -- 2.34.1