feature_en: use a middle buffer as queue writes buffer ASA its available
authorSubhajit Paul <subhajit_paul@ti.com>
Thu, 4 Jul 2019 10:12:40 +0000 (15:42 +0530)
committerSubhajit Paul <subhajit_paul@ti.com>
Thu, 4 Jul 2019 10:12:40 +0000 (15:42 +0530)
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
drm_util.c

index 197dc9c545fc67c7bc4e0dcbb74af2cd7b4251f7..f47e96205c5d1963d2b1a26fb8172336e9d7e133 100644 (file)
@@ -415,6 +415,7 @@ void *drm_loop(void *arg)
        int count;
        drmModeAtomicReqPtr commit_req;
        struct buffer *old_buffers[32] = {NULL};
+       struct buffer *mid_buffers[32] = {NULL};
        struct buffer *new_buffers[32];
 
        while(true) {
@@ -477,7 +478,8 @@ next_iter:
                for(i = 0; i < count; i++) {
                        if(old_buffers[i])
                                bq_queue_empty(drm.layers[i].bq, &old_buffers[i]->link);
-                       old_buffers[i] = new_buffers[i];
+                       old_buffers[i] = mid_buffers[i];
+                       mid_buffers[i] = new_buffers[i];
                }
        }
 }