summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/grey_core.c')
-rw-r--r--apps/plugins/lib/grey_core.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c
index 20c33a60f4..1326599574 100644
--- a/apps/plugins/lib/grey_core.c
+++ b/apps/plugins/lib/grey_core.c
@@ -495,11 +495,12 @@ bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
495#endif 495#endif
496 496
497 plane_size = _GREY_MULUQ(width, height); 497 plane_size = _GREY_MULUQ(width, height);
498#ifdef CPU_COLDFIRE 498#if defined(CPU_COLDFIRE) /* Buffers should be line aligned */ \
499 plane_size += (-plane_size) & 0xf; /* All buffers should be line aligned */ 499 || defined(CPU_PP) && (NUM_CORES > 1) /* Buffers must be cache line aligned */
500 plane_size += (-plane_size) & 0xf;
500 buftaken = (-(long)gbuf) & 0xf; 501 buftaken = (-(long)gbuf) & 0xf;
501#else 502#else /* Buffers must be 32 bit aligned. */
502 buftaken = (-(long)gbuf) & 3; /* All buffers must be long aligned. */ 503 buftaken = (-(long)gbuf) & 3;
503#endif 504#endif
504 gbuf += buftaken; 505 gbuf += buftaken;
505 506
@@ -509,6 +510,10 @@ bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
509 gbuf += plane_size; 510 gbuf += plane_size;
510 buftaken += plane_size; 511 buftaken += plane_size;
511 } 512 }
513#if NUM_CORES > 1 /* Values and phases must be uncached when running on COP */
514 if (features & GREY_ON_COP)
515 gbuf = UNCACHED_ADDR(gbuf);
516#endif
512 _grey_info.values = gbuf; 517 _grey_info.values = gbuf;
513 gbuf += plane_size; 518 gbuf += plane_size;
514 _grey_info.phases = gbuf; 519 _grey_info.phases = gbuf;
@@ -602,8 +607,14 @@ void grey_show(bool enable)
602#ifdef NEED_BOOST 607#ifdef NEED_BOOST
603 _grey_info.rb->cpu_boost(true); 608 _grey_info.rb->cpu_boost(true);
604#endif 609#endif
610#if NUM_CORES > 1
611 _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE,
612 1, _timer_isr,
613 (_grey_info.flags & GREY_ON_COP) ? COP : CPU);
614#else
605 _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, 1, 615 _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, 1,
606 _timer_isr IF_COP(, CPU)); 616 _timer_isr);
617#endif
607#endif /* !SIMULATOR */ 618#endif /* !SIMULATOR */
608 _grey_info.rb->screen_dump_set_hook(grey_screendump_hook); 619 _grey_info.rb->screen_dump_set_hook(grey_screendump_hook);
609 } 620 }