From: yxj Date: Mon, 4 Feb 2013 07:12:33 +0000 (+0800) Subject: rk3188 lcdc: write config done for HDMI,fix scale bug X-Git-Tag: firefly_0821_release~7626 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=af8cd160c8bd91b5fe8221a520155561d9a84db4;p=firefly-linux-kernel-4.4.55.git rk3188 lcdc: write config done for HDMI,fix scale bug --- diff --git a/drivers/video/rockchip/lcdc/rk3188_lcdc.c b/drivers/video/rockchip/lcdc/rk3188_lcdc.c index 9281d7e96e43..6b7f1d480549 100644 --- a/drivers/video/rockchip/lcdc/rk3188_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3188_lcdc.c @@ -30,6 +30,7 @@ #include #include #include +#include "../hdmi/rk_hdmi.h" #include "rk3188_lcdc.h" @@ -378,7 +379,6 @@ static int rk3188_load_screen(struct rk_lcdc_device_driver *dev_drv, bool initsc u16 x_res = screen->x_res; u16 y_res = screen->y_res; - spin_lock(&lcdc_dev->reg_lock); if(likely(lcdc_dev->clk_on)) { @@ -710,7 +710,18 @@ static int win0_display(struct rk3188_lcdc_device *lcdc_dev,struct layer_par *p if(likely(lcdc_dev->clk_on)) { lcdc_writel(lcdc_dev, WIN0_YRGB_MST0, y_addr); - lcdc_writel(lcdc_dev, WIN0_CBR_MST0, uv_addr); + lcdc_writel(lcdc_dev, WIN0_CBR_MST0, uv_addr); + #if defined(CONFIG_RK_HDMI) + #if defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL) + if(lcdc_dev->driver.screen_ctr_info->prop == EXTEND) + { + if(hdmi_get_hotplug() == HDMI_HPD_ACTIVED) + { + lcdc_cfg_done(lcdc_dev); + } + } + #endif + #endif } spin_unlock(&lcdc_dev->reg_lock); @@ -730,6 +741,17 @@ static int win1_display(struct rk3188_lcdc_device *lcdc_dev,struct layer_par *p if(likely(lcdc_dev->clk_on)) { lcdc_writel(lcdc_dev,WIN1_MST,y_addr); + #if defined(CONFIG_RK_HDMI) + #if defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL) + if(lcdc_dev->driver.screen_ctr_info->prop == EXTEND) + { + if(hdmi_get_hotplug() == HDMI_HPD_ACTIVED) + { + lcdc_cfg_done(lcdc_dev); + } + } + #endif + #endif } spin_unlock(&lcdc_dev->reg_lock); diff --git a/drivers/video/rockchip/lcdc/rk3188_lcdc.h b/drivers/video/rockchip/lcdc/rk3188_lcdc.h index 5a53edc73f8e..7ae80a28fa77 100644 --- a/drivers/video/rockchip/lcdc/rk3188_lcdc.h +++ b/drivers/video/rockchip/lcdc/rk3188_lcdc.h @@ -287,7 +287,7 @@ #define DSP_LUT_ADDR (0x800) -#define CalScale(x, y) ((((u32)x)*0x1000)/y) +#define CalScale(x, y) ((((u32)(x-1))*0x1000)/(y-1)) struct rk3188_lcdc_device{ int id;