Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Yunfei Dong and committed by
Mauro Carvalho Chehab
ba9a7dbb d856b360

+4
+2
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
··· 464 464 } 465 465 ctx->state = MTK_STATE_INIT; 466 466 } 467 + } else { 468 + ctx->capture_fourcc = fmt->fourcc; 467 469 } 468 470 469 471 /*
+2
drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h
··· 274 274 * to be used with encoder and stateful decoder. 275 275 * @is_flushing: set to true if flushing is in progress. 276 276 * @current_codec: current set input codec, in V4L2 pixel format 277 + * @capture_fourcc: capture queue type in V4L2 pixel format 277 278 * 278 279 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat 279 280 * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding ··· 322 321 bool is_flushing; 323 322 324 323 u32 current_codec; 324 + u32 capture_fourcc; 325 325 326 326 enum v4l2_colorspace colorspace; 327 327 enum v4l2_ycbcr_encoding ycbcr_enc;