rk fb: move read mirror prop position to fix system crash
authorzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 12:55:37 +0000 (20:55 +0800)
committerzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 12:56:03 +0000 (20:56 +0800)
drivers/video/rockchip/lcdc/rk3288_lcdc.c
drivers/video/rockchip/rk_fb.c

index 0d4b53bbfff0862cfe123b05fc5546cf3a031d56..c0f589787e23650c0ab60a31f83473449e590013 100755 (executable)
@@ -3512,32 +3512,12 @@ static int rk3288_lcdc_parse_dt(struct lcdc_device *lcdc_dev)
 {
        struct device_node *np = lcdc_dev->dev->of_node;
        int val;
-       int mirror;
 
        if (of_property_read_u32(np, "rockchip,prop", &val))
                lcdc_dev->prop = PRMRY; /*default set it as primary */
        else
                lcdc_dev->prop = val;
 
-       if (of_property_read_u32(np, "rockchip,mirror", &val))
-               mirror = NO_MIRROR;
-       else
-               mirror = val;
-
-       if (mirror == NO_MIRROR) {
-               lcdc_dev->driver.screen0->x_mirror = 0;
-               lcdc_dev->driver.screen0->y_mirror = 0;
-       } else if (mirror == X_MIRROR) {
-               lcdc_dev->driver.screen0->x_mirror = 1;
-               lcdc_dev->driver.screen0->y_mirror = 0;
-       } else if (mirror == Y_MIRROR) {
-               lcdc_dev->driver.screen0->x_mirror = 0;
-               lcdc_dev->driver.screen0->y_mirror = 1;
-       } else if (mirror == X_Y_MIRROR) {
-               lcdc_dev->driver.screen0->x_mirror = 1;
-               lcdc_dev->driver.screen0->y_mirror = 1;
-       }
-
        if (of_property_read_u32(np, "rockchip,cabc_mode", &val))
                lcdc_dev->driver.cabc_mode = 0; /* default set close cabc */
        else
index 9ffeabea3540900553fe36780564e60084651218..739cc66976abd340d0f4bce0de54e98500ac01f0 100755 (executable)
@@ -3249,6 +3249,7 @@ static int init_lcdc_win(struct rk_lcdc_driver *dev_drv,
 static int init_lcdc_device_driver(struct rk_fb *rk_fb,
                                   struct rk_lcdc_win *def_win, int index)
 {
+       u32 mirror = 0;
        struct rk_lcdc_driver *dev_drv = rk_fb->lcdc_dev_drv[index];
        struct rk_screen *screen = devm_kzalloc(dev_drv->dev,
                                                sizeof(struct rk_screen),
@@ -3265,6 +3266,12 @@ static int init_lcdc_device_driver(struct rk_fb *rk_fb,
        screen->overscan.top = 100;
        screen->overscan.right = 100;
        screen->overscan.bottom = 100;
+       if (of_property_read_u32(dev_drv->dev->of_node, "rockchip,mirror", &mirror))
+               mirror = NO_MIRROR;
+
+       screen->x_mirror = mirror & X_MIRROR;
+       screen->y_mirror = mirror & Y_MIRROR;
+
        dev_drv->screen0 = screen;
        dev_drv->cur_screen = screen;
        /* devie use one lcdc + rk61x scaler for dual display */