From 1c237092bc4c5ef88727a6a017d23c1c90673f3b Mon Sep 17 00:00:00 2001 From: zwl Date: Mon, 16 Jun 2014 20:55:37 +0800 Subject: [PATCH] rk fb: move read mirror prop position to fix system crash --- drivers/video/rockchip/lcdc/rk3288_lcdc.c | 20 -------------------- drivers/video/rockchip/rk_fb.c | 7 +++++++ 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk3288_lcdc.c b/drivers/video/rockchip/lcdc/rk3288_lcdc.c index 0d4b53bbfff0..c0f589787e23 100755 --- a/drivers/video/rockchip/lcdc/rk3288_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3288_lcdc.c @@ -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 diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 9ffeabea3540..739cc66976ab 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -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 */ -- 2.34.1