1. rk3128-box.dts: enable tve.
authorZheng Yang <zhengyang@rock-chips.com>
Wed, 27 Aug 2014 10:33:03 +0000 (18:33 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Wed, 27 Aug 2014 10:33:03 +0000 (18:33 +0800)
2. rk_fb: set_par did not covert display window infomation set from user space to
   screen size, it will be calculate in user space.

arch/arm/boot/dts/rk3128-box.dts
drivers/video/rockchip/lcdc/rk312x_lcdc.c
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/tve/rk3036/rk3036_tve.c

index 9eaf8a89edbcb9398556da57acfb19478bf89682..f68cadc6c2491fffad7304265ae0457b5c697423 100755 (executable)
        display-timings = <&disp_timings>;
 };
 
+&fb {
+       rockchip,disp-mode = <NO_DUAL>;
+};
+
 &lcdc {
        status = "okay";
        rockchip,fb-win-map = <FB0_WIN1_FB1_WIN0_FB2_WIN2>;
 };
 
 &tve {
-       status = "disabled";
+       status = "okay";
 };
 
 &i2c2 {
index 90d36b666fe1518ed844a5c83327ec13e5d17abb..995118182a0b740b5f8ce2e6aae2d1046e242326 100755 (executable)
@@ -2037,9 +2037,9 @@ static int rk312x_lcdc_parse_dt(struct lcdc_device *lcdc_dev)
         struct device_node *np = lcdc_dev->dev->of_node;
         const struct of_device_id *match;
         const struct rk_lcdc_drvdata *lcdc_drvdata;
+       int val;
 
 #if defined(CONFIG_ROCKCHIP_IOMMU)
-       int val;
        if (of_property_read_u32(np, "rockchip,iommu-enabled", &val))
                lcdc_dev->driver.iommu_enabled = 0;
        else
index 0c412dcb8459a66ade61164c7201d24a0692457d..9d734bfaf8f2259fdbb7c9017ed0df50f1f1aa73 100755 (executable)
@@ -2725,7 +2725,6 @@ static int rk_fb_set_par(struct fb_info *info)
        struct rk_lcdc_win *extend_win = NULL;
        struct rk_lcdc_win *win = NULL;
        struct rk_screen *screen = dev_drv->cur_screen;
-       struct rk_screen screen_primary;
        int win_id = 0;
        u32 cblen = 0, crlen = 0;
        u16 xsize = 0, ysize = 0;       /* winx display window height/width --->LCDC_WINx_DSP_INFO */
@@ -2764,6 +2763,10 @@ static int rk_fb_set_par(struct fb_info *info)
        if (var->grayscale >> 8) {
                xsize = (var->grayscale >> 8) & 0xfff;
                ysize = (var->grayscale >> 20) & 0xfff;
+               if (xsize > screen->mode.xres)
+                       xsize = screen->mode.xres;
+               if (ysize > screen->mode.yres)
+                       ysize = screen->mode.yres;
        } else {                /*ohterwise  full  screen display */
                xsize = screen->mode.xres;
                ysize = screen->mode.yres;
@@ -2861,14 +2864,13 @@ static int rk_fb_set_par(struct fb_info *info)
                }
        }
 
-       rk_fb_get_prmry_screen(&screen_primary);
        win->format = fb_data_fmt;
        win->area[0].y_vir_stride = stride >> 2;
        win->area[0].uv_vir_stride = uv_stride >> 2;
-       win->area[0].xpos = xpos*screen->mode.xres/screen_primary.mode.xres;
-       win->area[0].ypos = ypos*screen->mode.yres/screen_primary.mode.yres;
-       win->area[0].xsize = screen->mode.xres*xsize/screen_primary.mode.xres;
-       win->area[0].ysize = screen->mode.yres*ysize/screen_primary.mode.yres;
+       win->area[0].xpos = xpos;
+       win->area[0].ypos = ypos;
+       win->area[0].xsize = xsize;
+       win->area[0].ysize = ysize;
        win->area[0].xact = var->xres;  /* winx active window height,is a wint of vir */
        win->area[0].yact = var->yres;
        win->area[0].xvir = var->xres_virtual;  /* virtual resolution  stride --->LCDC_WINx_VIR */
index 47b888cc24a7851800bdc1535a07abf29a0e1e75..7c354e85e75c595b1f6302c8a7599169ae4132d0 100644 (file)
 
 static const struct fb_videomode rk3036_cvbs_mode[] = {
        /*name          refresh xres    yres    pixclock        h_bp    h_fp    v_bp    v_fp    h_pw    v_pw                    polariry                                PorI            flag*/
-       {"NTSC",        60,     720,    480,    27000000,       57,     19,     19,     0,      62,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
-       {"PAL",         50,     720,    576,    27000000,       69,     12,     19,     2,      63,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
+/*     {"NTSC",        60,     720,    480,    27000000,       57,     19,     19,     0,      62,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
+       {"PAL",         50,     720,    576,    27000000,       69,     12,     19,     2,      63,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
+*/     {"NTSC",        60,     720,    480,    27000000,       43,     33,     19,     0,      62,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
+       {"PAL",         50,     720,    576,    27000000,       52,     29,     19,     2,      63,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
 };
 
 static struct rk3036_tve *rk3036_tve;
@@ -140,7 +142,7 @@ static int tve_switch_fb(const struct fb_videomode *modedb, int enable)
        /* screen type & face */
        screen->type = SCREEN_TVOUT;
        screen->face = OUT_P888;
-
+       screen->color_mode = COLOR_YCBCR;
        screen->mode = *modedb;
 
        /* Pin polarity */
@@ -403,7 +405,7 @@ static void __exit rk3036_tve_exit(void)
        platform_driver_unregister(&rk3036_tve_driver);
 }
 
-module_init(rk3036_tve_init);
+late_initcall(rk3036_tve_init);
 module_exit(rk3036_tve_exit);
 
 /* Module information */