Skip to content

drivers: video: formats: add most of the raw formats #88138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 14, 2025

Conversation

josuah
Copy link
Collaborator

@josuah josuah commented Apr 4, 2025

Downstream:

This adds the raw formats in the same packing as defined by MIPI, with the naming that follows the Linux Kernel:

* | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | ...
* @endverbatim
*/
#define VIDEO_PIX_FMT_Y8 VIDEO_FOURCC('G', 'R', 'E', 'Y')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems confused between : _PIX_FMT_Y8I and _PIX_FMT_GREY.

I think it should be:

#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sometimes have difficulties making a difference between what Linux status-quo and what Linux tries to move towards. I was borrowing Y8 from media bus.

I added a hint in the documentation that this is nothing special, just following the FOURCC naming.

* | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | rrggrrgg | ...
* @endverbatim
*/
#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'R', 'A', 'A')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FOURCC seems wrong, should be:

#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A')

ref : https://elixir.bootlin.com/linux/v6.11.1/source/include/uapi/linux/videodev2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'R', 'A', 'A')
+#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A')

ok

@josuah
Copy link
Collaborator Author

josuah commented Apr 4, 2025

Sorry about that, I think I copy-pasted the RGGB8 etc formats from Zephyr and looked at the documentation (in opposite order) for adding the FOURCC... I could have checked better... Thank you for the extra pair of vigilant eyes.

ngphibang
ngphibang previously approved these changes Apr 4, 2025
@josuah
Copy link
Collaborator Author

josuah commented Apr 4, 2025

Force-push:

  • Added a hint that GREY was the same as "Y8" to help users coming from other libraries (i.e. LVGL calls it L8)

ngphibang
ngphibang previously approved these changes Apr 4, 2025
ngphibang
ngphibang previously approved these changes Apr 8, 2025
josuah added 3 commits April 12, 2025 16:17
@verbatim shows the leading comment '*' fence in the output.
@code{.unparsed} allows extracting the text only.
In some formats, the pixels are also not immediately packed into fixed
number of bytes, like YUYV due to chroma subsampling. Disambiguate.
Add numbers marks on top to help identify the individual pixels.

Signed-off-by: Josuah Demangeon <[email protected]>
In addition to the 8-bit, introduce all the other bayer formats
described by MIPI-CSI2 specification. The 8-bit bayer formats
description is shortened to just 4 bytes like the other formats,
to help intuition while comparing the different formats.

Signed-off-by: Josuah Demangeon <[email protected]>
Add the grayscale formats in the same packing as defined by MIPI.
The Linux V4L2 naming is preserved.

Signed-off-by: Josuah Demangeon <[email protected]>
@josuah
Copy link
Collaborator Author

josuah commented Apr 12, 2025

Sorry one more doc typo! Wrong bit endianness for RAW10's continuation byte: 0 1 2 3 <-> 3 2 1 0.

I took this opportunity to dust it a bit.

@kartben kartben merged commit 90b23bf into zephyrproject-rtos:main Apr 14, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: camera area: Video Video subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants