media: i2c: imx219: Fix a bug in imx219_enum_frame_size
PATCH 1/1 media: i2c: imx219: Fix a bug in imx219_enum_frame_size
When enumerating the frame sizes, the value sent to imx219_get_format_code should be fse->code (the code from the ioctl) and not imx219->fmt.code which is the code set currently in the driver.
--- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx219.c +1 -1
@@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd,if (fse->index >=ARRAY_SIZE (supported_modes))return -EINVAL ; -if (fse->code !=imx219_get_format_code (imx219, imx219->fmt.code)) +if (fse->code !=imx219_get_format_code (imx219, fse->code))return -EINVAL ; fse->min_width = supported_modes[fse->index].width;
Signature · 1 line
2.17.1
Quoted 6 lines · Dafna Hirschfeld
When enumerating the frame sizes, the value sent to
imx219_get_format_codeshould befse->code(the code from the ioctl) and notimx219->fmt.codewhich is the code set currently in the driver.Signed-off-by Dafna Hirschfeld <[email protected]>
Quoted 18 lines
--- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/imx219.c +1
-1@@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd,if (fse->index >=ARRAY_SIZE (supported_modes))return -EINVAL ; -if (fse->code !=imx219_get_format_code (imx219, imx219->fmt.code)) +if (fse->code !=imx219_get_format_code (imx219, fse->code))return -EINVAL ; fse->min_width = supported_modes[fse->index].width;
Hi Dafna
Thanks for the patch.
Quoted 7 lines · Dafna Hirschfeld
When enumerating the frame sizes, the value sent to
imx219_get_format_codeshould befse->code(the code from the ioctl) and notimx219->fmt.codewhich is the code set currently in the driver.Signed-off-by Dafna Hirschfeld <[email protected]>
Agreed that v4l2-ctl --list-formats-ext doesn't list the frame sizes for the mode that isn't selected without this patch. With this patch you get the full list.
Does it warrant a "Fixes: 22da1d56e ("media: i2c: imx219: Add support for RAW8 bit bayer format")"? I'd probably say yes.
Quoted 20 lines
--- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/imx219.c +1
-2@@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd,if (fse->index >=ARRAY_SIZE (supported_modes))return -EINVAL ; -if (fse->code !=imx219_get_format_code (imx219, imx219->fmt.code)) +if (fse->code !=imx219_get_format_code (imx219, fse->code))return -EINVAL ; fse->min_width = supported_modes[fse->index].width; --2.17.1
Lad, Prabhakar
Reviewed-by Lad PrabhakarQuoted 15 lines · Dave Stevenson
Hi Dafna
Thanks for the patch.
Quoted 7 lines · Dafna Hirschfeld
When enumerating the frame sizes, the value sent to
imx219_get_format_codeshould befse->code(the code from the ioctl) and notimx219->fmt.codewhich is the code set currently in the driver.Signed-off-by Dafna Hirschfeld <[email protected]>
Quoted 7 lines
Agreed that v4l2-ctl --list-formats-ext doesn't list the frame sizes for the mode that isn't selected without this patch. With this patch you get the full list.
Does it warrant a "Fixes:
22da1d56e("media: i2c: imx219: Add support for RAW8 bit bayer format")"? I'd probably say yes.
+1
Cheers,
--Prabhakar
Quoted 22 lines
Reviewed-by Dave Stevenson <[email protected]>Quoted 20 lines
--- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/imx219.c +1
-2@@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd,if (fse->index >=ARRAY_SIZE (supported_modes))return -EINVAL ; -if (fse->code !=imx219_get_format_code (imx219, imx219->fmt.code)) +if (fse->code !=imx219_get_format_code (imx219, fse->code))return -EINVAL ; fse->min_width = supported_modes[fse->index].width; --2.17.1
Quoted 19 lines · Prabhakar
Quoted 15 lines · Dave Stevenson
Hi Dafna
Thanks for the patch.
Quoted 7 lines · Dafna Hirschfeld
When enumerating the frame sizes, the value sent to
imx219_get_format_codeshould befse->code(the code from the ioctl) and notimx219->fmt.codewhich is the code set currently in the driver.Signed-off-by Dafna Hirschfeld <[email protected]>Reviewed-by Lad Prabhakar <[email protected]>
Quoted 8 lines
Quoted 7 lines
Agreed that v4l2-ctl --list-formats-ext doesn't list the frame sizes for the mode that isn't selected without this patch. With this patch you get the full list.
Does it warrant a "Fixes:
22da1d56e("media: i2c: imx219: Add support for RAW8 bit bayer format")"? I'd probably say yes.+1
Thanks, all!
I've added:
Signature · 1 line
Sakari Ailus