Skip to contentSkip to conversation

media: i2c: imx219: Fix a bug in imx219_enum_frame_size

PATCH In review Dafna Hirschfeld 5 participants 5 messages Mar 31, 2020 – Apr 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index b1f30debe449..df2a6ed7c8ac 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dafna Hirschfeld

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.

Quoted 18 lines
---
 drivers/media/i2c/imx219.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx219.c +1 -1
index b1f30debe449..df2a6ed7c8ac 100644
@@ -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;
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Dafna Hirschfeld

Hi Dafna

Thanks for the patch.

Quoted 7 lines · Dafna Hirschfeld

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.

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
index b1f30debe449..df2a6ed7c8ac 100644
@@ -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

Reviewed-by Lad Prabhakar
#3 lore raw
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_code should be fse->code (the code from the ioctl) and not imx219->fmt.code which is the code set currently in the driver.

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
Quoted 20 lines
---
 drivers/media/i2c/imx219.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx219.c +1 -2
index b1f30debe449..df2a6ed7c8ac 100644
@@ -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

#4 lore raw
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_code should be fse->code (the code from the ioctl) and not imx219->fmt.code which is the code set currently in the driver.

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:

Fixes 22da1d56e982 ("media: i2c: imx219: Add support for RAW8 bit bayer format")
Signature · 1 line
Sakari Ailus