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

hantro: Remove incorrect HEVC SPS validation

Currently, the driver tries to validat the HEVC SPS
against the CAPTURE queue format (i.e. the decoded format).
This is not correct, because typically the SPS control is set
before the CAPTURE queue is negotiated.

Fixes: 135ad96cb4d6b ("media: hantro: Be more accurate on pixel formats step_width constraints")
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Ezequiel Garcia and committed by
Mauro Carvalho Chehab
df9ec2fc 143201a6

+7 -15
+6 -6
drivers/staging/media/hantro/hantro_drv.c
··· 251 251 252 252 static int hantro_try_ctrl(struct v4l2_ctrl *ctrl) 253 253 { 254 - struct hantro_ctx *ctx; 255 - 256 - ctx = container_of(ctrl->handler, 257 - struct hantro_ctx, ctrl_handler); 258 - 259 254 if (ctrl->id == V4L2_CID_STATELESS_H264_SPS) { 260 255 const struct v4l2_ctrl_h264_sps *sps = ctrl->p_new.p_h264_sps; 261 256 ··· 266 271 } else if (ctrl->id == V4L2_CID_STATELESS_HEVC_SPS) { 267 272 const struct v4l2_ctrl_hevc_sps *sps = ctrl->p_new.p_hevc_sps; 268 273 269 - return hantro_hevc_validate_sps(ctx, sps); 274 + if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8) 275 + /* Luma and chroma bit depth mismatch */ 276 + return -EINVAL; 277 + if (sps->bit_depth_luma_minus8 != 0) 278 + /* Only 8-bit is supported */ 279 + return -EINVAL; 270 280 } else if (ctrl->id == V4L2_CID_STATELESS_VP9_FRAME) { 271 281 const struct v4l2_ctrl_vp9_frame *dec_params = ctrl->p_new.p_vp9_frame; 272 282
+1 -8
drivers/staging/media/hantro/hantro_hevc.c
··· 154 154 return -ENOMEM; 155 155 } 156 156 157 - int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc_sps *sps) 157 + static int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc_sps *sps) 158 158 { 159 - if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8) 160 - /* Luma and chroma bit depth mismatch */ 161 - return -EINVAL; 162 - if (sps->bit_depth_luma_minus8 != 0) 163 - /* Only 8-bit is supported */ 164 - return -EINVAL; 165 - 166 159 /* 167 160 * for tile pixel format check if the width and height match 168 161 * hardware constraints
-1
drivers/staging/media/hantro/hantro_hw.h
··· 360 360 void hantro_hevc_ref_init(struct hantro_ctx *ctx); 361 361 dma_addr_t hantro_hevc_get_ref_buf(struct hantro_ctx *ctx, s32 poc); 362 362 int hantro_hevc_add_ref_buf(struct hantro_ctx *ctx, int poc, dma_addr_t addr); 363 - int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc_sps *sps); 364 363 365 364 366 365 static inline unsigned short hantro_vp9_num_sbs(unsigned short dimension)