video: rockchip: fb: add parse screen physical size
authorHuang Jiachai <hjc@rock-chips.com>
Wed, 30 Mar 2016 07:21:43 +0000 (15:21 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Wed, 25 May 2016 07:18:53 +0000 (15:18 +0800)
Change-Id: I98ad62b55d268150ff256407b6bdf06a8ad14a37
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
drivers/video/of_display_timing.c
drivers/video/rockchip/rk_fb.c
include/video/display_timing.h

index 6c2fc91aae0b2877b6f74e9d78f0260104d5f08d..e393412faf6637788222a4e3f3c8adf473644c62 100644 (file)
@@ -112,7 +112,11 @@ static int of_parse_display_timing(const struct device_node *np,
        if (!of_property_read_u32(np, "out-face", &val))
                dt->face = val;
        if (!of_property_read_u32(np, "color-mode", &val))
-               dt->color_mode = val;
+                dt->color_mode = val;
+       if (!of_property_read_u32(np, "screen-width", &val))
+                dt->screen_widt = val;
+       if (!of_property_read_u32(np, "screen-hight", &val))
+                dt->screen_hight = val;
        prop = of_find_property(np, "dsp-lut", &length);
        if (prop) {
                dt->dsp_lut = kzalloc(length, GFP_KERNEL);
index 8e703de9db2adf66418387a74dc90de6eb56c40c..d7aad15415d2c837e2cea0792d02f3673672057b 100644 (file)
@@ -495,6 +495,8 @@ int rk_fb_video_mode_from_timing(const struct display_timing *dt,
        screen->lvds_format = dt->lvds_format;
        screen->face = dt->face;
        screen->color_mode = dt->color_mode;
+       screen->width = dt->screen_widt;
+       screen->height = dt->screen_hight;
        screen->dsp_lut = dt->dsp_lut;
        screen->cabc_lut = dt->cabc_lut;
        screen->cabc_gamma_base = dt->cabc_gamma_base;
@@ -4174,6 +4176,8 @@ int rk_fb_register(struct rk_lcdc_driver *dev_drv,
                fbi->fix = def_fix;
                sprintf(fbi->fix.id, "fb%d", rk_fb->num_fb);
                fb_videomode_to_var(&fbi->var, &dev_drv->cur_screen->mode);
+               fbi->var.width = dev_drv->cur_screen->width;
+               fbi->var.height = dev_drv->cur_screen->height;
                fbi->var.grayscale |=
                    (fbi->var.xres << 8) + (fbi->var.yres << 20);
 #if defined(CONFIG_LOGO_LINUX_BMP)
index 82e7adc68c8956caf729872bfdaa91072fef4114..0ff62c5e16f886405107fe6ba699167765004d8a 100644 (file)
@@ -78,9 +78,11 @@ struct display_timing {
        enum display_flags flags;               /* display flags */
 #if defined(CONFIG_FB_ROCKCHIP)
        u16 screen_type;                        /*screen type*/
-       u16 lvds_format;                        /*lvds data format*/
-       u16 face;                               /*display output interface*/
-       u16 color_mode;                         /*input color mode: RGB/YUV*/
+       u16 screen_widt;                        /* screen physical size */
+       u16 screen_hight;
+       u16 lvds_format;                        /*lvds data format for lvds screen*/
+       u16 face;                               /*display output  interface format:24bit 18bit 16bit*/
+       u16 color_mode;                         /* input color mode: RGB or YUV */
        u32 *dsp_lut;
        u32 *cabc_lut;
        u32 *cabc_gamma_base;