diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2010-05-11 17:07:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-26 17:32:03 -0400 |
commit | cd3ebf63d7c4ea3e708d9f61b7e2c92d1b2321c1 (patch) | |
tree | fd2c663b2ef24182adb3992966ab2fe0f4152e88 /drivers | |
parent | 1a4dd9753e578e650bcbf6a425a4f386a97e3e9b (diff) |
fbdev: bfin-t350mcqb-fb: fix fbmem allocation with blanking lines
commit de145b44b95b9d3212a82d1c0f29b09778ef33c5 upstream.
The current allocation does not include the memory required for blanking
lines. So avoid memory corruption when multiple devices are using the DMA
memory near each other.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/bfin-t350mcqb-fb.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index 2549c53b26a0..6c8b6b6e1c8f 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c | |||
@@ -515,9 +515,9 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) | |||
515 | fbinfo->fbops = &bfin_t350mcqb_fb_ops; | 515 | fbinfo->fbops = &bfin_t350mcqb_fb_ops; |
516 | fbinfo->flags = FBINFO_FLAG_DEFAULT; | 516 | fbinfo->flags = FBINFO_FLAG_DEFAULT; |
517 | 517 | ||
518 | info->fb_buffer = | 518 | info->fb_buffer = dma_alloc_coherent(NULL, fbinfo->fix.smem_len + |
519 | dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle, | 519 | ACTIVE_VIDEO_MEM_OFFSET, |
520 | GFP_KERNEL); | 520 | &info->dma_handle, GFP_KERNEL); |
521 | 521 | ||
522 | if (NULL == info->fb_buffer) { | 522 | if (NULL == info->fb_buffer) { |
523 | printk(KERN_ERR DRIVER_NAME | 523 | printk(KERN_ERR DRIVER_NAME |
@@ -587,8 +587,8 @@ out7: | |||
587 | out6: | 587 | out6: |
588 | fb_dealloc_cmap(&fbinfo->cmap); | 588 | fb_dealloc_cmap(&fbinfo->cmap); |
589 | out4: | 589 | out4: |
590 | dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, | 590 | dma_free_coherent(NULL, fbinfo->fix.smem_len + ACTIVE_VIDEO_MEM_OFFSET, |
591 | info->dma_handle); | 591 | info->fb_buffer, info->dma_handle); |
592 | out3: | 592 | out3: |
593 | framebuffer_release(fbinfo); | 593 | framebuffer_release(fbinfo); |
594 | out2: | 594 | out2: |
@@ -611,8 +611,9 @@ static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev) | |||
611 | free_irq(info->irq, info); | 611 | free_irq(info->irq, info); |
612 | 612 | ||
613 | if (info->fb_buffer != NULL) | 613 | if (info->fb_buffer != NULL) |
614 | dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, | 614 | dma_free_coherent(NULL, fbinfo->fix.smem_len + |
615 | info->dma_handle); | 615 | ACTIVE_VIDEO_MEM_OFFSET, info->fb_buffer, |
616 | info->dma_handle); | ||
616 | 617 | ||
617 | fb_dealloc_cmap(&fbinfo->cmap); | 618 | fb_dealloc_cmap(&fbinfo->cmap); |
618 | 619 | ||