summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-04-13 11:57:11 +0000
committerJens Arnold <amiconn@rockbox.org>2008-04-13 11:57:11 +0000
commitc773eed3e1dcde1d248dac7008cb29cd8aaae288 (patch)
treedeba0c33fd3efa9eb2c6d8c8545e27f78804e11d
parent8c5d552ebdadd00a3f1610110afb6eb4fa77071a (diff)
downloadrockbox-c773eed3e1dcde1d248dac7008cb29cd8aaae288.tar.gz
rockbox-c773eed3e1dcde1d248dac7008cb29cd8aaae288.zip
The greylib now takes care of the necessary aligment and uncached addressing itself, so simplify the code a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17094 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c
index 24e820b0af..c9601b8593 100644
--- a/apps/plugins/mpegplayer/stream_mgr.c
+++ b/apps/plugins/mpegplayer/stream_mgr.c
@@ -993,33 +993,19 @@ int stream_init(void)
993 993
994 /* Initialize non-allocator blocks first */ 994 /* Initialize non-allocator blocks first */
995#ifndef HAVE_LCD_COLOR 995#ifndef HAVE_LCD_COLOR
996 bool success; 996 long greysize;
997 long graysize;
998 void *graymem;
999
1000#ifdef PROC_NEEDS_CACHEALIGN
1001 /* This can run on another processor - align data */
1002 memsize = CACHEALIGN_BUFFER(&mem, memsize);
1003 graymem = UNCACHED_ADDR(mem);
1004#else
1005 graymem = mem;
1006#endif
1007
1008 success = grey_init(rb, graymem, memsize, GREY_BUFFERED|GREY_ON_COP,
1009 LCD_WIDTH, LCD_HEIGHT, &graysize);
1010
1011 /* This can run on another processor - align size */
1012 graysize = CACHEALIGN_UP(graysize);
1013 997
1014 mem += graysize; 998 /* Greylib init handles all necessary cache alignment */
1015 memsize -= graysize; 999 if (!grey_init(rb, mem, memsize, GREY_BUFFERED|GREY_ON_COP,
1016 1000 LCD_WIDTH, LCD_HEIGHT, &greysize))
1017 if (!success || (ssize_t)memsize <= 0)
1018 { 1001 {
1019 rb->splash(HZ, "greylib init failed!"); 1002 rb->splash(HZ, "greylib init failed!");
1020 return STREAM_ERROR; 1003 return STREAM_ERROR;
1021 } 1004 }
1022 1005
1006 mem += greysize;
1007 memsize -= greysize;
1008
1023 grey_clear_display(); 1009 grey_clear_display();
1024#endif /* !HAVE_LCD_COLOR */ 1010#endif /* !HAVE_LCD_COLOR */
1025 1011