summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Nold <dannynold@freescale.com>2011-03-02 16:16:24 -0600
committerDanny Nold <dannynold@freescale.com>2011-03-04 09:12:32 -0600
commit77d5800db91842d173f7520b3a0181acf51e7557 (patch)
treee1195a9da5f63dde81fd8c52bd0b0133d6086696
parentb74d7147b961d3de15c6f12421754bddf2896e6a (diff)
ENGR00140086 - EPDC fb: Alternate buffer virtual address handled incorrectly
- Virtual address parameter for alternate buffer feature removed. Virtual address now computed based on physical address parameter. Signed-off-by: Danny Nold <dannynold@freescale.com>
-rw-r--r--drivers/video/mxc/mxc_epdc_fb.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c
index c7f28133850f..021993ad3fa1 100644
--- a/drivers/video/mxc/mxc_epdc_fb.c
+++ b/drivers/video/mxc/mxc_epdc_fb.c
@@ -1477,13 +1477,16 @@ static void copy_before_process(struct mxc_epdc_fb_data *fb_data,
int bpp = fb_data->epdc_fb_var.bits_per_pixel;
int left_offs, right_offs;
int x_trailing_bytes, y_trailing_bytes;
+ int alt_buf_offset;
/* Set source buf pointer based on input source, panning, etc. */
if (upd_data->flags & EPDC_FLAG_USE_ALT_BUFFER) {
src_upd_region = &upd_data->alt_buffer_data.alt_update_region;
src_stride =
upd_data->alt_buffer_data.width * bpp/8;
- src_ptr = upd_data->alt_buffer_data.virt_addr
+ alt_buf_offset = upd_data->alt_buffer_data.phys_addr -
+ fb_data->info.fix.smem_start;
+ src_ptr = fb_data->info.screen_base + alt_buf_offset
+ src_upd_region->top * src_stride;
} else {
src_upd_region = &upd_data->update_region;
@@ -2145,12 +2148,26 @@ int mxc_epdc_fb_send_update(struct mxcfb_update_data *upd_data,
"Aborting update.\n");
return -EINVAL;
}
- if ((upd_data->flags & EPDC_FLAG_USE_ALT_BUFFER) &&
- ((upd_data->update_region.width != upd_data->alt_buffer_data.alt_update_region.width) ||
- (upd_data->update_region.height != upd_data->alt_buffer_data.alt_update_region.height))) {
- dev_err(fb_data->dev,
- "Alternate update region dimensions must match screen update region dimensions.\n");
- return -EINVAL;
+ if (upd_data->flags & EPDC_FLAG_USE_ALT_BUFFER) {
+ if ((upd_data->update_region.width !=
+ upd_data->alt_buffer_data.alt_update_region.width) ||
+ (upd_data->update_region.height !=
+ upd_data->alt_buffer_data.alt_update_region.height)) {
+ dev_err(fb_data->dev,
+ "Alternate update region dimensions must "
+ "match screen update region dimensions.\n");
+ return -EINVAL;
+ }
+ /* Validate physical address parameter */
+ if ((upd_data->alt_buffer_data.phys_addr <
+ fb_data->info.fix.smem_start) ||
+ (upd_data->alt_buffer_data.phys_addr >
+ fb_data->info.fix.smem_start + fb_data->map_size)) {
+ dev_err(fb_data->dev,
+ "Invalid physical address for alternate "
+ "buffer. Aborting update...\n");
+ return -EINVAL;
+ }
}
spin_lock_irqsave(&fb_data->queue_lock, flags);