media: mt9p031: Implement crop bounds get selection
PATCH 1/1 media: mt9p031: Implement crop bounds get selection
Implement V4L2_SEL_TGT_CROP_BOUNDS query in get_selection subdev op for this sensor. This is required e.g. to bind it to STM32MP15x DCMI.
--- drivers/media/i2c/mt9p031.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/media/i2c/mt9p031.c +13 -5
@@ -623,12 +623,20 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, {struct mt9p031 *mt9p031 =to_mt9p031 (subdev); -if (sel->target !=V4L2_SEL_TGT_CROP ) +switch (sel->target) { +case V4L2_SEL_TGT_CROP_BOUNDS : + sel->r.left =MT9P031_COLUMN_START_DEF ; + sel->r.top =MT9P031_ROW_START_DEF ; + sel->r.width =MT9P031_WINDOW_WIDTH_DEF ; + sel->r.height =MT9P031_WINDOW_HEIGHT_DEF ; +return 0 ; +case V4L2_SEL_TGT_CROP : + sel->r = *__mt9p031_get_pad_crop (mt9p031, sd_state, + sel->pad, sel->which); +return 0 ; +default :return -EINVAL ; - - sel->r = *__mt9p031_get_pad_crop (mt9p031, sd_state, sel->pad, - sel->which); -return 0 ; + } } static int mt9p031_set_selection(struct v4l2_subdev *subdev,
Signature · 1 line
2.35.1
Laurent Pinchart
maintainerHi Marek,
Thank you for the patch.
Quoted 17 lines · Marek Vasut
Implement
V4L2_SEL_TGT_CROP_BOUNDSquery inget_selectionsubdev op for this sensor. This is required e.g. to bind it to STM32MP15x DCMI.Signed-off-by Marek Vasut <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Sakari Ailus <[email protected]>Cc Stefan Riedmueller <[email protected]>--- drivers/media/i2c/mt9p031.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/media/i2c/mt9p031.c +0
-0
drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 629
Quoted 8 lines
drivers/media/i2c/mt9p031.c +4
-1@@ -623,12 +623,20 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, {struct mt9p031 *mt9p031 =to_mt9p031 (subdev); -if (sel->target !=V4L2_SEL_TGT_CROP ) +switch (sel->target) { +case V4L2_SEL_TGT_CROP_BOUNDS : + sel->r.left =MT9P031_COLUMN_START_DEF ; + sel->r.top =MT9P031_ROW_START_DEF ;
Shouldn't this be MT9P031_COLUMN_START_MIN and MT9P031_ROW_START_MIN ?
drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 631
Quoted 2 lines
drivers/media/i2c/mt9p031.c +2
-0+ sel->r.width =MT9P031_WINDOW_WIDTH_DEF ; + sel->r.height =MT9P031_WINDOW_HEIGHT_DEF ;
And here MT9P031_WINDOW_WIDTH_MAX and MT9P031_WINDOW_HEIGHT_MAX ?
Quoted 15 lines
drivers/media/i2c/mt9p031.c +7
-4+return 0 ; +case V4L2_SEL_TGT_CROP : + sel->r = *__mt9p031_get_pad_crop (mt9p031, sd_state, + sel->pad, sel->which); +return 0 ; +default :return -EINVAL ; - - sel->r = *__mt9p031_get_pad_crop (mt9p031, sd_state, sel->pad, - sel->which); -return 0 ; + } } static int mt9p031_set_selection(struct v4l2_subdev *subdev,
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 33 lines · Laurent Pinchart
Hi Marek,
Thank you for the patch.
Quoted 17 lines · Marek Vasut
Implement
V4L2_SEL_TGT_CROP_BOUNDSquery inget_selectionsubdev op for this sensor. This is required e.g. to bind it to STM32MP15x DCMI.Signed-off-by Marek Vasut <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Sakari Ailus <[email protected]>Cc Stefan Riedmueller <[email protected]>--- drivers/media/i2c/mt9p031.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/media/i2c/mt9p031.c +0
-0drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 629
Quoted 8 lines
drivers/media/i2c/mt9p031.c +4
-1@@ -623,12 +623,20 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, {struct mt9p031 *mt9p031 =to_mt9p031 (subdev); -if (sel->target !=V4L2_SEL_TGT_CROP ) +switch (sel->target) { +case V4L2_SEL_TGT_CROP_BOUNDS : + sel->r.left =MT9P031_COLUMN_START_DEF ; + sel->r.top =MT9P031_ROW_START_DEF ;Shouldn't this be
MT9P031_COLUMN_START_MINandMT9P031_ROW_START_MIN?
Quoted 4 lines
drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 631
Quoted 2 lines
drivers/media/i2c/mt9p031.c +2
-0+ sel->r.width =MT9P031_WINDOW_WIDTH_DEF ; + sel->r.height =MT9P031_WINDOW_HEIGHT_DEF ;And here
MT9P031_WINDOW_WIDTH_MAXandMT9P031_WINDOW_HEIGHT_MAX?
What makes you think that ?
Laurent Pinchart
maintainerQuoted 34 lines · Marek Vasut
Quoted 33 lines · Laurent Pinchart
Hi Marek,
Thank you for the patch.
Quoted 17 lines · Marek Vasut
Implement
V4L2_SEL_TGT_CROP_BOUNDSquery inget_selectionsubdev op for this sensor. This is required e.g. to bind it to STM32MP15x DCMI.Signed-off-by Marek Vasut <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Sakari Ailus <[email protected]>Cc Stefan Riedmueller <[email protected]>--- drivers/media/i2c/mt9p031.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/media/i2c/mt9p031.c +0
-0drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 629
Quoted 8 lines
drivers/media/i2c/mt9p031.c +4
-1@@ -623,12 +623,20 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, {struct mt9p031 *mt9p031 =to_mt9p031 (subdev); -if (sel->target !=V4L2_SEL_TGT_CROP ) +switch (sel->target) { +case V4L2_SEL_TGT_CROP_BOUNDS : + sel->r.left =MT9P031_COLUMN_START_DEF ; + sel->r.top =MT9P031_ROW_START_DEF ;Shouldn't this be
MT9P031_COLUMN_START_MINandMT9P031_ROW_START_MIN?
Quoted 6 lines
Quoted 4 lines
drivers/media/i2c/mt9p031.c static int mt9p031_get_selection(struct v4l2_subdev *subdev, · line 631
Quoted 2 lines
drivers/media/i2c/mt9p031.c +2
-0+ sel->r.width =MT9P031_WINDOW_WIDTH_DEF ; + sel->r.height =MT9P031_WINDOW_HEIGHT_DEF ;And here
MT9P031_WINDOW_WIDTH_MAXandMT9P031_WINDOW_HEIGHT_MAX?What makes you think that ?
"Bounds of the crop rectangle. All valid crop rectangles fit inside the crop bounds rectangle."
Signature · 3 lines
Regards, Laurent Pinchart