From: hjc Date: Fri, 18 Jul 2014 01:12:23 +0000 (+0800) Subject: rk3038 hdmi: add support interlace video mode X-Git-Tag: firefly_0821_release~4916^2~211 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a02eda53242b90ce39b0892236a56512547a388a;p=firefly-linux-kernel-4.4.55.git rk3038 hdmi: add support interlace video mode --- diff --git a/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi_hw.c b/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi_hw.c index e093c8a40c57..a8cdceebd9bb 100755 --- a/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi_hw.c +++ b/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi_hw.c @@ -76,7 +76,7 @@ static void rk3036_hdmi_set_pwr_mode(struct hdmi *hdmi_drv, int mode) __func__, hdmi_drv->pwr_mode, mode); rk3036_hdmi_sys_power(hdmi_drv, false); hdmi_writel(hdmi_dev, PHY_DRIVER, 0xaa); - hdmi_writel(hdmi_dev, PHY_PRE_EMPHASIS, 0x5f); + hdmi_writel(hdmi_dev, PHY_PRE_EMPHASIS, 0x6f); hdmi_writel(hdmi_dev, PHY_SYS_CTL, 0x15); hdmi_writel(hdmi_dev, PHY_SYS_CTL, 0x14); hdmi_writel(hdmi_dev, PHY_SYS_CTL, 0x10); @@ -237,7 +237,10 @@ static void rk3036_hdmi_config_avi(struct hdmi *hdmi_drv, ACTIVE_ASPECT_RATE_SAME_AS_CODED_FRAME; info[6] = 0; info[7] = vic; - info[8] = 0; + if ((vic == HDMI_720X480I_60HZ_VIC) || (vic == HDMI_720X576I_50HZ_VIC)) + info[8] = 1; + else + info[8] = 0; /* Calculate AVI InfoFrame ChecKsum */ for (i = 4; i < SIZE_AVI_INFOFRAME; i++) diff --git a/drivers/video/rockchip/hdmi/rk_hdmi.h b/drivers/video/rockchip/hdmi/rk_hdmi.h index a65e7aa740f1..1fb8943776f6 100755 --- a/drivers/video/rockchip/hdmi/rk_hdmi.h +++ b/drivers/video/rockchip/hdmi/rk_hdmi.h @@ -21,6 +21,27 @@ /* default HDMI output video mode */ #define HDMI_VIDEO_DEFAULT_MODE HDMI_1280x720p_60Hz +#define HDMI_720X480P_60HZ_VIC 2 +#define HDMI_720X480I_60HZ_VIC 6 +#define HDMI_720X576P_50HZ_VIC 17 +#define HDMI_720X576I_50HZ_VIC 21 +#define HDMI_1280X720P_50HZ_VIC 19 +#define HDMI_1280X720P_60HZ_VIC 4 +#define HDMI_1920X1080P_50HZ_VIC 31 +#define HDMI_1920X1080I_50HZ_VIC 20 +#define HDMI_1920X1080P_60HZ_VIC 16 +#define HDMI_1920X1080I_60HZ_VIC 5 +#define HDMI_3840X2160P_24HZ_VIC 93 +#define HDMI_3840X2160P_25HZ_VIC 94 +#define HDMI_3840X2160P_30HZ_VIC 95 +#define HDMI_3840X2160P_50HZ_VIC 96 +#define HDMI_3840X2160P_60HZ_VIC 97 +#define HDMI_4096X2160P_24HZ_VIC 98 +#define HDMI_4096X2160P_25HZ_VIC 99 +#define HDMI_4096X2160P_30HZ_VIC 100 +#define HDMI_4096X2160P_50HZ_VIC 101 +#define HDMI_4096X2160P_60HZ_VIC 102 + /* HDMI video source */ enum { HDMI_SOURCE_LCDC0 = 0, diff --git a/drivers/video/rockchip/hdmi/rk_hdmi_lcdc.c b/drivers/video/rockchip/hdmi/rk_hdmi_lcdc.c index fe65b3760f76..497c55d7f5a1 100755 --- a/drivers/video/rockchip/hdmi/rk_hdmi_lcdc.c +++ b/drivers/video/rockchip/hdmi/rk_hdmi_lcdc.c @@ -11,12 +11,12 @@ struct hdmi *m_hdmi_drv; static const struct fb_videomode hdmi_mode[] = { - /* name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag(used for vic) */ + /* name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag(used for vic) */ /* {"640x480p@60Hz", 60, 640, 480, 25175000, 48, 16, 33, 10, 96, 2, 0, 0, 1 }, - {"720x480i@60Hz", 60, 720, 480, 27000000, 114, 38, 15, 4, 124, 3, 0, 1, 6 }, - {"720x576i@50Hz", 50, 720, 576, 27000000, 138, 24, 19, 2, 126, 3, 0, 1, 21}, */ + {"720x480i@60Hz", 60, 720, 480, 27000000, 57, 19, 15, 4, 62, 3, 0, 1, 6 }, + {"720x576i@50Hz", 50, 720, 576, 27000000, 69, 12, 19, 2, 63, 3, 0, 1, 21}, {"720x480p@60Hz", 60, 720, 480, 27000000, 60, 16, 30, 9, 62, 6, 0, 0, 2 }, {"720x576p@50Hz", 50, 720, 576, 27000000, 68, 12, 39, 5, 64, 5, 0, 0, 17}, /* @@ -31,9 +31,9 @@ static const struct fb_videomode hdmi_mode[] = { {"1920x1080p@25Hz", 25, 1920, 1080, 74250000, 148, 528, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 33}, {"1920x1080p@30Hz", 30, 1920, 1080, 74250000, 148, 88, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 34}, {"1920x1080i@50Hz_2", 50, 1920, 1080, 72000000, 184, 32, 57, 23, 168, 5, FB_SYNC_HOR_HIGH_ACT, 1, 39}, +*/ {"1920x1080i@50Hz", 50, 1920, 1080, 74250000, 148, 528, 15, 2, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 1, 20}, {"1920x1080i@60Hz", 60, 1920, 1080, 74250000, 148, 88, 15, 2, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 1, 5 }, -*/ {"1920x1080p@50Hz", 50, 1920, 1080, 148500000, 148, 528, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 31}, {"1920x1080p@60Hz", 60, 1920, 1080, 148500000, 148, 88, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 16}, /* @@ -121,7 +121,11 @@ int hdmi_set_info(struct rk_screen *screen, unsigned int vic) screen->mode.upper_margin = hdmi_mode[i].upper_margin; screen->mode.lower_margin = hdmi_mode[i].lower_margin; screen->mode.vsync_len = hdmi_mode[i].vsync_len; + screen->mode.vmode = hdmi_mode[i].vmode; screen->hdmi_resolution = hdmi_mode[i].flag; + if ((screen->hdmi_resolution == HDMI_720X480I_60HZ_VIC) || + (screen->hdmi_resolution == HDMI_720X576I_50HZ_VIC)) + screen->pixelrepeat = 1; /* Pin polarity */ #if defined(CONFIG_HDMI_RK616) && !defined(CONFIG_ARCH_RK3026) @@ -439,10 +443,11 @@ int hdmi_videomode_to_vic(struct fb_videomode *vmode) vmode->lower_margin == hdmi_mode[i].lower_margin && vmode->hsync_len == hdmi_mode[i].hsync_len && vmode->vsync_len == hdmi_mode[i].vsync_len) { - if ((vmode->vmode == FB_VMODE_NONINTERLACED + /*if ((vmode->vmode == FB_VMODE_NONINTERLACED && vmode->yres == hdmi_mode[i].yres) || (vmode->vmode == FB_VMODE_INTERLACED - && vmode->yres == hdmi_mode[i].yres / 2)) { + && vmode->yres == hdmi_mode[i].yres / 2))*/ + { vic = hdmi_mode[i].flag; break; }