mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
fbaccel: always blit every 250ms
this fixes problems with plugins that write directly into the framebuffer (tuxtxt for example)
This commit is contained in:
@@ -737,33 +737,26 @@ void CFbAccel::setupGXA()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BLIT_INTERVAL 40
|
#define BLIT_INTERVAL_MIN 40
|
||||||
|
#define BLIT_INTERVAL_MAX 250
|
||||||
void CFbAccel::run()
|
void CFbAccel::run()
|
||||||
{
|
{
|
||||||
printf("CFbAccel::run start\n");
|
printf("CFbAccel::run start\n");
|
||||||
time_t last_blit = 0;
|
time_t last_blit = 0;
|
||||||
bool finished = false; /* one last blit after everything is done */
|
|
||||||
blit_pending = false;
|
blit_pending = false;
|
||||||
blit_thread = true;
|
blit_thread = true;
|
||||||
blit_mutex.lock();
|
blit_mutex.lock();
|
||||||
set_threadname("fb::autoblit");
|
set_threadname("fb::autoblit");
|
||||||
while (blit_thread) {
|
while (blit_thread) {
|
||||||
// printf("blit_pending: %d finish: %d\n", blit_pending, finish);
|
blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX);
|
||||||
if (blit_pending || finished)
|
|
||||||
blit_cond.wait(&blit_mutex, BLIT_INTERVAL);
|
|
||||||
else
|
|
||||||
blit_cond.wait(&blit_mutex);
|
|
||||||
time_t now = time_monotonic_ms();
|
time_t now = time_monotonic_ms();
|
||||||
if (now - last_blit < BLIT_INTERVAL)
|
if (now - last_blit < BLIT_INTERVAL_MIN)
|
||||||
{
|
{
|
||||||
blit_pending = true;
|
blit_pending = true;
|
||||||
finished = false;
|
|
||||||
//printf("CFbAccel::run: skipped, time %ld\n", now - last_blit);
|
//printf("CFbAccel::run: skipped, time %ld\n", now - last_blit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* we timed out => add one more blit, just to make sure */
|
|
||||||
finished = !finished;
|
|
||||||
blit_pending = false;
|
blit_pending = false;
|
||||||
blit_mutex.unlock();
|
blit_mutex.unlock();
|
||||||
_blit();
|
_blit();
|
||||||
|
Reference in New Issue
Block a user