rk3188 lcdc: write config done for HDMI,fix scale bug
authoryxj <yxj@rock-chips.com>
Mon, 4 Feb 2013 07:12:33 +0000 (15:12 +0800)
committeryxj <yxj@rock-chips.com>
Mon, 4 Feb 2013 07:13:13 +0000 (15:13 +0800)
drivers/video/rockchip/lcdc/rk3188_lcdc.c
drivers/video/rockchip/lcdc/rk3188_lcdc.h

index 9281d7e96e43bbf8ab7102340b4a48d8d4102163..6b7f1d4805497659b4f548e4e57cbb05944ef552 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/div64.h>
 #include <asm/uaccess.h>
 #include <mach/iomux.h>
+#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);
 
index 5a53edc73f8e9945dad9b04aba89e09d386bd0ef..7ae80a28fa7764e63d3c0a327f8cd409dd8f7f1a 100644 (file)
 #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;