Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Mitigate GRALLOC1_PFN_LOCK_FLEX multithread issue.
Browse files Browse the repository at this point in the history
lockFlex fills outFlexLayout->planes with pointer to global variable
ycbcrplanes, doesn't work from multiple threads.
Workaround: change the variable to thread_local.

Jira: OAM-70143, MDP-51191
Test: check memory regions mapped from different threads don't overlap
  • Loading branch information
Alexey Dulaev authored and js0701 committed Dec 15, 2018
1 parent 8768f8c commit 09730d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cros_gralloc/gralloc1/cros_gralloc1_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ int32_t CrosGralloc1::lock(buffer_handle_t bufferHandle, gralloc1_producer_usage
return CROS_GRALLOC_ERROR_NONE;
}

android_flex_plane_t ycbcrplanes[3];
thread_local android_flex_plane_t ycbcrplanes[3];

int32_t update_flex_layout(struct android_ycbcr *ycbcr, struct android_flex_layout *outFlexLayout)
{
Expand Down

0 comments on commit 09730d8

Please sign in to comment.