From f72058e32e58fb676372664f49e85c6e1601ee5a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 17 May 2013 19:44:16 +0200 Subject: [PATCH] CFrameBuffer::waitForIdle: Added a parameter to identify the execution at Debug Output - For example: name of the calling function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d460c50bd54237f4512691ee3032aae0cbac2395 Author: Michael Liebmann Date: 2013-05-17 (Fri, 17 May 2013) Origin message was: ------------------ * CFrameBuffer::waitForIdle: Added a parameter to identify the execution at Debug Output - For example: name of the calling function --- src/driver/fontrenderer.cpp | 2 +- src/driver/framebuffer.cpp | 12 ++++++++---- src/driver/framebuffer.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 28e62a17b..970124b73 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -443,7 +443,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u /* the GXA seems to do it's job asynchonously, so we need to wait until it's ready, otherwise the font will sometimes "be overwritten" with background color or bgcolor will be wrong */ - frameBuffer->waitForIdle(); + frameBuffer->waitForIdle("Font::RenderString"); #endif /* fetch bgcolor from framebuffer, using lower left edge of the font... */ fb_pixel_t bgcolor = *(frameBuffer->getFrameBufferPointer() + x + diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index b49788b58..e7a8299e6 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -145,7 +145,7 @@ void CFrameBuffer::add_gxa_sync_marker(void) } /* wait until the current marker comes out of the GXA command queue */ -void CFrameBuffer::waitForIdle(void) +void CFrameBuffer::waitForIdle(const char* func) { unsigned int cfg, count = 0; do { @@ -159,8 +159,12 @@ void CFrameBuffer::waitForIdle(void) //fprintf(stderr, "%s: read %02x, expected %02x\n", __FUNCTION__, cfg, _mark); } while(++count < 2048); /* don't deadlock here if there is an error */ - if (count > 512) /* more than 100 are unlikely, */ - fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%d)!\n", count); + if (count > 512) /* more than 100 are unlikely, */{ + if (func != NULL) + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%04d) [%s]!\n", count, func); + else + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%d)!\n", count); + } } #endif /* USE_NEVIS_GXA */ @@ -1213,7 +1217,7 @@ void CFrameBuffer::paintBoxFrame(const int x, const int y, const int dx, const i if (type && radius) { radius = limitRadius(dx, dy, radius); int line = 0; - waitForIdle(); + waitForIdle("CFrameBuffer::paintBoxFrame"); while (line < dy) { int ofs = 0, ofs_i = 0; // inner box diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 6b37f3ffe..0c711fa49 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -235,7 +235,7 @@ class CFrameBuffer bool Locked(void) { return locked; }; #ifdef USE_NEVIS_GXA void add_gxa_sync_marker(void); - void waitForIdle(void); + void waitForIdle(const char* func=NULL); #else inline void waitForIdle(void) {}; #endif