aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/atmel_lcdfb.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2008-04-28 05:15:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:38 -0400
commit01d3a5e7fab7732cfc5d5d4533e9378ea435295a (patch)
tree3bf547f6eaeec9c69f78e1b70cb66f67399d1abd /drivers/video/atmel_lcdfb.c
parent20e061fb750d36ec0ffcb2e44ed7dafa9018223b (diff)
atmel_lcdfb: don't initialize a pre-allocated framebuffer
If the user specified a fixed framebuffer address on the command line, it may have been initialized already with a splash image or something, so we shouldn't clear it. Therefore, we should only initialize the framebuffer if we allocated it ourselves. This patch also updates the AVR32 setup code to clear the framebuffer if it allocated it itself, i.e. the user didn't provide a fixed address or the reservation failed. I've updated the at91 platform code as well so that it initializes the framebuffer if it is located in SRAM, but I haven't tested that it actually works. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Nicolas FERRE <nicolas.ferre@rfo.atmel.com> Cc: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r--drivers/video/atmel_lcdfb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index fc65c02306dd..4d68b1b880d6 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -250,6 +250,8 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
250 return -ENOMEM; 250 return -ENOMEM;
251 } 251 }
252 252
253 memset(info->screen_base, 0, info->fix.smem_len);
254
253 return 0; 255 return 0;
254} 256}
255 257
@@ -634,7 +636,6 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
634 struct fb_info *info = sinfo->info; 636 struct fb_info *info = sinfo->info;
635 int ret = 0; 637 int ret = 0;
636 638
637 memset_io(info->screen_base, 0, info->fix.smem_len);
638 info->var.activate |= FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW; 639 info->var.activate |= FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW;
639 640
640 dev_info(info->device, 641 dev_info(info->device,
@@ -764,6 +765,11 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
764 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); 765 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
765 if (!info->screen_base) 766 if (!info->screen_base)
766 goto release_intmem; 767 goto release_intmem;
768
769 /*
770 * Don't clear the framebuffer -- someone may have set
771 * up a splash image.
772 */
767 } else { 773 } else {
768 /* alocate memory buffer */ 774 /* alocate memory buffer */
769 ret = atmel_lcdfb_alloc_video_memory(sinfo); 775 ret = atmel_lcdfb_alloc_video_memory(sinfo);