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

media: mediatek: vcodec: decoder: Drop max_{width,height} from mtk_vcodec_ctx

This partially reverts commit b018be06f3c7 ("media: mediatek: vcodec:
Read max resolution from dec_capability").

After the previous patches:

- media: mediatek: vcodec: decoder: Fix 4K frame size enumeration
- media: mediatek: vcodec: decoder: Skip alignment for default resolution
- media: mediatek: vcodec: decoder: Fix resolution clamping in TRY_FMT

the max_{width,height} fields in |struct mtk_vcodec_ctx| no longer have
any real users. Remove them.

Fixes: b018be06f3c7 ("media: mediatek: vcodec: Read max resolution from dec_capability")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Chen-Yu Tsai and committed by
Mauro Carvalho Chehab
e8d266d5 d7abd054

-13
-9
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
··· 177 177 q_data->coded_height = DFT_CFG_HEIGHT; 178 178 q_data->fmt = ctx->dev->vdec_pdata->default_cap_fmt; 179 179 q_data->field = V4L2_FIELD_NONE; 180 - ctx->max_width = MTK_VDEC_MAX_W; 181 - ctx->max_height = MTK_VDEC_MAX_H; 182 180 183 181 q_data->sizeimage[0] = q_data->coded_width * q_data->coded_height; 184 182 q_data->bytesperline[0] = q_data->coded_width; ··· 511 513 } 512 514 if (fmt == NULL) 513 515 return -EINVAL; 514 - 515 - if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED) && 516 - fmt->fourcc != V4L2_PIX_FMT_VP8_FRAME) { 517 - mtk_v4l2_debug(3, "4K is enabled"); 518 - ctx->max_width = VCODEC_DEC_4K_CODED_WIDTH; 519 - ctx->max_height = VCODEC_DEC_4K_CODED_HEIGHT; 520 - } 521 516 522 517 q_data->fmt = fmt; 523 518 vidioc_try_fmt(ctx, f, q_data->fmt);
-4
drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h
··· 286 286 * mtk_video_dec_buf. 287 287 * @hw_id: hardware index used to identify different hardware. 288 288 * 289 - * @max_width: hardware supported max width 290 - * @max_height: hardware supported max height 291 289 * @msg_queue: msg queue used to store lat buffer information. 292 290 */ 293 291 struct mtk_vcodec_ctx { ··· 332 334 struct mutex lock; 333 335 int hw_id; 334 336 335 - unsigned int max_width; 336 - unsigned int max_height; 337 337 struct vdec_msg_queue msg_queue; 338 338 }; 339 339