summaryrefslogtreecommitdiff
authorNanxin Qin <nanxin.qin@amlogic.com>2020-05-26 12:44:59 (GMT)
committer Shen Liu <shen.liu@amlogic.com>2020-06-02 06:13:30 (GMT)
commit8e675db594c558da6b04c4f09a8ec92a3c4bdac1 (patch)
tree3ce465ce252c973bf9a642cf026566bdb27fd643
parentb6a7a740dda06c7f33dddcb10d15de019a374feb (diff)
downloadmedia_modules-8e675db594c558da6b04c4f09a8ec92a3c4bdac1.zip
media_modules-8e675db594c558da6b04c4f09a8ec92a3c4bdac1.tar.gz
media_modules-8e675db594c558da6b04c4f09a8ec92a3c4bdac1.tar.bz2
vdec: fixed the issue of the swap memory leak. [1/1]
PD#SWPL-26496 Problem: cobalt can't play clear stream after play DRM stream Solution: if the swap memory did not free, then the tvp pool hold a mass of memory that caused to clear stream playback fail as not enough memory to decoding. Verify: u212 Change-Id: I18fcbe228a72c2d445f47058aed4401365365aec Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/frame_provider/decoder/utils/vdec_input.c b/drivers/frame_provider/decoder/utils/vdec_input.c
index 93b632f..0462abe 100644
--- a/drivers/frame_provider/decoder/utils/vdec_input.c
+++ b/drivers/frame_provider/decoder/utils/vdec_input.c
@@ -1073,16 +1073,18 @@ void vdec_input_release(struct vdec_input_s *input)
}
/* release swap pages */
- if (input->swap_page) {
- if (vdec_secure(input->vdec))
+ if (vdec_secure(input->vdec)) {
+ if (input->swap_page_phys)
codec_mm_free_for_dma("SWAP", input->swap_page_phys);
- else
+ } else {
+ if (input->swap_page) {
dma_free_coherent(v4l_get_dev_from_codec_mm(),
PAGE_SIZE, input->swap_page,
- input->swap_page_phys);
- input->swap_page = NULL;
- input->swap_page_phys = 0;
+ input->swap_page_phys);
+ }
}
+ input->swap_page = NULL;
+ input->swap_page_phys = 0;
input->swap_valid = false;
}
EXPORT_SYMBOL(vdec_input_release);