From eeb9ec9af9c3b1e94d4cd5854e82ef5238f9f335 Mon Sep 17 00:00:00 2001 From: vanfanel Date: Sat, 14 Mar 2015 05:06:03 +0100 Subject: RASPBERRYPI: Corrected redundant for loop on the dispmanx graphics driver code. --- backends/graphics/dispmanxsdl/dispmanxsdl-graphics.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/dispmanxsdl/dispmanxsdl-graphics.cpp b/backends/graphics/dispmanxsdl/dispmanxsdl-graphics.cpp index d67cb90f65..08379d2a34 100644 --- a/backends/graphics/dispmanxsdl/dispmanxsdl-graphics.cpp +++ b/backends/graphics/dispmanxsdl/dispmanxsdl-graphics.cpp @@ -101,11 +101,8 @@ void DispmanXSdlGraphicsManager::DispmanXInit () { _dispvars->pages[i].numpage = i; _dispvars->pages[i].used = false; _dispvars->pages[i].dispvars = _dispvars; - } - - for (i = 0; i < numpages; i++) { pthread_mutex_init(&_dispvars->pages[i].pageUseMutex, NULL); - } + } // Before we call any vc_* function, we need to call this one. bcm_host_init(); @@ -216,9 +213,9 @@ void DispmanXVSyncCallback (DISPMANX_UPDATE_HANDLE_T u, void * arg){ // We mark as free the page that was visible until now if (page->dispvars->currentPage != NULL) { - pthread_mutex_lock(&page->pageUseMutex); + pthread_mutex_lock(&page->dispvars->currentPage->pageUseMutex); page->dispvars->currentPage->used = false; - pthread_mutex_unlock(&page->pageUseMutex); + pthread_mutex_unlock(&page->dispvars->currentPage->pageUseMutex); } // The page on which we just issued the flip that caused this callback becomes the visible one -- cgit v1.2.3