summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 562a2c8)
raw | patch | inline | side by side (parent: 562a2c8)
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) |
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>
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 | patch | blob | history |
diff --git a/util/display-kmscube.c b/util/display-kmscube.c
index 0c00d67cb64760d646b4f55b7c855597a58acfd3..bc8f000fe46309c20a963aac2c1e65972e049501 100644 (file)
--- a/util/display-kmscube.c
+++ b/util/display-kmscube.c
goto fail;
}
+ pthread_mutex_lock(&disp_kmsc->init_lock);
for (i = 0; i < n; i++) {
bufs[i] = alloc_buffer(disp, fourcc, w, h);
if (!bufs[i]) {
*/
disp_kmsc->num_faces++;
disp->buf = bufs;
+ pthread_mutex_unlock(&disp_kmsc->init_lock);
return bufs;
fail: