[PATCH v7 11/28] media: mediatek: vcodec: initialize msg and vsi information

2024-07-20 Thread Yunfei Dong
Initialize the msg and vsi information before send to optee, then calling tee invoke command to send. For the optee communication interface is different with scp, adding condition to separate them. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_drv.h | 2

[PATCH v7 23/28] media: mediatek: vcodec: support av1 svp decoder for mt8188

2024-07-20 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 | 104

[PATCH v7 02/28] v4l2: handle restricted memory flags in queue setup

2024-07-20 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 [Yunfei: Change reviewer's comments] --- .../media/common/videobuf2/videobuf2-core.c

[PATCH v7 24/28] media: mediatek: vcodec: support vp9 svp decoder for mt8188

2024-07-20 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 [Yunfei: Fix the checkpatch warning] --- .../vcodec/decoder/vdec

[PATCH v7 01/28] v4l2: add restricted memory flags

2024-07-20 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 [Yunfei: Change reviewer's comments] --- Documentation/userspace-api/media/v4l/buffe

[PATCH v7 25/28] media: mediatek: vcodec: remove vsi data from common interface

2024-07-20 Thread Yunfei Dong
Remove vsi related data from common interface to be compatible with the extend vsi with secure video playback change. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_h264_req_multi_if.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH v7 15/28] media: mediatek: vcodec: support single allocation format

2024-07-20 Thread Yunfei Dong
Changing driver to support single allocation format V4L2_PIX_FMT_MS21. Signed-off-by: Yunfei Dong --- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c| 4 +++- .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c | 9 - 2 files changed, 11 insertions(+), 2 deletions

[PATCH v7 04/28] dma-buf: heaps: Deduplicate docs and adopt common format

2024-07-20 Thread Yunfei Dong
Remove 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 v7 27/28] media: mediatek: vcodec: adding non extend struct

2024-07-20 Thread Yunfei Dong
Adding non extend struct to support two different architecture. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_h264_req_multi_if.c | 76 ++- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec

[PATCH v7 28/28] media: mediatek: vcodec: support extend h264 driver

2024-07-20 Thread Yunfei Dong
Rename the extend interface with _ex and sync the non extend driver. Adding capability to separate extend and non extend driver. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/mtk_vcodec_dec_drv.h | 2 + .../decoder/vdec/vdec_h264_req_multi_if.c | 382 +- 2 files

[PATCH v7 26/28] media: mediatek: vcodec: rename vsi to extend vsi

2024-07-20 Thread Yunfei Dong
rename vsi to extend vsi struct for adding some extend param to support secure video playback. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_h264_req_multi_if.c | 174 +- 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/drivers/media/platform/mediatek

[PATCH v7 22/28] media: mediatek: vcodec: support hevc svp for mt8188

2024-07-20 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 | 88 +++ 1 file changed, 53 insertions(+), 35

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

2024-07-20 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 | 141 +++--- 1 file changed, 91 insertions(+), 50 deletions(-) diff

[PATCH v7 17/28] media: mediatek: vcodec: re-construct h264 driver to support svp mode

2024-07-20 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 v7 19/28] media: mediatek: vcodec: disable wait interrupt for svp mode

2024-07-20 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 v7 20/28] media: mediatek: vcodec: support tee decoder

2024-07-20 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 v7 18/28] media: mediatek: vcodec: remove parse nal_info in kernel

2024-07-20 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

[PATCH v7 16/28] media: mediatek: vcodec: support single allocation buffer

2024-07-20 Thread Yunfei Dong
not aligned with 64. Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 7 - .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 26 ++- .../decoder/vdec/vdec_h264_req_common.c | 18 ++--- .../mediatek/vcodec/decoder/vdec_drv_if.c

[PATCH v7 14/28] media: mediatek: vcodec: add single allocation format

2024-07-20 Thread Yunfei Dong
Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support single allocation memory. The memory consists of two plans: luma and 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

[PATCH v7 13/28] media: mediatek: vcodec: using shared memory as vsi address

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

[PATCH v7 12/28] media: mediatek: vcodec: add interface to allocate/free secure memory

2024-07-20 Thread Yunfei Dong
Calling 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 | 117 +- .../mediatek/vcodec/common/mtk_vcodec_util.h | 8

[PATCH v7 10/28] media: mediatek: vcodec: send share memory data to optee

2024-07-20 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 | 156 +- .../vcodec/decoder/mtk_vcodec_dec_optee.h | 74 + 2 files changed, 226

[PATCH v7 09/28] media: mediatek: vcodec: allocate tee share memory

2024-07-20 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 v7 07/28] media: mediatek: vcodec: add tee client interface to communiate with optee-os

2024-07-20 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 v7 08/28] media: mediatek: vcodec: build decoder OPTEE driver as module

2024-07-20 Thread Yunfei Dong
The tee_* function make the driver depends on the TEE driver, isolate the decoder OPTEE client into a separate module, and make it depends on CONFIG_TEE. The driver can open/close the TEE driver dynamically. Signed-off-by: Yunfei Dong --- .../media/platform/mediatek/vcodec/Kconfig| 12

[PATCH v7 05/28] dma-heap: Add proper kref handling on dma-buf heaps

2024-07-20 Thread Yunfei Dong
rcier Signed-off-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] Signed-off-by: Yunfei Dong [Yunfei: Change reviewer's comments] --- drivers/dma-buf/dma-heap.c | 29 + include/linux/dma-heap.h | 2 ++ 2 files changed, 31 insertion

[PATCH v7 06/28] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2024-07-20 Thread Yunfei Dong
rning] 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 1

[PATCH v7 03/28] media: videobuf2: calculate restricted memory size

2024-07-20 Thread Yunfei Dong
Getting the physical address with sg_dma_address for restricted memory, only return the first physical address size since sg may not be physical continuous, then leading to the dmabuf size is small than buf size. Need to bypass continuous checking for restricted memory. Signed-off-by: Yunfei Dong

[PATCH v7 00/28] media: mediatek: add driver to support secure video decoder

2024-07-20 Thread Yunfei Dong
oper 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 Xiaoyong Lu (1): media: mediatek: vcodec: support av1 svp decoder for mt8188

[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

[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
rning] 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 1

[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
d-off-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/d

[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
Remove 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
: 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 Xiaoyong Lu (1): media: mediatek: vcodec: support av1 svp decoder for mt8188

[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

[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
rning] 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 1

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

2024-04-12 Thread Yunfei Dong
Remove 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
d-off-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/d

[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
ohn 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 Xiaoyong Lu (1): WIP: media: mediatek: v

[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

[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
d-off-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/d

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

2024-01-28 Thread Yunfei Dong
in queue setup v4l2: verify restricted dmabufs are used in restricted queue v4l: add documentation for restricted 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 hea

[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
rning] 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 1

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

2024-01-28 Thread Yunfei Dong
Remove 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

  1   2   3   4   5   6   >