OSDN Git Service

Fix GRALLOC1_PFN_LOCK_FLEX multithread issue.
authorAlexey Dulaev <alexeyx.dulaev@intel.com>
Fri, 5 Oct 2018 08:26:39 +0000 (11:26 +0300)
committerLin Johnson <johnson.lin@intel.com>
Tue, 16 Oct 2018 00:43:27 +0000 (08:43 +0800)
commitc6971682cf6d8fed5f6d69b3c3c6c194ac7fdf69
tree24ce73a44bdb6544f121ec1fa0e5414596833d83
parent04ebd80cbb5c58d0f95f5c831ae27fbff0796daa
Fix GRALLOC1_PFN_LOCK_FLEX multithread issue.

lockFlex fills outFlexLayout->planes with pointer to global variable,
doesn't work from multiple threads.
Solution: rely that caller allocates needed planes structures,
just use them for output.

gralloc1.h about GRALLOC1_PFN_GET_NUM_FLEX_PLANES:
This may be used to efficiently allocate only as many plane structures as necessary before calling into lockFlex.
It means that lockFlex caller is responsible for outFlexLayout->planes allocation.

It also demand fix in GRALLOC1_PFN_GET_NUM_FLEX_PLANES:
should return 3 for HAL_PIXEL_FORMAT_NV12_TILED_INTEL.

Jira: None
Test: check memory regions mapped from different threads don't overlap
cros_gralloc/gralloc1/cros_gralloc1_module.cc