osd: afbc decode error when write afbc start before afbc reset [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Fri, 11 Jan 2019 09:40:36 +0000 (17:40 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Sat, 12 Jan 2019 06:06:40 +0000 (14:06 +0800)
PD#SWPL-4016

Problem:
afbc decode error when write afbc start before afbc reset reg

Solution:
replace invalid reg when found afbc start before afbc reset reg

Verify:
test pass on franklin

Change-Id: Ia01608fe4d5c6132d0b54e63c48560e9e77bfe0a
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_rdma.c

index 15b2043..f1d08ca 100644 (file)
@@ -405,6 +405,17 @@ static inline int wrtie_reg_internal(u32 addr, u32 val)
        /* TODO remove the Done write operation to save the time */
        request_item.addr = OSD_RDMA_FLAG_REG;
        request_item.val = OSD_RDMA_STATUS_MARK_TBL_DONE;
+       /* afbc start before afbc reset will cause afbc decode error */
+       if (addr == VIU_SW_RESET) {
+               int i = 0;
+
+               for (i = 0; i < item_count; i++) {
+                       if (rdma_table[i].addr == VPU_MAFBC_COMMAND) {
+                               rdma_table[i].addr = VIU_OSD1_TEST_RDDATA;
+                               rdma_table[i].val = 0x0;
+                       }
+               }
+       }
        osd_rdma_mem_cpy(
                &rdma_table[item_count],
                &request_item, 8);