Skip to content

video: driver: fix RO buffer DMA memory leak on teardown and fix raw buffer size for interlace handling#89

Merged
vgarodia merged 2 commits into
qualcomm-linux:video.qclinux.mainfrom
venvenk:video.qclinux.main
Apr 3, 2026
Merged

video: driver: fix RO buffer DMA memory leak on teardown and fix raw buffer size for interlace handling#89
vgarodia merged 2 commits into
qualcomm-linux:video.qclinux.mainfrom
venvenk:video.qclinux.main

Conversation

@venvenk

@venvenk venvenk commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Ensure RO and external buffers are properly freed with dma_free_attrs()
during flush and destroy paths instead of only logging non-zero refcounts.

Also guard msm_vb2_put() against zero refcount buffers and avoid freeing
DMA memory for decode output buffers that are tracked as read-only, to
prevent double free and memory corruption.

Fix raw buffer size calculation by deferring interlace handling to firmware events.

Interlace is enabled by default during buffer size calculation. Due to
this, the size is computed a larger value.
Keep interlace decision be decided by the firmware event when it can
firmly say if the content is interlace or progressive.

Change-Id: I796a01442a871a0a0c5b993200c84b5b488cbf0a
Signed-off-by: Venkata Siva Pavan KumarVenkatapatigari <venvenk@qti.qualcomm.com>

@vgarodia vgarodia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm the CB changes with upstream driver as well

Ensure RO and external buffers are properly freed with dma_free_attrs()
during flush and destroy paths instead of only logging non-zero refcounts.

Also guard msm_vb2_put() against zero refcount buffers and avoid freeing
DMA memory for decode output buffers that are tracked as read-only, to
prevent double free and memory corruption.

Change-Id: I5ebc548bfb28a895077dd2b0d4020a14a1e79bbc
Signed-off-by: Renjiang Han <renjiang@qti.qualcomm.com>
@venvenk venvenk force-pushed the video.qclinux.main branch from 161966b to 5ef5403 Compare April 3, 2026 14:09
@venvenk venvenk changed the title video: driver: Scale Lemans instance support 32 instances and fix raw buffer size for interlace handling video: driver: fix RO buffer DMA memory leak on teardown and fix raw buffer size for interlace handling Apr 3, 2026
@venvenk

venvenk commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Confirm the CB changes with upstream driver as well

CB changes has issue with upstream driver.
Need to debug so removed that change and added memory leak change in this PR.

@vgarodia vgarodia merged commit 7461781 into qualcomm-linux:video.qclinux.main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants