Commit ba9a7dbb authored by Yunfei Dong's avatar Yunfei Dong Committed by Mauro Carvalho Chehab

media: mediatek: vcodec: record capture queue format type

The capture queue format type may be differ depending on platform: for
stateless decoder drivers, we need to calculate the capture buffer size
according to the capture queue format type in SCP.

As a preparation for introducing drivers for stateless decoding, save the
current capture queue type on a per vcodec context basis.
Signed-off-by: default avatarYunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d856b360
...@@ -464,6 +464,8 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv, ...@@ -464,6 +464,8 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv,
} }
ctx->state = MTK_STATE_INIT; ctx->state = MTK_STATE_INIT;
} }
} else {
ctx->capture_fourcc = fmt->fourcc;
} }
/* /*
......
...@@ -274,6 +274,7 @@ struct vdec_pic_info { ...@@ -274,6 +274,7 @@ struct vdec_pic_info {
* to be used with encoder and stateful decoder. * to be used with encoder and stateful decoder.
* @is_flushing: set to true if flushing is in progress. * @is_flushing: set to true if flushing is in progress.
* @current_codec: current set input codec, in V4L2 pixel format * @current_codec: current set input codec, in V4L2 pixel format
* @capture_fourcc: capture queue type in V4L2 pixel format
* *
* @colorspace: enum v4l2_colorspace; supplemental to pixelformat * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
* @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
...@@ -321,6 +322,7 @@ struct mtk_vcodec_ctx { ...@@ -321,6 +322,7 @@ struct mtk_vcodec_ctx {
bool is_flushing; bool is_flushing;
u32 current_codec; u32 current_codec;
u32 capture_fourcc;
enum v4l2_colorspace colorspace; enum v4l2_colorspace colorspace;
enum v4l2_ycbcr_encoding ycbcr_enc; enum v4l2_ycbcr_encoding ycbcr_enc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment