summaryrefslogtreecommitdiffstats
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,
#endif
plane_size = _GREY_MULUQ(width, height);
-#ifdef CPU_COLDFIRE
- plane_size += (-plane_size) & 0xf; /* All buffers should be line aligned */
+#if defined(CPU_COLDFIRE) /* Buffers should be line aligned */ \
+ || defined(CPU_PP) && (NUM_CORES > 1) /* Buffers must be cache line aligned */
+ plane_size += (-plane_size) & 0xf;
buftaken = (-(long)gbuf) & 0xf;
-#else
- buftaken = (-(long)gbuf) & 3; /* All buffers must be long aligned. */
+#else /* Buffers must be 32 bit aligned. */
+ buftaken = (-(long)gbuf) & 3;
#endif
gbuf += buftaken;
@@ -509,6 +510,10 @@ bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
gbuf += plane_size;
buftaken += plane_size;
}
+#if NUM_CORES > 1 /* Values and phases must be uncached when running on COP */
+ if (features & GREY_ON_COP)
+ gbuf = UNCACHED_ADDR(gbuf);
+#endif
_grey_info.values = gbuf;
gbuf += plane_size;
_grey_info.phases = gbuf;
@@ -602,8 +607,14 @@ void grey_show(bool enable)
#ifdef NEED_BOOST
_grey_info.rb->cpu_boost(true);
#endif
+#if NUM_CORES > 1
+ _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE,
+ 1, _timer_isr,
+ (_grey_info.flags & GREY_ON_COP) ? COP : CPU);
+#else
_grey_info.rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, 1,
- _timer_isr IF_COP(, CPU));
+ _timer_isr);
+#endif
#endif /* !SIMULATOR */
_grey_info.rb->screen_dump_set_hook(grey_screendump_hook);
}