MLK-13134 video: epdc: retain working buffer content when enter/exit dsm
authorRobby Cai <robby.cai@nxp.com>
Mon, 29 Aug 2016 09:22:18 +0000 (17:22 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:52:12 +0000 (14:52 -0500)
Since the eink panel will not be re-initialized after exit DSM(deep sleep mode),
it will depend on the last update content so we need keep the associated working
buffer content during DSM. The patch moves the initialization of working buffer
to probe() function and ensure it's just be initialized once and thus its
content will be kept.

The patch shall fix the following issue:
The codes as follows in unit test for clearing screen does not take effect
when enter/exit DSM.

---
printf("Blank screen\n");
memset(fb, 0xFE, screen_info.xres_virtual*screen_info.yres*screen_info.bits_per_pixel/8);
update_to_display(0, 0, screen_info.xres, screen_info.yres,
wave_mode, TRUE, 0);
---

Signed-off-by: Robby Cai <robby.cai@nxp.com>
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c

index bdbf005..7db2503 100644 (file)
@@ -1203,7 +1203,6 @@ static void epdc_init_settings(struct mxc_epdc_fb_data *fb_data)
        int i;
 #endif
        int j;
-       unsigned short *wk_p;
        unsigned char *bb_p;
 
        /* Enable clocks to access EPDC regs */
@@ -1402,12 +1401,6 @@ static void epdc_init_settings(struct mxc_epdc_fb_data *fb_data)
        __raw_writel(fb_data->working_buffer_phys, EPDC_WB_ADDR);
        __raw_writel(fb_data->working_buffer_phys, EPDC_WB_ADDR_TCE);
 
-       wk_p = (unsigned short *)fb_data->working_buffer_virt;
-       for (j = 0; j < fb_data->cur_mode->vmode->xres * fb_data->cur_mode->vmode->yres; j++) {
-               *wk_p = 0x00F0;
-               wk_p++;
-       }
-
        bb_p = (unsigned char *)fb_data->virt_addr_black;
        for (j = 0; j < fb_data->cur_mode->vmode->xres * fb_data->cur_mode->vmode->yres; j++) {
                *bb_p = 0x0;
@@ -4931,6 +4924,7 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
        u32 out_val[3];
        int enable_gpio;
        enum of_gpio_flags flag;
+       unsigned short *wk_p;
 
        if (!np)
                return -EINVAL;
@@ -5351,6 +5345,14 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
                goto out_copybuffer;
        }
 
+       /* initialize the working buffer */
+       wk_p = (unsigned short *)fb_data->working_buffer_virt;
+       for (i = 0; i < fb_data->cur_mode->vmode->xres *
+                       fb_data->cur_mode->vmode->yres; i++) {
+               *wk_p = 0x00F0;
+               wk_p++;
+       }
+
        fb_data->tmp_working_buffer_virt =
            dma_alloc_coherent(&pdev->dev, fb_data->working_buffer_size,
                               &fb_data->tmp_working_buffer_phys,