picdec: skip putting vframe if current buffer is being in used [1/1]
authorCao Jian <jian.cao@amlogic.com>
Wed, 16 Jun 2021 05:51:44 +0000 (13:51 +0800)
committerNolen Johnson <johnsonnolen@gmail.com>
Tue, 21 Dec 2021 18:33:31 +0000 (13:33 -0500)
PD#SWPL-52807

Problem:
GIF pictures flicker after quickly switching pictures

Solution:
skip putting vframe if current buffer is being in used

Verify:
on t5

Change-Id: Id1366ead409967a6055d5de5413f16774407c778
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
drivers/amlogic/media/video_processor/pic_dev/picdec.c

index edeb424ffae2c63e9acb9181ea400765d4faacd9..0d282524809292ad9eaa7498251bef8401b0a9ef 100644 (file)
@@ -199,6 +199,10 @@ static void picdec_vf_put(struct vframe_s *vf, void *op_arg)
        if (!vf)
                return;
        INCPTR(putting_ptr);
+       if (putting_ptr == fill_ptr) {
+               aml_pr_info(1, "buffer%d is being in use, skip\n", fill_ptr);
+               return;
+       }
        for (i = 0; i < VF_POOL_SIZE; i++) {
                canvas_addr = index2canvas(i);
                if (vf->canvas0Addr == canvas_addr) {