(dispmanx_gfx.c) Cleanups
This commit is contained in:
parent
7a9d2c6358
commit
6c0f4eb5f0
|
@ -238,11 +238,13 @@ static void vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data)
|
||||||
page->dispvars->pageflip_pending--;
|
page->dispvars->pageflip_pending--;
|
||||||
slock_unlock(page->dispvars->pending_mutex);
|
slock_unlock(page->dispvars->pending_mutex);
|
||||||
|
|
||||||
/* We mark as free the page that was visible until now */
|
|
||||||
if (page->dispvars->currentPage)
|
if (page->dispvars->currentPage)
|
||||||
{
|
{
|
||||||
slock_lock(page->dispvars->currentPage->page_used_mutex);
|
slock_lock(page->dispvars->currentPage->page_used_mutex);
|
||||||
|
|
||||||
|
/* We mark as free the page that was visible until now */
|
||||||
page->dispvars->currentPage->used = false;
|
page->dispvars->currentPage->used = false;
|
||||||
|
|
||||||
slock_unlock(page->dispvars->currentPage->page_used_mutex);
|
slock_unlock(page->dispvars->currentPage->page_used_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +326,7 @@ static bool dispmanx_setup_scale(void *data, unsigned width,
|
||||||
dispmanx_free_main_resources(_dispvars);
|
dispmanx_free_main_resources(_dispvars);
|
||||||
vc_dispmanx_display_get_info(_dispvars->display, &(_dispvars->amode));
|
vc_dispmanx_display_get_info(_dispvars->display, &(_dispvars->amode));
|
||||||
|
|
||||||
// We chose the pixel format depending on the bpp of the frame
|
// We choose the pixel format depending on the bpp of the frame.
|
||||||
switch (_dispvars->bytes_per_pixel)
|
switch (_dispvars->bytes_per_pixel)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -458,6 +460,7 @@ static void *dispmanx_gfx_init(const video_info_t *video,
|
||||||
_dispvars->vsync_cond_mutex = slock_new();
|
_dispvars->vsync_cond_mutex = slock_new();
|
||||||
|
|
||||||
bcm_host_init();
|
bcm_host_init();
|
||||||
|
|
||||||
_dispvars->display = vc_dispmanx_display_open(_dispvars->screen);
|
_dispvars->display = vc_dispmanx_display_open(_dispvars->screen);
|
||||||
|
|
||||||
if (input && input_data)
|
if (input && input_data)
|
||||||
|
@ -744,7 +747,9 @@ static void dispmanx_gfx_free(void *data)
|
||||||
for (i = 0; i < NUMPAGES; i++)
|
for (i = 0; i < NUMPAGES; i++)
|
||||||
slock_free(_dispvars->pages[i].page_used_mutex);
|
slock_free(_dispvars->pages[i].page_used_mutex);
|
||||||
|
|
||||||
|
if (_dispvars->pages)
|
||||||
free (_dispvars->pages);
|
free (_dispvars->pages);
|
||||||
|
_dispvars->pages = NULL;
|
||||||
|
|
||||||
dispmanx_unblank_console(_dispvars);
|
dispmanx_unblank_console(_dispvars);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue