Merge pull request #4866 from andrewlxer/master

Minor race fix and small cleanup to dispmanx_gfx
This commit is contained in:
Twinaphex 2017-04-30 11:48:41 +02:00 committed by GitHub
commit 2009d359c9

View File

@ -235,7 +235,7 @@ static void dispmanx_surface_setup(void *data, int src_width, int src_height,
struct dispmanx_surface **sp)
{
struct dispmanx_video *_dispvars = data;
int i, dst_width, dst_height, dst_xpos, dst_ypos;
int i, dst_width, dst_height, dst_xpos, dst_ypos, visible_width;
struct dispmanx_surface *surface = NULL;
*sp = calloc (1, sizeof(struct dispmanx_surface));
@ -273,7 +273,7 @@ static void dispmanx_surface_setup(void *data, int src_width, int src_height,
/* The "visible" width obtained from the core pitch. We blit based on
* the "visible" width, for cores with things between scanlines. */
int visible_width = visible_pitch / (bpp / 8);
visible_width = visible_pitch / (bpp / 8);
dst_width = _dispvars->dispmanx_height * aspect;
dst_height = _dispvars->dispmanx_height;
@ -349,13 +349,13 @@ static void dispmanx_surface_update(void *data, const void *frame,
vc_dispmanx_element_change_source(_dispvars->update, surface->element,
surface->next_page->resource);
vc_dispmanx_update_submit(_dispvars->update,
dispmanx_vsync_callback, (void*)(surface->next_page));
slock_lock(_dispvars->pending_mutex);
_dispvars->pageflip_pending++;
slock_unlock(_dispvars->pending_mutex);
vc_dispmanx_update_submit(_dispvars->update,
dispmanx_vsync_callback, (void*)(surface->next_page));
/* Get the next page ready for our next surface_update re-entry.
* It's OK to wait now that we've issued the flip to the last produced frame! */
surface->next_page = dispmanx_get_free_page(_dispvars, surface);
@ -365,9 +365,9 @@ static void dispmanx_surface_update(void *data, const void *frame,
static void dispmanx_set_scaling (bool bilinear_filter)
{
if (bilinear_filter)
vc_gencmd_send( "%s", "scaling_kernel 0 -2 -6 -8 -10 -8 -3 2 18 50 82 119 155 187 213 227 227 213 187 155 119 82 50 18 2 -3 -8 -10 -8 -6 -2 0 0");
vc_gencmd_send("%s", "scaling_kernel 0 -2 -6 -8 -10 -8 -3 2 18 50 82 119 155 187 213 227 227 213 187 155 119 82 50 18 2 -3 -8 -10 -8 -6 -2 0 0");
else
vc_gencmd_send( "%s", "scaling_kernel 0 0 0 0 0 0 0 0 1 1 1 1 255 255 255 255 255 255 255 255 1 1 1 1 0 0 0 0 0 0 0 0 1");
vc_gencmd_send("%s", "scaling_kernel 0 0 0 0 0 0 0 0 1 1 1 1 255 255 255 255 255 255 255 255 1 1 1 1 0 0 0 0 0 0 0 0 1");
}
static void dispmanx_blank_console (void *data)