author | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Mon, 27 Jul 2015 13:32:40 +0000 (19:02 +0530) | ||
committer | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Mon, 3 Aug 2015 04:56:18 +0000 (10:26 +0530) | ||
commit | 28a366d693f4f8adb2d6d52b8e3691fbddc3ed7f | |
tree | 0ab7179b5c155c910e5565b2e77c49a07d0b59a4 | tree | snapshot (tar.xz tar.gz zip) |
parent | 562a2c8d0be367c1497527bf65588c9de6b1cb59 | commit | diff |
display-kmscube: fix race condition for buffer to face mapping
When disp_get_vid_buffers is called, all the buffers allocated in
one such call are grouped and are assigned a face number.
Any of these buffers will always be rendered on this face.
This function is not reentrant as it uses the num_face field of disp.
Because of this, if two of these functions are being executed in parallel,
sometimes, buffers in pool get assigned a different face number.
Because of this, randomly a buffer for some other face gets rendered
causing flicker.
Protect the function with the mutex lock so that the buffer to face number
allocation is done correctly, hence avoiding the flicker.
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
When disp_get_vid_buffers is called, all the buffers allocated in
one such call are grouped and are assigned a face number.
Any of these buffers will always be rendered on this face.
This function is not reentrant as it uses the num_face field of disp.
Because of this, if two of these functions are being executed in parallel,
sometimes, buffers in pool get assigned a different face number.
Because of this, randomly a buffer for some other face gets rendered
causing flicker.
Protect the function with the mutex lock so that the buffer to face number
allocation is done correctly, hence avoiding the flicker.
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
util/display-kmscube.c | diff | blob | history |