Skip to contentSkip to conversation

Documentation: media: *_DEFAULT targets for subdevs

PATCH Superseded Ricardo Ribalda Delgado 2 participants 5 messages Oct 24, 2019

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Documentation: media: *_DEFAULT targets for subdevs

Some sensors have optical blanking areas, this is, pixels that are painted and do not account for light, only noise.

These special pixels are very useful for calibrating the sensor, but should not be displayed on a DEFAULT target.

---

v2: Changes by Sakari Ailus <[email protected]>

Only change CROP_DEFAULT

 Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +4 -2
index f74f239b0510..41c6674ec283 100644
@@ -38,8 +38,10 @@ of the two interfaces they are used.
     * - ``V4L2_SEL_TGT_CROP_DEFAULT``
       - 0x0001
       - Suggested cropping rectangle that covers the "whole picture".
+        This includes only active pixels and excludes other non-active
+        pixels such as black pixels.
+      - Yes
       - Yes
-      - No
     * - ``V4L2_SEL_TGT_CROP_BOUNDS``
       - 0x0002
       - Bounds of the crop rectangle. All valid crop rectangles fit inside
@@ -61,7 +63,7 @@ of the two interfaces they are used.
       - 0x0101
       - Suggested composition rectangle that covers the "whole picture".
       - Yes
-      - No
+      - Yes
     * - ``V4L2_SEL_TGT_COMPOSE_BOUNDS``
       - 0x0102
       - Bounds of the compose rectangle. All valid compose rectangles fit
Signature · 1 line
2.23.0
#1 lore raw

PATCH v2 1/1 v4l2-compliance: Allow all the selection targets for subdevs

Subdev can also have non-active pixels, and using the _DEFAULT targets we can capture only the active pixels.

---
 utils/v4l2-compliance/v4l2-test-subdevs.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/v4l2-compliance/v4l2-test-subdevs.cpp +2 -2
index 29987b31..c3979404 100644
@@ -395,11 +395,11 @@ struct target_info {
 
 static target_info targets[] = {
 	{ V4L2_SEL_TGT_CROP, true },
-	{ V4L2_SEL_TGT_CROP_DEFAULT, false, true },
+	{ V4L2_SEL_TGT_CROP_DEFAULT, true, true },
 	{ V4L2_SEL_TGT_CROP_BOUNDS, true, true },
 	{ V4L2_SEL_TGT_NATIVE_SIZE, true },
 	{ V4L2_SEL_TGT_COMPOSE, true },
-	{ V4L2_SEL_TGT_COMPOSE_DEFAULT, false, true },
+	{ V4L2_SEL_TGT_COMPOSE_DEFAULT, true, true },
 	{ V4L2_SEL_TGT_COMPOSE_BOUNDS, true, true },
 	{ V4L2_SEL_TGT_COMPOSE_PADDED, false, true },
 	{ ~0U },
Signature · 1 line
2.23.0
Acked-by on v2 1/1
#2 lore raw
In reply to Ricardo Ribalda Delgado

Hi Ricardo,

Quoted 33 lines · Ricardo Ribalda Delgado

Some sensors have optical blanking areas, this is, pixels that are painted and do not account for light, only noise.

These special pixels are very useful for calibrating the sensor, but should not be displayed on a DEFAULT target.

---

v2: Changes by Sakari Ailus <[email protected]>

Only change CROP_DEFAULT

 Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +3 -1
index f74f239b0510..41c6674ec283 100644
@@ -38,8 +38,10 @@ of the two interfaces they are used.
     * - ``V4L2_SEL_TGT_CROP_DEFAULT``
       - 0x0001
       - Suggested cropping rectangle that covers the "whole picture".
+        This includes only active pixels and excludes other non-active
+        pixels such as black pixels.
+      - Yes
       - Yes
-      - No
     * - ``V4L2_SEL_TGT_CROP_BOUNDS``
       - 0x0002
       - Bounds of the crop rectangle. All valid crop rectangles fit inside

Documentation/media/uapi/v4l/v4l2-selection-targets.rst of the two interfaces they are used. · line 66

Quoted 5 lines
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +1 -1
@@ -61,7 +63,7 @@ of the two interfaces they are used.
       - 0x0101
       - Suggested composition rectangle that covers the "whole picture".
       - Yes
-      - No
+      - Yes

This is COMPOSE_DEFAULT that wasn't meant to be changed. So with this chunk dropped,

Quoted 3 lines
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +0 -0
     * - ``V4L2_SEL_TGT_COMPOSE_BOUNDS``
       - 0x0102
       - Bounds of the compose rectangle. All valid compose rectangles fit
Signature · 2 lines
Sakari Ailus
[email protected]
#3 lore raw

Hi Sakari

Lets say the user wants to select the active pixels. He needs to set the crop and the compose.

1) he gets V4L2_SEL_TGT_CROP_DEFAULT

2) he sets V4L2_SEL_TGT_CROP

How does he knows which compose to use? What if the compose starts at (0,0) instead of (32,32)....?

I think it is easier if

3) he gets V4L2_SEL_TGT_COMPOSE_DEFAULT

4) he sets V4L2_SEL_TGT_COMPOSE

This is similar as how we do it today with a v4l2_device. What if we simply replicate that behaviour?

Best regards

Quoted 55 lines · Sakari Ailus

Hi Ricardo,

Quoted 33 lines · Ricardo Ribalda Delgado

Some sensors have optical blanking areas, this is, pixels that are painted and do not account for light, only noise.

These special pixels are very useful for calibrating the sensor, but should not be displayed on a DEFAULT target.

---

v2: Changes by Sakari Ailus <[email protected]>

Only change CROP_DEFAULT

 Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +3 -1
index f74f239b0510..41c6674ec283 100644
@@ -38,8 +38,10 @@ of the two interfaces they are used.
     * - ``V4L2_SEL_TGT_CROP_DEFAULT``
       - 0x0001
       - Suggested cropping rectangle that covers the "whole picture".
+        This includes only active pixels and excludes other non-active
+        pixels such as black pixels.
+      - Yes
       - Yes
-      - No
     * - ``V4L2_SEL_TGT_CROP_BOUNDS``
       - 0x0002
       - Bounds of the crop rectangle. All valid crop rectangles fit inside

Documentation/media/uapi/v4l/v4l2-selection-targets.rst of the two interfaces they are used. · line 66

Quoted 5 lines
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +1 -1
@@ -61,7 +63,7 @@ of the two interfaces they are used.
       - 0x0101
       - Suggested composition rectangle that covers the "whole picture".
       - Yes
-      - No
+      - Yes

This is COMPOSE_DEFAULT that wasn't meant to be changed. So with this chunk dropped,

Documentation/media/uapi/v4l/v4l2-selection-targets.rst of the two interfaces they are used. · line 69

Quoted 3 lines
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +0 -0
     * - ``V4L2_SEL_TGT_COMPOSE_BOUNDS``
       - 0x0102
       - Bounds of the compose rectangle. All valid compose rectangles fit

--
Sakari Ailus
[email protected]

#4 lore raw

Hi Ricardo,

Quoted 12 lines · Ricardo Ribalda Delgado

Hi Sakari

Lets say the user wants to select the active pixels. He needs to set the crop and the compose.

1) he gets V4L2_SEL_TGT_CROP_DEFAULT

2) he sets V4L2_SEL_TGT_CROP

How does he knows which compose to use? What if the compose starts at (0,0) instead of (32,32)....?

Quoted 8 lines

I think it is easier if

3) he gets V4L2_SEL_TGT_COMPOSE_DEFAULT

4) he sets V4L2_SEL_TGT_COMPOSE

This is similar as how we do it today with a v4l2_device. What if we simply replicate that behaviour?

The compose rectangle is relative to the crop rectangle (if there's a crop rectangle), and always starts at 0,0.

See:

<URL:https://hverkuil.home.xs4all.nl/spec/uapi/v4l/dev-subdev.html#selections-cropping-scaling-and-composition>

Signature · 2 lines
Sakari Ailus
[email protected]