[PATCH v6, 17/24] media: mediatek: vcodec: re-construct h264 driver to support svp mode

2024-05-16 Thread Yunfei Dong
Need secure buffer size to convert secure handle to secure pa in optee-os, re-construct the vsi struct to store each secure buffer size. Separate svp and normal wait interrupt condition for svp mode waiting hardware interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec

[PATCH v6, 11/24] media: mediatek: vcodec: initialize msg and vsi information

2024-05-16 Thread Yunfei Dong
Need to initialize msg and vsi information before sending to optee-os, then calling optee invoke command to send the information to optee-os. For the optee communication interface is different with scp, using flag to separate them. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v6, 18/24] media: mediatek: vcodec: remove parse nal_info in kernel

2024-05-16 Thread Yunfei Dong
The hardware can parse syntax to get nal_info, needn't to use cpu. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c| 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec

[PATCH v6,09/24] media: mediatek: vcodec: allocate tee share memory

2024-05-16 Thread Yunfei Dong
Allocate two share memory for each lat and core hardware used to share information with optee-os. Msg buffer used to send ipi command and get ack command with optee-os, data buffer used to store vsi information which used for hardware decode. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v6, 23/24] media: mediatek: vcodec: support av1 svp decoder for mt8188

2024-05-16 Thread Yunfei Dong
From: Xiaoyong Lu Change av1 driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Xiaoyong Lu Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 97

[PATCH v6,15/24] media: mediatek: vcodec: Add one plane format

2024-05-16 Thread Yunfei Dong
Adding capture formats to support V4L2_PIX_FMT_MS21. This format has one plane and only be used for secure video playback at current period. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c| 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c

[PATCH v6,20/24] media: mediatek: vcodec: support tee decoder

2024-05-16 Thread Yunfei Dong
Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media

[PATCH v6, 21/24] media: mediatek: vcodec: move vdec init interface to setup callback

2024-05-16 Thread Yunfei Dong
Getting secure video playback (svp) flag when request output buffer, then calling init interface to init svp parameters in optee-os. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 139 +++--- 1 file changed, 89 insertions(+), 50 deletions(-) diff

[PATCH v6, 22/24] media: mediatek: vcodec: support hevc svp for mt8188

2024-05-16 Thread Yunfei Dong
Change hevc driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_hevc_req_multi_if.c | 89 +++ 1 file changed, 54 insertions(+), 35

[PATCH v6, 13/24] media: mediatek: vcodec: using shared memory as vsi address

2024-05-16 Thread Yunfei Dong
The vsi buffer is allocated by tee share memory for svp mode, need to use the share memory as the vsi address to store vsi data. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 9 +++-- .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 8

[PATCH v6, 14/24] media: mediatek: vcodec: Add capture format to support one plane memory

2024-05-16 Thread Yunfei Dong
Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support one plane memory. The buffer size is luma + chroma, luma is stored at the start and chrome is stored at the end. Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8

[PATCH v6, 24/24] media: mediatek: vcodec: support vp9 svp decoder for mt8188

2024-05-16 Thread Yunfei Dong
From: Yilong Zhou Change vp9 driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Yilong Zhou Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 91

[PATCH v6, 19/24] media: mediatek: vcodec: disable wait interrupt for svp mode

2024-05-16 Thread Yunfei Dong
Waiting interrupt in optee-os for svp mode, need to disable it in kernel in case of interrupt is cleaned. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_hw.c| 34 +-- .../vcodec/decoder/mtk_vcodec_dec_pm.c| 6 +- .../decoder/vdec

[PATCH v6, 16/24] media: mediatek: vcodec: support one plane capture buffer

2024-05-16 Thread Yunfei Dong
The capture buffer has two planes for format MM21, but user space only allocate secure memory for plane[0], and the size is Y data + uv data. The driver need to support one plane decoder for svp mode. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 7

[PATCH v6, 10/24] media: mediatek: vcodec: send share memory data to optee

2024-05-16 Thread Yunfei Dong
Setting msg and vsi information to shared buffer, then call tee invoke function to send it to optee-os. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_optee.c | 140 ++ .../vcodec/decoder/mtk_vcodec_dec_optee.h | 51 +++ 2 files changed, 191

[PATCH v6, 12/24] media: mediatek: vcodec: add interface to allocate/free secure memory

2024-05-16 Thread Yunfei Dong
Need to call dma heap interface to allocate/free secure memory when playing secure video. Signed-off-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/Kconfig| 1 + .../mediatek/vcodec/common/mtk_vcodec_util.c | 122 +- .../mediatek/vcodec/common/mtk_vcodec_util.h

[PATCH v6, 07/24] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2024-05-16 Thread Yunfei Dong
] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 83 ++ include/linux/dma-heap.h | 6 +++ 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 97025ee8500f..6efe833a4b10 100644

[PATCH v6, 08/24] media: mediatek: vcodec: add tee client interface to communiate with optee-os

2024-05-16 Thread Yunfei Dong
Open tee context to initialize the environment in order to communication with optee-os, then open tee session as the communication pipeline for lat and core to send data for hardware decode. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/Makefile | 1 + .../vcodec/decoder

[PATCH v6,06/24] dma-heap: Add proper kref handling on dma-buf heaps

2024-05-16 Thread Yunfei Dong
-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 29 + include/linux/dma-heap.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/driver

[PATCH v6,02/24] v4l2: handle restricted memory flags in queue setup

2024-05-16 Thread Yunfei Dong
From: Jeffrey Kardatzke Validates the restricted memory flags when setting up a queue and ensures the queue has the proper capability. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- .../media/common/videobuf2/videobuf2-core.c | 21 +++ .../media/common

[PATCH v6, 03/24] v4l2: verify restricted dmabufs are used in restricted queue

2024-05-16 Thread Yunfei Dong
From: Jeffrey Kardatzke Verfies in the dmabuf implementations that if the restricted memory flag is set for a queue that the dmabuf submitted to the queue is unmappable. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8

[PATCH v6,04/24] v4l: add documentation for restricted memory flag

2024-05-16 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds documentation for V4L2_MEMORY_FLAG_RESTRICTED. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/buffer.rst | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace

[PATCH v6, 05/24] dma-buf: heaps: Deduplicate docs and adopt common format

2024-05-16 Thread Yunfei Dong
e multiple unused includes and alphabetize. Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add a comment for "priv" to mute build warning] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 27 +++ include/linux/dma-heap.h | 21 +-

[PATCH v6,01/24] v4l2: add restricted memory flags

2024-05-16 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds a V4L2 flag which indicates that a queue is using restricted dmabufs and the corresponding capability flag. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- include/media/videobuf2-core.h | 8 +++- include/uapi/linux/videodev2.h | 2 ++ 2 files

[PATCH v6, 00/24] media: mediatek: add driver to support secure video decoder

2024-05-16 Thread Yunfei Dong
buf: heaps: Deduplicate docs and adopt common format Xiaoyong Lu (1): media: mediatek: vcodec: support av1 svp decoder for mt8188 Yilong Zhou (1): media: mediatek: vcodec: support vp9 svp decoder for mt8188 Yunfei Dong (15): media: mediatek: vcodec: add tee client interface to communiate with

[PATCH v5, 18/23] media: mediatek: vcodec: remove parse nal_info in kernel

2024-04-12 Thread Yunfei Dong
The hardware can parse syntax to get nal_info, needn't to use cpu. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c| 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec

[PATCH v5, 19/23] media: mediatek: vcodec: disable wait interrupt for svp mode

2024-04-12 Thread Yunfei Dong
Waiting interrupt in optee-os for svp mode, need to disable it in kernel in case of interrupt is cleaned. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_hw.c| 34 +-- .../vcodec/decoder/mtk_vcodec_dec_pm.c| 6 +- .../decoder/vdec

[PATCH v5, 21/23] media: mediatek: vcodec: move vdec init interface to setup callback

2024-04-12 Thread Yunfei Dong
Getting secure video playback (svp) flag when request output buffer, then calling init interface to init svp parameters in optee-os. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 139 +++--- 1 file changed, 89 insertions(+), 50 deletions(-) diff

[PATCH v5, 11/23] media: mediatek: vcodec: initialize msg and vsi information

2024-04-12 Thread Yunfei Dong
Need to initialize msg and vsi information before sending to optee-os, then calling optee invoke command to send the information to optee-os. For the optee communication interface is different with scp, using flag to separate them. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v5, 16/23] media: mediatek: vcodec: support one plane capture buffer

2024-04-12 Thread Yunfei Dong
The capture buffer has two planes for format MM21, but user space only allocate secure memory for plane[0], and the size is Y data + uv data. The driver need to support one plane decoder for svp mode. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 7

[PATCH v5,20/23] media: mediatek: vcodec: support tee decoder

2024-04-12 Thread Yunfei Dong
Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media

[PATCH v5, 23/23] WIP: media: mediatek: vcodec: support av1 svp decoder for mt8188

2024-04-12 Thread Yunfei Dong
From: Xiaoyong Lu Change av1 driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Xiaoyong Lu Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 97

[PATCH v5, 22/23] media: mediatek: vcodec: support hevc svp for mt8188

2024-04-12 Thread Yunfei Dong
Change hevc driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_hevc_req_multi_if.c | 89 +++ 1 file changed, 54 insertions(+), 35

[PATCH v5, 12/23] media: mediatek: vcodec: add interface to allocate/free secure memory

2024-04-12 Thread Yunfei Dong
Need to call dma heap interface to allocate/free secure memory when playing secure video. Signed-off-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/Kconfig| 1 + .../mediatek/vcodec/common/mtk_vcodec_util.c | 122 +- .../mediatek/vcodec/common/mtk_vcodec_util.h

[PATCH v5, 17/23] media: mediatek: vcodec: re-construct h264 driver to support svp mode

2024-04-12 Thread Yunfei Dong
Need secure buffer size to convert secure handle to secure pa in optee-os, re-construct the vsi struct to store each secure buffer size. Separate svp and normal wait interrupt condition for svp mode waiting hardware interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec

[PATCH v5,15/23] media: mediatek: vcodec: Add one plane format

2024-04-12 Thread Yunfei Dong
Adding capture formats to support V4L2_PIX_FMT_MS21. This format has one plane and only be used for secure video playback at current period. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c| 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c

[PATCH v5, 10/23] media: mediatek: vcodec: send share memory data to optee

2024-04-12 Thread Yunfei Dong
Setting msg and vsi information to shared buffer, then call tee invoke function to send it to optee-os. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_optee.c | 140 ++ .../vcodec/decoder/mtk_vcodec_dec_optee.h | 51 +++ 2 files changed, 191

[PATCH v5, 13/23] media: mediatek: vcodec: using shared memory as vsi address

2024-04-12 Thread Yunfei Dong
The vsi buffer is allocated by tee share memory for svp mode, need to use the share memory as the vsi address to store vsi data. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 9 +++-- .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 8

[PATCH v5, 14/23] media: mediatek: vcodec: Add capture format to support one plane memory

2024-04-12 Thread Yunfei Dong
Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support one plane memory. The buffer size is luma + chroma, luma is stored at the start and chrome is stored at the end. Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8

[PATCH v5, 08/23] media: mediatek: vcodec: add tee client interface to communiate with optee-os

2024-04-12 Thread Yunfei Dong
Open tee context to initialize the environment in order to communication with optee-os, then open tee session as the communication pipeline for lat and core to send data for hardware decode. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/Makefile | 1 + .../vcodec/decoder

[PATCH v5,09/23] media: mediatek: vcodec: allocate tee share memory

2024-04-12 Thread Yunfei Dong
Allocate two share memory for each lat and core hardware used to share information with optee-os. Msg buffer used to send ipi command and get ack command with optee-os, data buffer used to store vsi information which used for hardware decode. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v5, 07/23] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2024-04-12 Thread Yunfei Dong
] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 83 ++ include/linux/dma-heap.h | 6 +++ 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 97025ee8500f..6efe833a4b10 100644

[PATCH v5, 05/23] dma-buf: heaps: Deduplicate docs and adopt common format

2024-04-12 Thread Yunfei Dong
e multiple unused includes and alphabetize. Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add a comment for "priv" to mute build warning] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 27 +++ include/linux/dma-heap.h | 21 +-

[PATCH v5,06/23] dma-heap: Add proper kref handling on dma-buf heaps

2024-04-12 Thread Yunfei Dong
-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 29 + include/linux/dma-heap.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/driver

[PATCH v5,04/23] v4l: add documentation for restricted memory flag

2024-04-12 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds documentation for V4L2_MEMORY_FLAG_RESTRICTED. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/buffer.rst | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace

[PATCH v5, 03/23] v4l2: verify restricted dmabufs are used in restricted queue

2024-04-12 Thread Yunfei Dong
From: Jeffrey Kardatzke Verfies in the dmabuf implementations that if the restricted memory flag is set for a queue that the dmabuf submitted to the queue is unmappable. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8

[PATCH v5,01/23] v4l2: add restricted memory flags

2024-04-12 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds a V4L2 flag which indicates that a queue is using restricted dmabufs and the corresponding capability flag. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- include/media/videobuf2-core.h | 8 +++- include/uapi/linux/videodev2.h | 2 ++ 2 files

[PATCH v5,02/23] v4l2: handle restricted memory flags in queue setup

2024-04-12 Thread Yunfei Dong
From: Jeffrey Kardatzke Validates the restricted memory flags when setting up a queue and ensures the queue has the proper capability. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- .../media/common/videobuf2/videobuf2-core.c | 21 +++ .../media/common

[PATCH v5,00/22] media: add driver to support secure video decoder

2024-04-12 Thread Yunfei Dong
T.J. Mercier (1): dma-buf: heaps: Deduplicate docs and adopt common format Xiaoyong Lu (1): WIP: media: mediatek: vcodec: support av1 svp decoder for mt8188 Yunfei Dong (15): media: mediatek: vcodec: add tee client interface to communiate with optee-os media: mediatek: vcodec

[PATCH v4, 21/22] media: mediatek: vcodec: move vdec init interface to setup callback

2024-01-28 Thread Yunfei Dong
Getting secure video playback (svp) flag when request output buffer, then calling init interface to init svp parameters in optee-os. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 139 +++--- 1 file changed, 89 insertions(+), 50 deletions(-) diff

[PATCH v4, 17/22] media: mediatek: vcodec: re-construct h264 driver to support svp mode

2024-01-28 Thread Yunfei Dong
Need secure buffer size to convert secure handle to secure pa in optee-os, re-construct the vsi struct to store each secure buffer size. Separate svp and normal wait interrupt condition for svp mode waiting hardware interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec

[PATCH v4, 16/22] media: mediatek: vcodec: support one plane capture buffer

2024-01-28 Thread Yunfei Dong
The capture buffer has two planes for format MM21, but user space only allocate secure memory for plane[0], and the size is Y data + uv data. The driver need to support one plane decoder for svp mode. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 7

[PATCH v4,09/22] media: mediatek: vcodec: allocate tee share memory

2024-01-28 Thread Yunfei Dong
Allocate two share memory for each lat and core hardware used to share information with optee-os. Msg buffer used to send ipi command and get ack command with optee-os, data buffer used to store vsi information which used for hardware decode. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v4, 13/22] media: mediatek: vcodec: using shared memory as vsi address

2024-01-28 Thread Yunfei Dong
The vsi buffer is allocated by tee share memory for svp mode, need to use the share memory as the vsi address to store vsi data. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 9 +++-- .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 8

[PATCH v4, 19/22] media: mediatek: vcodec: disable wait interrupt for svp mode

2024-01-28 Thread Yunfei Dong
Waiting interrupt in optee-os for svp mode, need to disable it in kernel in case of interrupt is cleaned. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_hw.c| 34 +-- .../vcodec/decoder/mtk_vcodec_dec_pm.c| 6 +- .../decoder/vdec

[PATCH v4,20/22] media: mediatek: vcodec: support tee decoder

2024-01-28 Thread Yunfei Dong
Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media

[PATCH v4, 22/22] media: mediatek: vcodec: support hevc svp for mt8188

2024-01-28 Thread Yunfei Dong
Change hevc driver to support secure video playback(svp) for mt8188. Need to map shared memory with optee interface and wait interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_hevc_req_multi_if.c | 89 +++ 1 file changed, 54 insertions(+), 35

[PATCH v4, 08/22] media: mediatek: vcodec: add tee client interface to communiate with optee-os

2024-01-28 Thread Yunfei Dong
Open tee context to initialize the environment in order to communication with optee-os, then open tee session as the communication pipeline for lat and core to send data for hardware decode. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/Makefile | 1 + .../vcodec/decoder

[PATCH v4, 18/22] media: mediatek: vcodec: remove parse nal_info in kernel

2024-01-28 Thread Yunfei Dong
The hardware can parse syntax to get nal_info, needn't to use cpu. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c| 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec

[PATCH v4, 14/22] media: mediatek: vcodec: Add capture format to support one plane memory

2024-01-28 Thread Yunfei Dong
Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support one plane memory. The buffer size is luma + chroma, luma is stored at the start and chrome is stored at the end. Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8

[PATCH v4,15/22] media: mediatek: vcodec: Add one plane format

2024-01-28 Thread Yunfei Dong
Adding capture formats to support V4L2_PIX_FMT_MS21. This format has one plane and only be used for secure video playback at current period. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c| 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c

[PATCH v4, 10/22] media: mediatek: vcodec: send share memory data to optee

2024-01-28 Thread Yunfei Dong
Setting msg and vsi information to shared buffer, then call tee invoke function to send it to optee-os. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_optee.c | 140 ++ .../vcodec/decoder/mtk_vcodec_dec_optee.h | 51 +++ 2 files changed, 191

[PATCH v4, 12/22] media: mediatek: vcodec: add interface to allocate/free secure memory

2024-01-28 Thread Yunfei Dong
Need to call dma heap interface to allocate/free secure memory when playing secure video. Signed-off-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/Kconfig| 1 + .../mediatek/vcodec/common/mtk_vcodec_util.c | 122 +- .../mediatek/vcodec/common/mtk_vcodec_util.h

[PATCH v4, 03/22] v4l2: verify restricted dmabufs are used in restricted queue

2024-01-28 Thread Yunfei Dong
From: Jeffrey Kardatzke Verfies in the dmabuf implementations that if the restricted memory flag is set for a queue that the dmabuf submitted to the queue is unmappable. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8

[PATCH v4, 11/22] media: mediatek: vcodec: initialize msg and vsi information

2024-01-28 Thread Yunfei Dong
Need to initialize msg and vsi information before sending to optee-os, then calling optee invoke command to send the information to optee-os. For the optee communication interface is different with scp, using flag to separate them. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v4,04/22] v4l: add documentation for restricted memory flag

2024-01-28 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds documentation for V4L2_MEMORY_FLAG_RESTRICTED. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/buffer.rst | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace

[PATCH v4,06/22] dma-heap: Add proper kref handling on dma-buf heaps

2024-01-28 Thread Yunfei Dong
-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 29 + include/linux/dma-heap.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/driver

[PATCH v4,00/22] media: add driver to support secure video decoder

2024-01-28 Thread Yunfei Dong
kref handling on dma-buf heaps dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps T.J. Mercier (1): dma-buf: heaps: Deduplicate docs and adopt common format Yunfei Dong (15): media: mediatek: vcodec: add tee client interface to communiate

[PATCH v4, 07/22] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2024-01-28 Thread Yunfei Dong
] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 83 ++ include/linux/dma-heap.h | 6 +++ 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 97025ee8500f..6efe833a4b10 100644

[PATCH v4, 05/22] dma-buf: heaps: Deduplicate docs and adopt common format

2024-01-28 Thread Yunfei Dong
e multiple unused includes and alphabetize. Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add a comment for "priv" to mute build warning] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 27 +++ include/linux/dma-heap.h | 21 +-

[PATCH v4,01/22] v4l2: add restricted memory flags

2024-01-28 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds a V4L2 flag which indicates that a queue is using restricted dmabufs and the corresponding capability flag. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- include/media/videobuf2-core.h | 8 +++- include/uapi/linux/videodev2.h | 2 ++ 2 files

[PATCH v4,02/22] v4l2: handle restricted memory flags in queue setup

2024-01-28 Thread Yunfei Dong
From: Jeffrey Kardatzke Validates the restricted memory flags when setting up a queue and ensures the queue has the proper capability. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- .../media/common/videobuf2/videobuf2-core.c | 21 +++ .../media/common

[PATCH v3,20/21] media: medkatek: vcodec: support tee decoder

2023-12-06 Thread Yunfei Dong
Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media

[PATCH v3, 10/21] media: mediatek: vcodec: send share memory data to optee

2023-12-06 Thread Yunfei Dong
Setting msg and vsi information to shared buffer, then call tee invoke function to send it to optee-os. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_optee.c | 140 ++ .../vcodec/decoder/mtk_vcodec_dec_optee.h | 51 +++ 2 files changed, 191

[PATCH v3, 19/21] media: medkatek: vcodec: disable wait interrupt for svp mode

2023-12-06 Thread Yunfei Dong
Waiting interrupt in optee-os for svp mode, need to disable it in kernel in case of interrupt is cleaned. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_hw.c| 34 +-- .../vcodec/decoder/mtk_vcodec_dec_pm.c| 6 +- .../decoder/vdec

[PATCH v3, 21/21] media: mediatek: vcodec: move vdec init interface to setup callback

2023-12-06 Thread Yunfei Dong
Getting secure video playback (svp) flag when request output buffer, then calling init interface to init svp parameters in optee-os. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 144 -- 1 file changed, 94 insertions(+), 50 deletions(-) diff

[PATCH v3,15/21] media: mediatek: vcodec: Add one plane format

2023-12-06 Thread Yunfei Dong
Adding capture formats to support V4L2_PIX_FMT_MS21. This format has one plane and only be used for secure video playback at current period. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c| 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c

[PATCH v3, 18/21] media: medkatek: vcodec: remove parse nal_info in kernel

2023-12-06 Thread Yunfei Dong
The hardware can parse syntax to get nal_info, needn't to use cpu. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c| 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec

[PATCH v3, 12/21] media: mediatek: vcodec: add interface to allocate/free secure memory

2023-12-06 Thread Yunfei Dong
Need to call dma heap interface to allocate/free secure memory when playing secure video. Signed-off-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/Kconfig| 1 + .../mediatek/vcodec/common/mtk_vcodec_util.c | 122 +- .../mediatek/vcodec/common/mtk_vcodec_util.h

[PATCH v3, 17/21] media: medkatek: vcodec: re-construct h264 driver to support svp mode

2023-12-06 Thread Yunfei Dong
Need secure buffer size to convert secure handle to secure pa in optee-os, re-construct the vsi struct to store each secure buffer size. Separate svp and normal wait interrupt condition for svp mode waiting hardware interrupt in optee-os. Signed-off-by: Yunfei Dong --- .../decoder/vdec

[PATCH v3, 16/21] media: medkatek: vcodec: support one plane capture buffer

2023-12-06 Thread Yunfei Dong
The capture buffer has two planes for format MM21, but user space only allocate secure memory for plane[0], and the size is Y data + uv data. The driver need to support one plane decoder for svp mode. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 7

[PATCH v3, 05/21] dma-buf: heaps: Deduplicate docs and adopt common format

2023-12-06 Thread Yunfei Dong
e multiple unused includes and alphabetize. Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add a comment for "priv" to mute build warning] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 27 +++ include/linux/dma-heap.h | 21 +-

[PATCH v3, 13/21] media: mediatek: vcodec: using shared memory as vsi address

2023-12-06 Thread Yunfei Dong
The vsi buffer is allocated by tee share memory for svp mode, need to use the share memory as the vsi address to store vsi data. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 9 +++-- .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 8

[PATCH v3, 11/21] media: mediatek: vcodec: initialize msg and vsi information

2023-12-06 Thread Yunfei Dong
Need to initialize msg and vsi information before sending to optee-os, then calling optee invoke command to send the information to optee-os. For the optee communication interface is different with scp, using flag to separate them. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v3, 14/21] media: mediatek: vcodec: Add capture format to support one plane memory

2023-12-06 Thread Yunfei Dong
Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support one plane memory. The buffer size is luma + chroma, luma is stored at the start and chrome is stored at the end. Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8

[PATCH v3, 08/21] media: mediatek: vcodec: add tee client interface to communiate with optee-os

2023-12-06 Thread Yunfei Dong
Open tee context to initialize the environment in order to communication with optee-os, then open tee session as the communication pipeline for lat and core to send data for hardware decode. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/Makefile | 1 + .../vcodec/decoder

[PATCH v3,09/21] media: mediatek: vcodec: allocate tee share memory

2023-12-06 Thread Yunfei Dong
Allocate two share memory for each lat and core hardware used to share information with optee-os. Msg buffer used to send ipi command and get ack command with optee-os, data buffer used to store vsi information which used for hardware decode. Signed-off-by: Yunfei Dong --- .../vcodec/decoder

[PATCH v3,06/21] dma-heap: Add proper kref handling on dma-buf heaps

2023-12-06 Thread Yunfei Dong
-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 29 + include/linux/dma-heap.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/driver

[PATCH v3, 07/21] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2023-12-06 Thread Yunfei Dong
] Signed-off-by: Yunfei Dong --- drivers/dma-buf/dma-heap.c | 83 ++ include/linux/dma-heap.h | 6 +++ 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 97025ee8500f..6efe833a4b10 100644

[PATCH v3, 03/21] v4l2: verify secure dmabufs are used in secure queue

2023-12-06 Thread Yunfei Dong
From: Jeffrey Kardatzke Verfies in the dmabuf implementations that if the secure memory flag is set for a queue that the dmabuf submitted to the queue is unmappable. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 6

[PATCH v3,04/21] v4l: add documentation for secure memory flag

2023-12-06 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds documentation for V4L2_MEMORY_FLAG_SECURE. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/buffer.rst | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api

[PATCH v3,02/21] v4l2: handle secure memory flags in queue setup

2023-12-06 Thread Yunfei Dong
From: Jeffrey Kardatzke Validates the secure memory flags when setting up a queue and ensures the queue has the proper capability. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- .../media/common/videobuf2/videobuf2-core.c | 23 + .../media/common/videobuf2

[PATCH v3,01/21] v4l2: add secure memory flags

2023-12-06 Thread Yunfei Dong
From: Jeffrey Kardatzke Adds a V4L2 flag which indicates that a queue is using secure dmabufs and the corresponding capability flag. Signed-off-by: Jeffrey Kardatzke Signed-off-by: Yunfei Dong --- include/media/videobuf2-core.h | 8 +++- include/uapi/linux/videodev2.h | 2 ++ 2 files

[PATCH v3,00/21] add driver to support secure video decoder

2023-12-06 Thread Yunfei Dong
for secure memory flag John Stultz (2): dma-heap: Add proper kref handling on dma-buf heaps dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps T.J. Mercier (1): dma-buf: heaps: Deduplicate docs and adopt common format Yunfei Dong (14

[PATCH v2, 5/7] media: mtk-vcodec: Different codec using different capture format

2022-01-27 Thread Yunfei Dong
Vp8 need to use MM21, but vp9 and h264 need to use HyFbc mode for mt8195. Vp8/vp9/h264 use the same MM21 format for mt8192. Signed-off-by: Yunfei Dong --- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 41 +++ 1 file changed, 41 insertions(+) diff --git a/drivers/media

[PATCH v2, 1/7] dt-bindings: media: mtk-vcodec: Adds decoder dt-bindings for lat soc

2022-01-27 Thread Yunfei Dong
Adds decoder dt-bindings for compatible "mediatek,mtk-vcodec-lat-soc". Signed-off-by: Yunfei Dong --- .../media/mediatek,vcodec-subdev-decoder.yaml | 49 +++ 1 file changed, 49 insertions(+) diff --git a/Documentation/devicetree/bindings/media/mediatek,vco

[PATCH v2, 7/7] media: mtk-vcodec: Add to support H264 inner racing mode

2022-01-27 Thread Yunfei Dong
In order to reduce decoder latency, enable H264 inner racing mode. Send lat trans buffer information to core when trigger lat to work, need not to wait until lat decode done. Signed-off-by: Yunfei Dong --- .../platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 4 +++ .../platform/mtk-vcodec

[PATCH v2, 0/7] support mt8195 decoder

2022-01-27 Thread Yunfei Dong
5606.19373-1-yunfei.d...@mediatek.com --- changed with v1: - separate "Init VP9 stateless decode params" patch and remove it to another one. - add reviewed-by in patch v3/v4/v6 --- Tinghan Shen (1): media: mtk-vcodec: prevent kernel crash when scp ipi timeout Yunfei Dong (6): dt-

[PATCH v2, 6/7] media: mtk-vcodec: prevent kernel crash when scp ipi timeout

2022-01-27 Thread Yunfei Dong
[67242.066292] Code: 38f96908 35003628 91004340 d343fc08 (38f96908) Signed-off-by: Tinghan Shen Signed-off-by: Yunfei Dong Reviewed-by: Macpaul Lin --- drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec

[PATCH v2, 4/7] media: mtk-vcodec: Adds compatible for mt8195

2022-01-27 Thread Yunfei Dong
Adds compatible for mt8195 platform. Signed-off-by: Yunfei Dong Reviewed-by: Macpaul Lin --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk

  1   2   3   4   5   >