Skip to contentSkip to conversation

v4l: Remove support for crop default target in subdev drivers

PATCH In review Sakari Ailus 5 participants 6 messages Sep 24, 2018 – Sep 26, 2018

Subsystems (8)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 v4l: Remove support for crop default target in subdev drivers

The V4L2 sub-device API does not support the crop default target. A number of drivers apparently still did support this, likely as it was needed by the SoC camera framework. Drop support for the default crop rectaingle in sub-device drivers, and use the bround in SoC camera instead.

---
 drivers/media/i2c/ak881x.c                         | 1 -
 drivers/media/i2c/mt9m111.c                        | 1 -
 drivers/media/i2c/mt9t112.c                        | 6 ------
 drivers/media/i2c/ov2640.c                         | 1 -
 drivers/media/i2c/ov6650.c                         | 1 -
 drivers/media/i2c/ov772x.c                         | 1 -
 drivers/media/i2c/rj54n1cb0c.c                     | 1 -
 drivers/media/i2c/soc_camera/mt9m001.c             | 1 -
 drivers/media/i2c/soc_camera/mt9t112.c             | 6 ------
 drivers/media/i2c/soc_camera/mt9v022.c             | 1 -
 drivers/media/i2c/soc_camera/ov5642.c              | 1 -
 drivers/media/i2c/soc_camera/ov772x.c              | 1 -
 drivers/media/i2c/soc_camera/ov9640.c              | 1 -
 drivers/media/i2c/soc_camera/ov9740.c              | 1 -
 drivers/media/i2c/soc_camera/rj54n1cb0c.c          | 1 -
 drivers/media/i2c/tvp5150.c                        | 1 -
 drivers/media/platform/soc_camera/soc_scale_crop.c | 2 +-
 drivers/staging/media/imx074/imx074.c              | 1 -
 drivers/staging/media/mt9t031/mt9t031.c            | 1 -
 19 files changed, 1 insertion(+), 29 deletions(-)
drivers/media/i2c/ak881x.c +0 -1
index 16682c8477d1..30f9db1351b9 100644
@@ -136,7 +136,6 @@ static int ak881x_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = 720;
drivers/media/i2c/mt9m111.c +0 -1
index efda1aa95ca0..1395986a07bb 100644
@@ -445,7 +445,6 @@ static int mt9m111_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9M111_MIN_DARK_COLS;
 		sel->r.top = MT9M111_MIN_DARK_ROWS;
 		sel->r.width = MT9M111_MAX_WIDTH;
drivers/media/i2c/mt9t112.c +0 -6
index af8cca984215..ef353a244e33 100644
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;
drivers/media/i2c/ov2640.c +0 -1
index beb722065152..20a8853ba1e2 100644
@@ -1010,7 +1010,6 @@ static int ov2640_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.left = 0;
 		sel->r.top = 0;
drivers/media/i2c/ov6650.c +0 -1
index 17a34b4a819d..5d1b218bb7f0 100644
@@ -449,7 +449,6 @@ static int ov6650_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = DEF_HSTRT << 1;
 		sel->r.top = DEF_VSTRT << 1;
 		sel->r.width = W_CIF;
drivers/media/i2c/ov772x.c +0 -1
index 161bc7c8535d..fefff7fd7d68 100644
@@ -1147,7 +1147,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.width = priv->win->rect.width;
 		sel->r.height = priv->win->rect.height;
drivers/media/i2c/rj54n1cb0c.c +0 -1
index 6ad998ad1b16..4cc51e001874 100644
@@ -589,7 +589,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = RJ54N1_COLUMN_SKIP;
 		sel->r.top = RJ54N1_ROW_SKIP;
 		sel->r.width = RJ54N1_MAX_WIDTH;
drivers/media/i2c/soc_camera/mt9m001.c +0 -1
index 1bfb0d53059e..a1a85ff838c5 100644
@@ -243,7 +243,6 @@ static int mt9m001_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9M001_COLUMN_SKIP;
 		sel->r.top = MT9M001_ROW_SKIP;
 		sel->r.width = MT9M001_MAX_WIDTH;
drivers/media/i2c/soc_camera/mt9t112.c +0 -6
index b53c36dfa469..ea1ff270bc2d 100644
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;
drivers/media/i2c/soc_camera/mt9v022.c +0 -1
index 762f06919329..6d922b17ea94 100644
@@ -368,7 +368,6 @@ static int mt9v022_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9V022_COLUMN_SKIP;
 		sel->r.top = MT9V022_ROW_SKIP;
 		sel->r.width = MT9V022_MAX_WIDTH;
drivers/media/i2c/soc_camera/ov5642.c +0 -1
index 39f420db9c70..c6c41b03c0ef 100644
@@ -896,7 +896,6 @@ static int ov5642_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = OV5642_MAX_WIDTH;
drivers/media/i2c/soc_camera/ov772x.c +0 -1
index 14377af7c888..fafd372527b2 100644
@@ -862,7 +862,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.width = OV772X_MAX_WIDTH;
 		sel->r.height = OV772X_MAX_HEIGHT;
 		return 0;
drivers/media/i2c/soc_camera/ov9640.c +0 -1
index c63948989688..eb91b8240083 100644
@@ -554,7 +554,6 @@ static int ov9640_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.width = W_SXGA;
 		sel->r.height = H_SXGA;
drivers/media/i2c/soc_camera/ov9740.c +0 -1
index 755de2289c39..a07d3145d1b4 100644
@@ -730,7 +730,6 @@ static int ov9740_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.left = 0;
 		sel->r.top = 0;
drivers/media/i2c/soc_camera/rj54n1cb0c.c +0 -1
index 02398d0bc649..f0cb49a6167b 100644
@@ -591,7 +591,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = RJ54N1_COLUMN_SKIP;
 		sel->r.top = RJ54N1_ROW_SKIP;
 		sel->r.width = RJ54N1_MAX_WIDTH;
drivers/media/i2c/tvp5150.c +0 -1
index f5b234e4599d..4f746e02de22 100644
@@ -1082,7 +1082,6 @@ static int tvp5150_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = TVP5150_H_MAX;
drivers/media/platform/soc_camera/soc_scale_crop.c +1 -1
index 6164102e6f9f..8d25ca0490f7 100644
@@ -52,7 +52,7 @@ int soc_camera_client_g_rect(struct v4l2_subdev *sd, struct v4l2_rect *rect)
 		return ret;
 	}
 
-	sdsel.target = V4L2_SEL_TGT_CROP_DEFAULT;
+	sdsel.target = V4L2_SEL_TGT_CROP_BOUNDS;
 	ret = v4l2_subdev_call(sd, pad, get_selection, NULL, &sdsel);
 	if (!ret)
 		*rect = sdsel.r;
drivers/staging/media/imx074/imx074.c +0 -1
index 77f1e0243d6e..c5256903e59f 100644
@@ -223,7 +223,6 @@ static int imx074_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		return 0;
 	default:
drivers/staging/media/mt9t031/mt9t031.c +0 -1
index 4802d30e47de..4ff179302b4f 100644
@@ -330,7 +330,6 @@ static int mt9t031_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9T031_COLUMN_SKIP;
 		sel->r.top = MT9T031_ROW_SKIP;
 		sel->r.width = MT9T031_MAX_WIDTH;
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Sakari Ailus

The V4L2 sub-device API does not support the crop default target. A number of drivers apparently still did support this, likely as it was needed by the SoC camera framework. Drop support for the default crop rectaingle in sub-device drivers, and use the bround in SoC camera instead.

Thanks!

Hans

Quoted 263 lines
---
 drivers/media/i2c/ak881x.c                         | 1 -
 drivers/media/i2c/mt9m111.c                        | 1 -
 drivers/media/i2c/mt9t112.c                        | 6 ------
 drivers/media/i2c/ov2640.c                         | 1 -
 drivers/media/i2c/ov6650.c                         | 1 -
 drivers/media/i2c/ov772x.c                         | 1 -
 drivers/media/i2c/rj54n1cb0c.c                     | 1 -
 drivers/media/i2c/soc_camera/mt9m001.c             | 1 -
 drivers/media/i2c/soc_camera/mt9t112.c             | 6 ------
 drivers/media/i2c/soc_camera/mt9v022.c             | 1 -
 drivers/media/i2c/soc_camera/ov5642.c              | 1 -
 drivers/media/i2c/soc_camera/ov772x.c              | 1 -
 drivers/media/i2c/soc_camera/ov9640.c              | 1 -
 drivers/media/i2c/soc_camera/ov9740.c              | 1 -
 drivers/media/i2c/soc_camera/rj54n1cb0c.c          | 1 -
 drivers/media/i2c/tvp5150.c                        | 1 -
 drivers/media/platform/soc_camera/soc_scale_crop.c | 2 +-
 drivers/staging/media/imx074/imx074.c              | 1 -
 drivers/staging/media/mt9t031/mt9t031.c            | 1 -
 19 files changed, 1 insertion(+), 29 deletions(-)
drivers/media/i2c/ak881x.c +0 -1
index 16682c8477d1..30f9db1351b9 100644
@@ -136,7 +136,6 @@ static int ak881x_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = 720;
drivers/media/i2c/mt9m111.c +0 -1
index efda1aa95ca0..1395986a07bb 100644
@@ -445,7 +445,6 @@ static int mt9m111_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9M111_MIN_DARK_COLS;
 		sel->r.top = MT9M111_MIN_DARK_ROWS;
 		sel->r.width = MT9M111_MAX_WIDTH;
drivers/media/i2c/mt9t112.c +0 -6
index af8cca984215..ef353a244e33 100644
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;
drivers/media/i2c/ov2640.c +0 -1
index beb722065152..20a8853ba1e2 100644
@@ -1010,7 +1010,6 @@ static int ov2640_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.left = 0;
 		sel->r.top = 0;
drivers/media/i2c/ov6650.c +0 -1
index 17a34b4a819d..5d1b218bb7f0 100644
@@ -449,7 +449,6 @@ static int ov6650_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = DEF_HSTRT << 1;
 		sel->r.top = DEF_VSTRT << 1;
 		sel->r.width = W_CIF;
drivers/media/i2c/ov772x.c +0 -1
index 161bc7c8535d..fefff7fd7d68 100644
@@ -1147,7 +1147,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.width = priv->win->rect.width;
 		sel->r.height = priv->win->rect.height;
drivers/media/i2c/rj54n1cb0c.c +0 -1
index 6ad998ad1b16..4cc51e001874 100644
@@ -589,7 +589,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = RJ54N1_COLUMN_SKIP;
 		sel->r.top = RJ54N1_ROW_SKIP;
 		sel->r.width = RJ54N1_MAX_WIDTH;
drivers/media/i2c/soc_camera/mt9m001.c +0 -1
index 1bfb0d53059e..a1a85ff838c5 100644
@@ -243,7 +243,6 @@ static int mt9m001_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9M001_COLUMN_SKIP;
 		sel->r.top = MT9M001_ROW_SKIP;
 		sel->r.width = MT9M001_MAX_WIDTH;
drivers/media/i2c/soc_camera/mt9t112.c +0 -6
index b53c36dfa469..ea1ff270bc2d 100644
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;
drivers/media/i2c/soc_camera/mt9v022.c +0 -1
index 762f06919329..6d922b17ea94 100644
@@ -368,7 +368,6 @@ static int mt9v022_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9V022_COLUMN_SKIP;
 		sel->r.top = MT9V022_ROW_SKIP;
 		sel->r.width = MT9V022_MAX_WIDTH;
drivers/media/i2c/soc_camera/ov5642.c +0 -1
index 39f420db9c70..c6c41b03c0ef 100644
@@ -896,7 +896,6 @@ static int ov5642_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = OV5642_MAX_WIDTH;
drivers/media/i2c/soc_camera/ov772x.c +0 -1
index 14377af7c888..fafd372527b2 100644
@@ -862,7 +862,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.width = OV772X_MAX_WIDTH;
 		sel->r.height = OV772X_MAX_HEIGHT;
 		return 0;
drivers/media/i2c/soc_camera/ov9640.c +0 -1
index c63948989688..eb91b8240083 100644
@@ -554,7 +554,6 @@ static int ov9640_get_selection(struct v4l2_subdev *sd,
 	sel->r.top = 0;
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.width = W_SXGA;
 		sel->r.height = H_SXGA;
drivers/media/i2c/soc_camera/ov9740.c +0 -1
index 755de2289c39..a07d3145d1b4 100644
@@ -730,7 +730,6 @@ static int ov9740_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		sel->r.left = 0;
 		sel->r.top = 0;
drivers/media/i2c/soc_camera/rj54n1cb0c.c +0 -1
index 02398d0bc649..f0cb49a6167b 100644
@@ -591,7 +591,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = RJ54N1_COLUMN_SKIP;
 		sel->r.top = RJ54N1_ROW_SKIP;
 		sel->r.width = RJ54N1_MAX_WIDTH;
drivers/media/i2c/tvp5150.c +0 -1
index f5b234e4599d..4f746e02de22 100644
@@ -1082,7 +1082,6 @@ static int tvp5150_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = 0;
 		sel->r.top = 0;
 		sel->r.width = TVP5150_H_MAX;
drivers/media/platform/soc_camera/soc_scale_crop.c +1 -1
index 6164102e6f9f..8d25ca0490f7 100644
@@ -52,7 +52,7 @@ int soc_camera_client_g_rect(struct v4l2_subdev *sd, struct v4l2_rect *rect)
 		return ret;
 	}
 
-	sdsel.target = V4L2_SEL_TGT_CROP_DEFAULT;
+	sdsel.target = V4L2_SEL_TGT_CROP_BOUNDS;
 	ret = v4l2_subdev_call(sd, pad, get_selection, NULL, &sdsel);
 	if (!ret)
 		*rect = sdsel.r;
drivers/staging/media/imx074/imx074.c +0 -1
index 77f1e0243d6e..c5256903e59f 100644
@@ -223,7 +223,6 @@ static int imx074_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 	case V4L2_SEL_TGT_CROP:
 		return 0;
 	default:
drivers/staging/media/mt9t031/mt9t031.c +0 -1
index 4802d30e47de..4ff179302b4f 100644
@@ -330,7 +330,6 @@ static int mt9t031_get_selection(struct v4l2_subdev *sd,
 
 	switch (sel->target) {
 	case V4L2_SEL_TGT_CROP_BOUNDS:
-	case V4L2_SEL_TGT_CROP_DEFAULT:
 		sel->r.left = MT9T031_COLUMN_SKIP;
 		sel->r.top = MT9T031_ROW_SKIP;
 		sel->r.width = MT9T031_MAX_WIDTH;
#2 lore raw
Quoted 5 lines · Hans Verkuil
Quoted 4 lines · Sakari Ailus

The V4L2 sub-device API does not support the crop default target. A number of drivers apparently still did support this, likely as it was needed by the SoC camera framework. Drop support for the default crop rectaingle in sub-device drivers, and use the bround in SoC camera instead.

				    ^

This was intended to be "bounds rectangle" instead. I'll fix that to the pull request.

Quoted 5 lines
Quoted 3 lines

Thanks!

Signature · 2 lines
Sakari Ailus
e-mail: [email protected]
#3 lore raw
In reply to Sakari Ailus
Quoted 5 lines · Sakari Ailus
drivers/media/i2c/mt9t112.c +0 -0
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;

drivers/media/i2c/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 893

Quoted 10 lines
drivers/media/i2c/mt9t112.c +0 -6
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

Together with the change in soc_scale_crop.c, this constitutes an (unintentional?) behaviour change. It was formerly reporting 640x480 and will now be reporting 2048x1536. I cannot tell whether that is reasonable.

Quoted 5 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -0
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;

drivers/media/i2c/soc_camera/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 889

Quoted 10 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -6
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

This one looks duplicate. Is there a good reason to have two drivers for mt9t112? This is lilely out of scope for the patch. Cced Jacopo Mondi as he introduced the copy.

Other than your patch looks fine to me.

Helmut

maintainer
#4 lore raw

Hi Helmut,

Quoted 33 lines · Helmut Grohne
Quoted 5 lines · Sakari Ailus
drivers/media/i2c/mt9t112.c +0 -0
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;

drivers/media/i2c/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 893

Quoted 10 lines
drivers/media/i2c/mt9t112.c +0 -6
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

Together with the change in soc_scale_crop.c, this constitutes an (unintentional?) behaviour change. It was formerly reporting 640x480 and will now be reporting 2048x1536. I cannot tell whether that is reasonable.

Quoted 11 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -5
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
Quoted 9 lines

drivers/media/i2c/soc_camera/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 889

Quoted 4 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -1
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

This one looks duplicate. Is there a good reason to have two drivers for mt9t112? This is lilely out of scope for the patch. Cced Jacopo Mondi as he introduced the copy.

This version is the one using te soc_camera framework which is targeted for deprecation. The soc_camera based sensor drivers are being ported to be regular v4l2 sensor drivers, hence the copy in drivers/media/i2c/. The original versions in drivers/media/i2c/soc_camera will be around for a little longer and then possibly moved to staging or later removed.

Hope this clarifies.
Thanks
j

Quoted 3 lines

Other than your patch looks fine to me.

Helmut

author maintainer
#5 lore raw
In reply to Helmut Grohne

Hi Helmut,

Quoted 13 lines · Helmut Grohne
Quoted 12 lines · Sakari Ailus
drivers/media/i2c/mt9t112.c +0 -6
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
Quoted 8 lines

drivers/media/i2c/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 893

Quoted 3 lines
drivers/media/i2c/mt9t112.c +0 -0
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

Together with the change in soc_scale_crop.c, this constitutes an (unintentional?) behaviour change. It was formerly reporting 640x480 and will now be reporting 2048x1536. I cannot tell whether that is reasonable.

I'd say "yes". This is the only sub-device driver that puts a default other than the bounds there. Its source is SoC camera as you see below.

Quoted 24 lines
Quoted 6 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -0
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
 		sel->r.width = MAX_WIDTH;
 		sel->r.height = MAX_HEIGHT;

drivers/media/i2c/soc_camera/mt9t112.c static int mt9t112_get_selection(struct v4l2_subdev *sd, · line 889

Quoted 10 lines
drivers/media/i2c/soc_camera/mt9t112.c +0 -6
 		return 0;
-	case V4L2_SEL_TGT_CROP_DEFAULT:
-		sel->r.left = 0;
-		sel->r.top = 0;
-		sel->r.width = VGA_WIDTH;
-		sel->r.height = VGA_HEIGHT;
-		return 0;
 	case V4L2_SEL_TGT_CROP:
 		sel->r = priv->frame;
 		return 0;

This one looks duplicate. Is there a good reason to have two drivers for mt9t112? This is lilely out of scope for the patch. Cced Jacopo Mondi as he introduced the copy.

Other than your patch looks fine to me.

Helmut

Signature · 4 lines
Kind regards,

Sakari Ailus
[email protected]