summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c')
-rw-r--r--drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
index 2f784f012517..bdbf0051d1da 100644
--- a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
+++ b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -470,12 +470,14 @@ static void draw_mode0(struct mxc_epdc_fb_data *fb_data);
static bool is_free_list_full(struct mxc_epdc_fb_data *fb_data);
static void do_dithering_processing_Y1_v1_0(
- unsigned char *update_region_ptr,
+ unsigned char *update_region_virt_ptr,
+ dma_addr_t update_region_phys_ptr,
struct mxcfb_rect *update_region,
unsigned long update_region_stride,
int *err_dist);
static void do_dithering_processing_Y4_v1_0(
- unsigned char *update_region_ptr,
+ unsigned char *update_region_virt_ptr,
+ dma_addr_t update_region_phys_ptr,
struct mxcfb_rect *update_region,
unsigned long update_region_stride,
int *err_dist);
@@ -3016,6 +3018,8 @@ static void epdc_submit_work_func(struct work_struct *work)
do_dithering_processing_Y1_v1_0(
(uint8_t *)(upd_data_list->virt_addr +
upd_data_list->update_desc->epdc_offs),
+ upd_data_list->phys_addr +
+ upd_data_list->update_desc->epdc_offs,
&adj_update_region,
(fb_data->rev < 20) ?
ALIGN(adj_update_region.width, 8) :
@@ -3033,6 +3037,8 @@ static void epdc_submit_work_func(struct work_struct *work)
do_dithering_processing_Y4_v1_0(
(uint8_t *)(upd_data_list->virt_addr +
upd_data_list->update_desc->epdc_offs),
+ upd_data_list->phys_addr +
+ upd_data_list->update_desc->epdc_offs,
&adj_update_region,
(fb_data->rev < 20) ?
ALIGN(adj_update_region.width, 8) :
@@ -3713,7 +3719,9 @@ static int mxc_epdc_fb_ioctl(struct fb_info *info, unsigned int cmd,
struct mxc_epdc_fb_data *fb_data = info ?
(struct mxc_epdc_fb_data *)info:g_fb_data;
flush_cache_all();
- outer_flush_all();
+ outer_flush_range(fb_data->working_buffer_phys,
+ fb_data->working_buffer_phys +
+ fb_data->working_buffer_size);
if (copy_to_user((void __user *)arg,
(const void *) fb_data->working_buffer_virt,
fb_data->working_buffer_size))
@@ -3721,7 +3729,9 @@ static int mxc_epdc_fb_ioctl(struct fb_info *info, unsigned int cmd,
else
ret = 0;
flush_cache_all();
- outer_flush_all();
+ outer_flush_range(fb_data->working_buffer_phys,
+ fb_data->working_buffer_phys +
+ fb_data->working_buffer_size);
break;
}
@@ -6645,7 +6655,8 @@ static int pxp_complete_update(struct mxc_epdc_fb_data *fb_data, u32 *hist_stat)
* Dithering algorithm implementation - Y8->Y1 version 1.0 for i.MX
*/
static void do_dithering_processing_Y1_v1_0(
- unsigned char *update_region_ptr,
+ unsigned char *update_region_virt_ptr,
+ dma_addr_t update_region_phys_ptr,
struct mxcfb_rect *update_region,
unsigned long update_region_stride,
int *err_dist)
@@ -6667,7 +6678,7 @@ static void do_dithering_processing_Y1_v1_0(
err_dist_l1 = err_dist + (width_3) * ((y + 1) % 3);
err_dist_l2 = err_dist + (width_3) * ((y + 2) % 3);
- y8buf = update_region_ptr + x_offset;
+ y8buf = update_region_virt_ptr + x_offset;
/* scan the line and convert the Y8 to BW */
for (col = 1; col <= update_region->width; col++) {
@@ -6693,7 +6704,8 @@ static void do_dithering_processing_Y1_v1_0(
}
flush_cache_all();
- outer_flush_all();
+ outer_flush_range(update_region_phys_ptr, update_region_phys_ptr +
+ update_region->height * update_region->width);
}
/*
@@ -6701,7 +6713,8 @@ static void do_dithering_processing_Y1_v1_0(
*/
static void do_dithering_processing_Y4_v1_0(
- unsigned char *update_region_ptr,
+ unsigned char *update_region_virt_ptr,
+ dma_addr_t update_region_phys_ptr,
struct mxcfb_rect *update_region,
unsigned long update_region_stride,
int *err_dist)
@@ -6723,7 +6736,7 @@ static void do_dithering_processing_Y4_v1_0(
err_dist_l1 = err_dist + (width_3) * ((y + 1) % 3);
err_dist_l2 = err_dist + (width_3) * ((y + 2) % 3);
- y8buf = update_region_ptr + x_offset;
+ y8buf = update_region_virt_ptr + x_offset;
/* scan the line and convert the Y8 to Y4 */
for (col = 1; col <= update_region->width; col++) {
@@ -6750,7 +6763,8 @@ static void do_dithering_processing_Y4_v1_0(
}
flush_cache_all();
- outer_flush_all();
+ outer_flush_range(update_region_phys_ptr, update_region_phys_ptr +
+ update_region->height * update_region->width);
}
static int __init mxc_epdc_fb_init(void)