48df9029 | 01-Sep-2024 |
Chun-Kuang Hu <chunkuang.hu@kernel.org> |
media: platform: mtk-mdp3: Use cmdq_pkt_create() and cmdq_pkt_destroy()
Use the cmdq_pkt_create() and cmdq_pkt_destroy() common functions instead of implementing specific mdp3 versions.
Signed-off-
media: platform: mtk-mdp3: Use cmdq_pkt_create() and cmdq_pkt_destroy()
Use the cmdq_pkt_create() and cmdq_pkt_destroy() common functions instead of implementing specific mdp3 versions.
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
50ab69f2 | 01-Sep-2024 |
Chun-Kuang Hu <chunkuang.hu@kernel.org> |
media: platform: mtk-mdp3: Get fine-grain control of cmdq_pkt_finalize()
In order to have fine-grained control, use cmdq_pkt_eoc() and cmdq_pkt_jump_rel() to replace cmdq_pkt_finalize().
Signed-off
media: platform: mtk-mdp3: Get fine-grain control of cmdq_pkt_finalize()
In order to have fine-grained control, use cmdq_pkt_eoc() and cmdq_pkt_jump_rel() to replace cmdq_pkt_finalize().
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
6633de33 | 23-Aug-2024 |
Nícolas F. R. A. Prado <nfraprado@collabora.com> |
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_POLL macro
Just like was done with MM_REG_WRITE, remove the mask from the MM_REG_POLL macro, leaving MM_REG_POLL_MASK to be used when a m
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_POLL macro
Just like was done with MM_REG_WRITE, remove the mask from the MM_REG_POLL macro, leaving MM_REG_POLL_MASK to be used when a mask is required, and update the call sites accordingly. In this case, all calls require a mask, so MM_REG_POLL remains unused, but at least this makes the MM_REG_POLL macros consistent with the MM_REG_WRITE ones.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
7b00fcfd | 23-Aug-2024 |
Nícolas F. R. A. Prado <nfraprado@collabora.com> |
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_WRITE macro
There are two macros to issue a cmdq write: MM_REG_WRITE_MASK and MM_REG_WRITE, but confusingly, both of them take a mask par
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_WRITE macro
There are two macros to issue a cmdq write: MM_REG_WRITE_MASK and MM_REG_WRITE, but confusingly, both of them take a mask parameter. The difference is that MM_REG_WRITE additionally checks whether the mask passed in contains the register mask, in which case, the 0xffffffff mask is passed to cmdq_pkt_write_mask(), effectively disregarding the mask and calling cmdq_pkt_write() as an optimization.
Move that optimization to the MM_REG_WRITE_MASK macro and make MM_REG_WRITE the variant that doesn't take a mask, directly calling to cmdq_pkt_write().
Change the call sites to MM_REG_WRITE whenever a mask wasn't necessary (ie 0xffffffff or a <register>_MASK was passed as mask) and in other cases to MM_REG_WRITE_MASK.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
6d9038dc | 23-Aug-2024 |
Nícolas F. R. A. Prado <nfraprado@collabora.com> |
media: platform: mtk-mdp3: Remove useless variadic arguments from macros
A few macros declare variadic arguments even though the underlying functions don't support them. Remove them.
Signed-off-by:
media: platform: mtk-mdp3: Remove useless variadic arguments from macros
A few macros declare variadic arguments even though the underlying functions don't support them. Remove them.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
41eb4fb5 | 16-Jun-2024 |
Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
media: mediatek: vcodec: Constify struct vb2_ops
"struct vb2_ops" are not modified in this driver.
Constifying this structure moves some data to a read-only section, so increase overall security.
media: mediatek: vcodec: Constify struct vb2_ops
"struct vb2_ops" are not modified in this driver.
Constifying this structure moves some data to a read-only section, so increase overall security.
On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 18059 3096 16 21171 52b3 drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.o
After: ===== text data bss dec hex filename 18171 2968 16 21155 52a3 drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
7878d3a3 | 13-Jun-2024 |
Yunfei Dong <yunfei.dong@mediatek.com> |
media: mediatek: vcodec: Fix H264 stateless decoder smatch warning
Fix a smatch static checker warning on vdec_h264_req_if.c. Which leads to a kernel crash when fb is NULL.
Fixes: 06fa5f757dc5 ("me
media: mediatek: vcodec: Fix H264 stateless decoder smatch warning
Fix a smatch static checker warning on vdec_h264_req_if.c. Which leads to a kernel crash when fb is NULL.
Fixes: 06fa5f757dc5 ("media: mtk-vcodec: vdec: support stateless H.264 decoding") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
b113bc7c | 13-Jun-2024 |
Yunfei Dong <yunfei.dong@mediatek.com> |
media: mediatek: vcodec: Fix VP8 stateless decoder smatch warning
Fix a smatch static checker warning on vdec_vp8_req_if.c. Which leads to a kernel crash when fb is NULL.
Fixes: 7a7ae26fd458 ("medi
media: mediatek: vcodec: Fix VP8 stateless decoder smatch warning
Fix a smatch static checker warning on vdec_vp8_req_if.c. Which leads to a kernel crash when fb is NULL.
Fixes: 7a7ae26fd458 ("media: mediatek: vcodec: support stateless VP8 decoding") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
b785ea5b | 22-Apr-2024 |
Douglas Anderson <dianders@chromium.org> |
media: mediatek: vcodec: Alloc DMA memory with DMA_ATTR_ALLOC_SINGLE_PAGES
As talked about in commit 14d3ae2efeed ("ARM: 8507/1: dma-mapping: Use DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize alloc")
media: mediatek: vcodec: Alloc DMA memory with DMA_ATTR_ALLOC_SINGLE_PAGES
As talked about in commit 14d3ae2efeed ("ARM: 8507/1: dma-mapping: Use DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize alloc"), it doesn't really make sense to try to allocate contiguous chunks of memory for video encoding/decoding. Let's switch the Mediatek vcodec driver to pass DMA_ATTR_ALLOC_SINGLE_PAGES and take some of the stress off the memory subsystem.
Signed-off-by: Douglas Anderson <dianders@chromium.org> Tested-by: Fei Shao <fshao@chromium.org> Reviewed-by: Fei Shao <fshao@chromium.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
48d85de2 | 12-Apr-2024 |
Yunfei Dong <yunfei.dong@mediatek.com> |
media: mediatek: vcodec: Fix unreasonable data conversion
Both 'bs_dma' and 'dma_addr' are integers. No need to convert the type from dma_addr_t to uint64_t again.
Fixes: d353c3c34af0 ("media: medi
media: mediatek: vcodec: Fix unreasonable data conversion
Both 'bs_dma' and 'dma_addr' are integers. No need to convert the type from dma_addr_t to uint64_t again.
Fixes: d353c3c34af0 ("media: mediatek: vcodec: support 36 bits physical address")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
59d438f8 | 21-Mar-2024 |
Irui Wang <irui.wang@mediatek.com> |
media: mediatek: vcodec: Handle invalid decoder vsi
Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.
Fixes: 590577a4e525 ("[media] vcodec: mediatek:
media: mediatek: vcodec: Handle invalid decoder vsi
Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.
Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
Signed-off-by: Irui Wang <irui.wang@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
c28d4921 | 28-Dec-2023 |
Eugen Hristev <eugen.hristev@collabora.com> |
media: mediatek: vcodec: fix possible unbalanced PM counter
It is possible that mtk_vcodec_enc_pw_on fails, and in that scenario the PM counter is not incremented, and subsequent call to mtk_vcodec_
media: mediatek: vcodec: fix possible unbalanced PM counter
It is possible that mtk_vcodec_enc_pw_on fails, and in that scenario the PM counter is not incremented, and subsequent call to mtk_vcodec_enc_pw_off decrements the counter, leading to a PM imbalance. Fix by bailing out of venc_if_encode in the case when mtk_vcodec_enc_pw_on fails.
Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver") Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|