From 8508cebaf799c83af2861318aa4cd22cc87842da Mon Sep 17 00:00:00 2001 From: sky zhou Date: Sat, 6 Apr 2019 19:35:34 +0800 Subject: [PATCH] osd: fix release dma buf error when vout1&2 run at same time. PD #SWPL-6027 Problem: dmabuf panic when vout1,vout2 run at same time. Solution: When do pandisplay, only release the dma buf displayed on current vout pipeline. Verify: Verify on macroni. Change-Id: I8951d55f9f56cbfa509bcbe2906a108c5f50dbfe Signed-off-by: sky zhou --- drivers/amlogic/media/osd/osd_hw.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 3eeb190..ca0170b 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -4753,20 +4753,17 @@ out: } else osd_timeline_increase(output_index); } - /*clear last displayed buffer.*/ - for (i = 0; i < HW_OSD_COUNT; i++) { + /* clear osd layer's order */ + for (i = start_index; i < osd_count; i++) { + layer_map = &fence_map->layer_map[i]; if (displayed_bufs[i]) { fput(displayed_bufs[i]); displayed_bufs[i] = NULL; } - } - /* clear osd layer's order */ - for (i = start_index; i < osd_count; i++) { - layer_map = &fence_map->layer_map[i]; if (layer_map->buf_file) displayed_bufs[i] = layer_map->buf_file; if (layer_map->in_fence) - osd_put_fenceobj(layer_map->in_fence); + osd_put_fenceobj(layer_map->in_fence); osd_hw.order[i] = 0; } } -- 2.7.4