summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-08-05 12:57:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:53:29 +0100
commitaa7396d8b36ba78a9cb24e94d8ce35e8736a1fc6 (patch)
treea01585da4c0827ddd15977ea48928d37c1fec3ff /drivers/media
parent4440b4861798f7f8feb72dd36e7aaa0b77635f00 (diff)
media: i2c: imx219: Selection compliance fixes
[ Upstream commit 1ed36ecd1459b653cced8929bfb37dba94b64c5d ] To comply with the intended usage of the V4L2 selection target when used to retrieve a sensor image properties, adjust the rectangles returned by the imx219 driver. The top/left crop coordinates of the TGT_CROP rectangle were set to (0, 0) instead of (8, 8) which is the offset from the larger physical pixel array rectangle. This was also a mismatch with the default values crop rectangle value, so this is corrected. Found with v4l2-compliance. While at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and CROP_BOUNDS have the same size as the non-active pixels are not readable using the selection API. Found with v4l2-compliance. [reword commit message, use macros for pixel offsets] Fixes: e6d4ef7d58aa7 ("media: i2c: imx219: Implement get_selection") Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/imx219.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index 1cee45e35355..0ae66091a696 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -473,8 +473,8 @@ static const struct imx219_mode supported_modes[] = {
.width = 3280,
.height = 2464,
.crop = {
- .left = 0,
- .top = 0,
+ .left = IMX219_PIXEL_ARRAY_LEFT,
+ .top = IMX219_PIXEL_ARRAY_TOP,
.width = 3280,
.height = 2464
},
@@ -489,8 +489,8 @@ static const struct imx219_mode supported_modes[] = {
.width = 1920,
.height = 1080,
.crop = {
- .left = 680,
- .top = 692,
+ .left = 688,
+ .top = 700,
.width = 1920,
.height = 1080
},
@@ -505,8 +505,8 @@ static const struct imx219_mode supported_modes[] = {
.width = 1640,
.height = 1232,
.crop = {
- .left = 0,
- .top = 0,
+ .left = IMX219_PIXEL_ARRAY_LEFT,
+ .top = IMX219_PIXEL_ARRAY_TOP,
.width = 3280,
.height = 2464
},
@@ -521,8 +521,8 @@ static const struct imx219_mode supported_modes[] = {
.width = 640,
.height = 480,
.crop = {
- .left = 1000,
- .top = 752,
+ .left = 1008,
+ .top = 760,
.width = 1280,
.height = 960
},
@@ -1008,6 +1008,7 @@ static int imx219_get_selection(struct v4l2_subdev *sd,
return 0;
case V4L2_SEL_TGT_CROP_DEFAULT:
+ case V4L2_SEL_TGT_CROP_BOUNDS:
sel->r.top = IMX219_PIXEL_ARRAY_TOP;
sel->r.left = IMX219_PIXEL_ARRAY_LEFT;
sel->r.width = IMX219_PIXEL_ARRAY_WIDTH;