mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-29 14:13:19 +00:00
DISPMANX: Fix refreshrate calculation by updating menu surface asynchronously
This commit is contained in:
parent
b3f1bbc15e
commit
f0c2826994
@ -296,6 +296,20 @@ static void dispmanx_surface_setup(void *data, int src_width, int src_height,
|
||||
vc_dispmanx_update_submit_sync(_dispvars->update);
|
||||
}
|
||||
|
||||
static void dispmanx_surface_update_async(void *data, const void *frame,
|
||||
struct dispmanx_surface *surface)
|
||||
{
|
||||
struct dispmanx_video *_dispvars = data;
|
||||
struct dispmanx_page *page = NULL;
|
||||
|
||||
/* Since it's an async update, there's no need for multiple pages */
|
||||
page = &(surface->pages[0]);
|
||||
|
||||
/* Frame blitting. Nothing else is needed if we only have a page. */
|
||||
vc_dispmanx_resource_write_data(page->resource, surface->pixformat,
|
||||
surface->pitch, (void*)frame, &(surface->bmp_rect));
|
||||
}
|
||||
|
||||
static void dispmanx_surface_update(void *data, const void *frame,
|
||||
struct dispmanx_surface *surface)
|
||||
{
|
||||
@ -473,7 +487,8 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
||||
}
|
||||
}
|
||||
|
||||
if (_dispvars->menu_active)
|
||||
//if (_dispvars->menu_active)
|
||||
if (video_info.fps_show)
|
||||
{
|
||||
char buf[128];
|
||||
video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0);
|
||||
@ -510,6 +525,7 @@ static void dispmanx_set_texture_frame(void *data, const void *frame, bool rgb32
|
||||
_dispvars->menu_height = height;
|
||||
_dispvars->menu_pitch = width * (rgb32 ? 4 : 2);
|
||||
|
||||
/* Menu surface only needs a page as it will be updated asynchronously. */
|
||||
dispmanx_surface_setup(_dispvars,
|
||||
width,
|
||||
height,
|
||||
@ -518,13 +534,15 @@ static void dispmanx_set_texture_frame(void *data, const void *frame, bool rgb32
|
||||
VC_IMAGE_RGBA16,
|
||||
210,
|
||||
_dispvars->aspect_ratio,
|
||||
3,
|
||||
1,
|
||||
0,
|
||||
&_dispvars->menu_surface);
|
||||
}
|
||||
|
||||
/* We update the menu surface if menu is active. */
|
||||
dispmanx_surface_update(_dispvars, frame, _dispvars->menu_surface);
|
||||
/* We update the menu surface if menu is active.
|
||||
* This update is asynchronous, yet menu screen update
|
||||
* will be synced because main surface updating is synchronous */
|
||||
dispmanx_surface_update_async(_dispvars, frame, _dispvars->menu_surface);
|
||||
}
|
||||
|
||||
static void dispmanx_gfx_set_nonblock_state(void *data, bool state)
|
||||
|
Loading…
Reference in New Issue
Block a user