forked from len0rd/rockbox
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
This commit is contained in:
parent
8c5d552ebd
commit
c773eed3e1
1 changed files with 7 additions and 21 deletions
|
@ -993,33 +993,19 @@ int stream_init(void)
|
||||||
|
|
||||||
/* Initialize non-allocator blocks first */
|
/* Initialize non-allocator blocks first */
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
bool success;
|
long greysize;
|
||||||
long graysize;
|
|
||||||
void *graymem;
|
|
||||||
|
|
||||||
#ifdef PROC_NEEDS_CACHEALIGN
|
/* Greylib init handles all necessary cache alignment */
|
||||||
/* This can run on another processor - align data */
|
if (!grey_init(rb, mem, memsize, GREY_BUFFERED|GREY_ON_COP,
|
||||||
memsize = CACHEALIGN_BUFFER(&mem, memsize);
|
LCD_WIDTH, LCD_HEIGHT, &greysize))
|
||||||
graymem = UNCACHED_ADDR(mem);
|
|
||||||
#else
|
|
||||||
graymem = mem;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
success = grey_init(rb, graymem, memsize, GREY_BUFFERED|GREY_ON_COP,
|
|
||||||
LCD_WIDTH, LCD_HEIGHT, &graysize);
|
|
||||||
|
|
||||||
/* This can run on another processor - align size */
|
|
||||||
graysize = CACHEALIGN_UP(graysize);
|
|
||||||
|
|
||||||
mem += graysize;
|
|
||||||
memsize -= graysize;
|
|
||||||
|
|
||||||
if (!success || (ssize_t)memsize <= 0)
|
|
||||||
{
|
{
|
||||||
rb->splash(HZ, "greylib init failed!");
|
rb->splash(HZ, "greylib init failed!");
|
||||||
return STREAM_ERROR;
|
return STREAM_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mem += greysize;
|
||||||
|
memsize -= greysize;
|
||||||
|
|
||||||
grey_clear_display();
|
grey_clear_display();
|
||||||
#endif /* !HAVE_LCD_COLOR */
|
#endif /* !HAVE_LCD_COLOR */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue