Skip to contentSkip to conversation

staging: ipu3-imgu: Move the UAPI header from include under include/uapi

PATCH In review Sakari Ailus 3 participants 4 messages Apr 12, 2021 – Apr 13, 2021

Subsystems (3)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 staging: ipu3-imgu: Move the UAPI header from include under include/uapi

The header defines the user space interface but may be mistaken as kernel-only header due to its location. Add "uapi" directory under driver's include directory and move the header there.

---
 Documentation/admin-guide/media/ipu3.rst      | 35 ++++++++++---------
 .../media/v4l/pixfmt-meta-intel-ipu3.rst      |  2 +-
 .../ipu3/include/{ => uapi}/intel-ipu3.h      |  0
 drivers/staging/media/ipu3/ipu3-abi.h         |  2 +-
 4 files changed, 20 insertions(+), 19 deletions(-)
 rename drivers/staging/media/ipu3/include/{ => uapi}/intel-ipu3.h (100%)
Documentation/admin-guide/media/ipu3.rst +18 -17
index f59697c7b374..d6454f637ff4 100644
@@ -234,22 +234,23 @@ The IPU3 ImgU pipelines can be configured using the Media Controller, defined at
 Running mode and firmware binary selection
 ------------------------------------------
 
-ImgU works based on firmware, currently the ImgU firmware support run 2 pipes in
-time-sharing with single input frame data. Each pipe can run at certain mode -
-"VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture, and
-"STILL" is used for still frame capture. However, you can also select "VIDEO" to
-capture still frames if you want to capture images with less system load and
-power. For "STILL" mode, ImgU will try to use smaller BDS factor and output
-larger bayer frame for further YUV processing than "VIDEO" mode to get high
-quality images. Besides, "STILL" mode need XNR3 to do noise reduction, hence
-"STILL" mode will need more power and memory bandwidth than "VIDEO" mode. TNR
-will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is running at
-“VIDEO” mode by default, the user can use v4l2 control V4L2_CID_INTEL_IPU3_MODE
-(currently defined in drivers/staging/media/ipu3/include/intel-ipu3.h) to query
-and set the running mode. For user, there is no difference for buffer queueing
-between the "VIDEO" and "STILL" mode, mandatory input and main output node
-should be enabled and buffers need be queued, the statistics and the view-finder
-queues are optional.
+ImgU works based on firmware, currently the ImgU firmware support run 2 pipes
+in time-sharing with single input frame data. Each pipe can run at certain mode
+- "VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture,
+and "STILL" is used for still frame capture. However, you can also select
+"VIDEO" to capture still frames if you want to capture images with less system
+load and power. For "STILL" mode, ImgU will try to use smaller BDS factor and
+output larger bayer frame for further YUV processing than "VIDEO" mode to get
+high quality images. Besides, "STILL" mode need XNR3 to do noise reduction,
+hence "STILL" mode will need more power and memory bandwidth than "VIDEO" mode.
+TNR will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is
+running at “VIDEO” mode by default, the user can use v4l2 control
+V4L2_CID_INTEL_IPU3_MODE (currently defined in
+drivers/staging/media/ipu3/include/uapi/intel-ipu3.h) to query and set the
+running mode. For user, there is no difference for buffer queueing between the
+"VIDEO" and "STILL" mode, mandatory input and main output node should be
+enabled and buffers need be queued, the statistics and the view-finder queues
+are optional.
 
 The firmware binary will be selected according to current running mode, such log
 "using binary if_to_osys_striped " or "using binary if_to_osys_primary_striped"
@@ -586,7 +587,7 @@ preserved.
 References
 ==========
 
-.. [#f5] drivers/staging/media/ipu3/include/intel-ipu3.h
+.. [#f5] drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
 
 .. [#f1] https://github.com/intel/nvt
 
Documentation/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.rst +1 -1
index 5f33d35532ef..84d81dd7a7b5 100644
@@ -78,4 +78,4 @@ hardware and algorithm details.
 Intel IPU3 ImgU uAPI data types
 ===============================
 
-.. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h
+.. kernel-doc:: drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/include/uapi/intel-ipu3.h renamed from drivers/staging/media/ipu3/include/intel-ipu3.h +0 -0
similarity index 100%
rename from drivers/staging/media/ipu3/include/intel-ipu3.h
rename to drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/ipu3-abi.h +1 -1
index e1185602c7fd..c76935b436d7 100644
@@ -4,7 +4,7 @@
 #ifndef __IPU3_ABI_H
 #define __IPU3_ABI_H
 
-#include "include/intel-ipu3.h"
+#include "include/uapi/intel-ipu3.h"
 
 /******************* IMGU Hardware information *******************/
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 95 lines · Sakari Ailus

The header defines the user space interface but may be mistaken as kernel-only header due to its location. Add "uapi" directory under driver's include directory and move the header there.

---
 Documentation/admin-guide/media/ipu3.rst      | 35 ++++++++++---------
 .../media/v4l/pixfmt-meta-intel-ipu3.rst      |  2 +-
 .../ipu3/include/{ => uapi}/intel-ipu3.h      |  0
 drivers/staging/media/ipu3/ipu3-abi.h         |  2 +-
 4 files changed, 20 insertions(+), 19 deletions(-)
 rename drivers/staging/media/ipu3/include/{ => uapi}/intel-ipu3.h (100%)
Documentation/admin-guide/media/ipu3.rst +18 -17
index f59697c7b374..d6454f637ff4 100644
@@ -234,22 +234,23 @@ The IPU3 ImgU pipelines can be configured using the Media Controller, defined at
 Running mode and firmware binary selection
 ------------------------------------------
 
-ImgU works based on firmware, currently the ImgU firmware support run 2 pipes in
-time-sharing with single input frame data. Each pipe can run at certain mode -
-"VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture, and
-"STILL" is used for still frame capture. However, you can also select "VIDEO" to
-capture still frames if you want to capture images with less system load and
-power. For "STILL" mode, ImgU will try to use smaller BDS factor and output
-larger bayer frame for further YUV processing than "VIDEO" mode to get high
-quality images. Besides, "STILL" mode need XNR3 to do noise reduction, hence
-"STILL" mode will need more power and memory bandwidth than "VIDEO" mode. TNR
-will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is running at
-“VIDEO” mode by default, the user can use v4l2 control V4L2_CID_INTEL_IPU3_MODE
-(currently defined in drivers/staging/media/ipu3/include/intel-ipu3.h) to query
-and set the running mode. For user, there is no difference for buffer queueing
-between the "VIDEO" and "STILL" mode, mandatory input and main output node
-should be enabled and buffers need be queued, the statistics and the view-finder
-queues are optional.
+ImgU works based on firmware, currently the ImgU firmware support run 2 pipes
+in time-sharing with single input frame data. Each pipe can run at certain mode
+- "VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture,
+and "STILL" is used for still frame capture. However, you can also select
+"VIDEO" to capture still frames if you want to capture images with less system
+load and power. For "STILL" mode, ImgU will try to use smaller BDS factor and
+output larger bayer frame for further YUV processing than "VIDEO" mode to get
+high quality images. Besides, "STILL" mode need XNR3 to do noise reduction,
+hence "STILL" mode will need more power and memory bandwidth than "VIDEO" mode.
+TNR will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is
+running at “VIDEO” mode by default, the user can use v4l2 control
+V4L2_CID_INTEL_IPU3_MODE (currently defined in
+drivers/staging/media/ipu3/include/uapi/intel-ipu3.h) to query and set the
+running mode. For user, there is no difference for buffer queueing between the
+"VIDEO" and "STILL" mode, mandatory input and main output node should be
+enabled and buffers need be queued, the statistics and the view-finder queues
+are optional.
 
 The firmware binary will be selected according to current running mode, such log
 "using binary if_to_osys_striped " or "using binary if_to_osys_primary_striped"
@@ -586,7 +587,7 @@ preserved.
 References
 ==========
 
-.. [#f5] drivers/staging/media/ipu3/include/intel-ipu3.h
+.. [#f5] drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
 
 .. [#f1] https://github.com/intel/nvt
 
Documentation/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.rst +1 -1
index 5f33d35532ef..84d81dd7a7b5 100644
@@ -78,4 +78,4 @@ hardware and algorithm details.
 Intel IPU3 ImgU uAPI data types
 ===============================
 
-.. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h
+.. kernel-doc:: drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/include/uapi/intel-ipu3.h renamed from drivers/staging/media/ipu3/include/intel-ipu3.h +0 -0
similarity index 100%
rename from drivers/staging/media/ipu3/include/intel-ipu3.h
rename to drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/ipu3-abi.h +1 -1
index e1185602c7fd..c76935b436d7 100644
@@ -4,7 +4,7 @@
 #ifndef __IPU3_ABI_H
 #define __IPU3_ABI_H
 
-#include "include/intel-ipu3.h"
+#include "include/uapi/intel-ipu3.h"
 
 /******************* IMGU Hardware information *******************/
 
Signature · 2 lines
Best regards,
Bingbu Cao
Reviewed-by on v1 1/1
#2 lore raw
In reply to Sakari Ailus

Hi Sakari,

Thank you for the patch.

Quoted 45 lines · Sakari Ailus

The header defines the user space interface but may be mistaken as kernel-only header due to its location. Add "uapi" directory under driver's include directory and move the header there.

---
 Documentation/admin-guide/media/ipu3.rst      | 35 ++++++++++---------
 .../media/v4l/pixfmt-meta-intel-ipu3.rst      |  2 +-
 .../ipu3/include/{ => uapi}/intel-ipu3.h      |  0
 drivers/staging/media/ipu3/ipu3-abi.h         |  2 +-
 4 files changed, 20 insertions(+), 19 deletions(-)
 rename drivers/staging/media/ipu3/include/{ => uapi}/intel-ipu3.h (100%)
Documentation/admin-guide/media/ipu3.rst +7 -16
index f59697c7b374..d6454f637ff4 100644
@@ -234,22 +234,23 @@ The IPU3 ImgU pipelines can be configured using the Media Controller, defined at
 Running mode and firmware binary selection
 ------------------------------------------
 
-ImgU works based on firmware, currently the ImgU firmware support run 2 pipes in
-time-sharing with single input frame data. Each pipe can run at certain mode -
-"VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture, and
-"STILL" is used for still frame capture. However, you can also select "VIDEO" to
-capture still frames if you want to capture images with less system load and
-power. For "STILL" mode, ImgU will try to use smaller BDS factor and output
-larger bayer frame for further YUV processing than "VIDEO" mode to get high
-quality images. Besides, "STILL" mode need XNR3 to do noise reduction, hence
-"STILL" mode will need more power and memory bandwidth than "VIDEO" mode. TNR
-will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is running at
-“VIDEO” mode by default, the user can use v4l2 control V4L2_CID_INTEL_IPU3_MODE
-(currently defined in drivers/staging/media/ipu3/include/intel-ipu3.h) to query
-and set the running mode. For user, there is no difference for buffer queueing
-between the "VIDEO" and "STILL" mode, mandatory input and main output node
-should be enabled and buffers need be queued, the statistics and the view-finder
-queues are optional.
+ImgU works based on firmware, currently the ImgU firmware support run 2 pipes
+in time-sharing with single input frame data. Each pipe can run at certain mode
+- "VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture,
+and "STILL" is used for still frame capture. However, you can also select
+"VIDEO" to capture still frames if you want to capture images with less system
+load and power. For "STILL" mode, ImgU will try to use smaller BDS factor and
+output larger bayer frame for further YUV processing than "VIDEO" mode to get

Documentation/admin-guide/media/ipu3.rst The IPU3 ImgU pipelines can be configured using the Media Controller, defined at · line 253

Quoted 10 lines
Documentation/admin-guide/media/ipu3.rst +10 -0
+high quality images. Besides, "STILL" mode need XNR3 to do noise reduction,
+hence "STILL" mode will need more power and memory bandwidth than "VIDEO" mode.
+TNR will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is
+running at “VIDEO” mode by default, the user can use v4l2 control
+V4L2_CID_INTEL_IPU3_MODE (currently defined in
+drivers/staging/media/ipu3/include/uapi/intel-ipu3.h) to query and set the
+running mode. For user, there is no difference for buffer queueing between the
+"VIDEO" and "STILL" mode, mandatory input and main output node should be
+enabled and buffers need be queued, the statistics and the view-finder queues
+are optional.

The reflow of the whole paragraph is a bit painful to review.

Quoted 39 lines
Documentation/admin-guide/media/ipu3.rst +1 -1
 The firmware binary will be selected according to current running mode, such log
 "using binary if_to_osys_striped " or "using binary if_to_osys_primary_striped"
@@ -586,7 +587,7 @@ preserved.
 References
 ==========
 
-.. [#f5] drivers/staging/media/ipu3/include/intel-ipu3.h
+.. [#f5] drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
 
 .. [#f1] https://github.com/intel/nvt
 
Documentation/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.rst +1 -1
index 5f33d35532ef..84d81dd7a7b5 100644
@@ -78,4 +78,4 @@ hardware and algorithm details.
 Intel IPU3 ImgU uAPI data types
 ===============================
 
-.. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h
+.. kernel-doc:: drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/include/uapi/intel-ipu3.h renamed from drivers/staging/media/ipu3/include/intel-ipu3.h +0 -0
similarity index 100%
rename from drivers/staging/media/ipu3/include/intel-ipu3.h
rename to drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
drivers/staging/media/ipu3/ipu3-abi.h +1 -1
index e1185602c7fd..c76935b436d7 100644
@@ -4,7 +4,7 @@
 #ifndef __IPU3_ABI_H
 #define __IPU3_ABI_H
 
-#include "include/intel-ipu3.h"
+#include "include/uapi/intel-ipu3.h"
 
 /******************* IMGU Hardware information *******************/
 
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#3 lore raw

Hi Laurent,

Quoted 54 lines · Laurent Pinchart

Hi Sakari,

Thank you for the patch.

Quoted 49 lines · Sakari Ailus

The header defines the user space interface but may be mistaken as kernel-only header due to its location. Add "uapi" directory under driver's include directory and move the header there.

---
 Documentation/admin-guide/media/ipu3.rst      | 35 ++++++++++---------
 .../media/v4l/pixfmt-meta-intel-ipu3.rst      |  2 +-
 .../ipu3/include/{ => uapi}/intel-ipu3.h      |  0
 drivers/staging/media/ipu3/ipu3-abi.h         |  2 +-
 4 files changed, 20 insertions(+), 19 deletions(-)
 rename drivers/staging/media/ipu3/include/{ => uapi}/intel-ipu3.h (100%)
Documentation/admin-guide/media/ipu3.rst +11 -16
index f59697c7b374..d6454f637ff4 100644
@@ -234,22 +234,23 @@ The IPU3 ImgU pipelines can be configured using the Media Controller, defined at
 Running mode and firmware binary selection
 ------------------------------------------
 
-ImgU works based on firmware, currently the ImgU firmware support run 2 pipes in
-time-sharing with single input frame data. Each pipe can run at certain mode -
-"VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture, and
-"STILL" is used for still frame capture. However, you can also select "VIDEO" to
-capture still frames if you want to capture images with less system load and
-power. For "STILL" mode, ImgU will try to use smaller BDS factor and output
-larger bayer frame for further YUV processing than "VIDEO" mode to get high
-quality images. Besides, "STILL" mode need XNR3 to do noise reduction, hence
-"STILL" mode will need more power and memory bandwidth than "VIDEO" mode. TNR
-will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is running at
-“VIDEO” mode by default, the user can use v4l2 control V4L2_CID_INTEL_IPU3_MODE
-(currently defined in drivers/staging/media/ipu3/include/intel-ipu3.h) to query
-and set the running mode. For user, there is no difference for buffer queueing
-between the "VIDEO" and "STILL" mode, mandatory input and main output node
-should be enabled and buffers need be queued, the statistics and the view-finder
-queues are optional.
+ImgU works based on firmware, currently the ImgU firmware support run 2 pipes
+in time-sharing with single input frame data. Each pipe can run at certain mode
+- "VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture,
+and "STILL" is used for still frame capture. However, you can also select
+"VIDEO" to capture still frames if you want to capture images with less system
+load and power. For "STILL" mode, ImgU will try to use smaller BDS factor and
+output larger bayer frame for further YUV processing than "VIDEO" mode to get
+high quality images. Besides, "STILL" mode need XNR3 to do noise reduction,
+hence "STILL" mode will need more power and memory bandwidth than "VIDEO" mode.
+TNR will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is
+running at “VIDEO” mode by default, the user can use v4l2 control
Quoted 8 lines

Documentation/admin-guide/media/ipu3.rst The IPU3 ImgU pipelines can be configured using the Media Controller, defined at · line 253

Quoted 6 lines
Documentation/admin-guide/media/ipu3.rst +6 -0
+V4L2_CID_INTEL_IPU3_MODE (currently defined in
+drivers/staging/media/ipu3/include/uapi/intel-ipu3.h) to query and set the
+running mode. For user, there is no difference for buffer queueing between the
+"VIDEO" and "STILL" mode, mandatory input and main output node should be
+enabled and buffers need be queued, the statistics and the view-finder queues
+are optional.

The reflow of the whole paragraph is a bit painful to review.

Yes. The only difference there is still the addition of "/uapi". :-)

Quoted 2 lines

Thank you!

Signature · 1 line
Sakari Ailus