diff options
author | Danny Nold <dannynold@freescale.com> | 2011-03-02 16:16:24 -0600 |
---|---|---|
committer | Andy Voltz <andy.voltz@timesys.com> | 2011-06-01 13:21:00 -0400 |
commit | afb843880c4004ee92c1c5a3d97f3efd1c0e0b62 (patch) | |
tree | e1195a9da5f63dde81fd8c52bd0b0133d6086696 /drivers | |
parent | b25b0e25eeb0bed29133ac96b3473f5b0f3b76e3 (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/mxc/mxc_epdc_fb.c | 31 |
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); |