The frmsize structure was left initialize to 0, as side effect, the driver was reporting an invalid frmsize. Size: Stepwise 0x0 - 0x0 with step 0/0 Fix this by replicating the constraints in the raw formats too. This fixes taking picture in Gnome Cheese Software, or any software using GSteamer encodebin feature. Fixes: 775fec69008d30 ("media: add Rockchip VPU JPEG encoder driver") Reported-by: Robert Mader <robert.mader@xxxxxxxxxxxxx> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx> --- .../platform/verisilicon/rockchip_vpu_hw.c | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c index 8de6fd2e8eefa..7e65b5c3aa03c 100644 --- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c +++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c @@ -21,40 +21,46 @@ * Supported formats. */ +#define ROCKCHIP_VPU_JPEG_ENC_FRMSIZE {\ + .min_width = 96, \ + .max_width = 8192,\ + .step_width = MB_DIM, \ + .min_height = 32, \ + .max_height = 8192,\ + .step_height = MB_DIM, \ + } + static const struct hantro_fmt rockchip_vpu_enc_fmts[] = { { .fourcc = V4L2_PIX_FMT_YUV420M, .codec_mode = HANTRO_MODE_NONE, .enc_fmt = ROCKCHIP_VPU_ENC_FMT_YUV420P, + .frmsize = ROCKCHIP_VPU_JPEG_ENC_FRMSIZE, }, { .fourcc = V4L2_PIX_FMT_NV12M, .codec_mode = HANTRO_MODE_NONE, .enc_fmt = ROCKCHIP_VPU_ENC_FMT_YUV420SP, + .frmsize = ROCKCHIP_VPU_JPEG_ENC_FRMSIZE, }, { .fourcc = V4L2_PIX_FMT_YUYV, .codec_mode = HANTRO_MODE_NONE, .enc_fmt = ROCKCHIP_VPU_ENC_FMT_YUYV422, + .frmsize = ROCKCHIP_VPU_JPEG_ENC_FRMSIZE, }, { .fourcc = V4L2_PIX_FMT_UYVY, .codec_mode = HANTRO_MODE_NONE, .enc_fmt = ROCKCHIP_VPU_ENC_FMT_UYVY422, + .frmsize = ROCKCHIP_VPU_JPEG_ENC_FRMSIZE, }, { .fourcc = V4L2_PIX_FMT_JPEG, .codec_mode = HANTRO_MODE_JPEG_ENC, .max_depth = 2, .header_size = JPEG_HEADER_SIZE, - .frmsize = { - .min_width = 96, - .max_width = 8192, - .step_width = MB_DIM, - .min_height = 32, - .max_height = 8192, - .step_height = MB_DIM, - }, + .frmsize = ROCKCHIP_VPU_JPEG_ENC_FRMSIZE, }, }; -- 2.38.1