author | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-05-26 12:44:59 (GMT) |
---|---|---|
committer | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-05-26 13:06:00 (GMT) |
commit | f3eded78794916b1916c19658197f7bad05124fb (patch) | |
tree | 90e832ab4371b5e4164639f5bbc939142baffec2 | |
parent | bb229c02a35f1f01e00fadd8b1af08d6f16dc7ab (diff) | |
download | media_modules-f3eded78794916b1916c19658197f7bad05124fb.zip media_modules-f3eded78794916b1916c19658197f7bad05124fb.tar.gz media_modules-f3eded78794916b1916c19658197f7bad05124fb.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>
-rw-r--r-- | drivers/frame_provider/decoder/utils/vdec_input.c | 14 |
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 767bf9a..284dc02 100644 --- a/drivers/frame_provider/decoder/utils/vdec_input.c +++ b/drivers/frame_provider/decoder/utils/vdec_input.c @@ -1116,16 +1116,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); |