-
Notifications
You must be signed in to change notification settings - Fork 7.9k
video: stm32: dcmipp: addition of (semi)planar format support #94081
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
video: stm32: dcmipp: addition of (semi)planar format support #94081
Conversation
80c3b9c
to
0108872
Compare
Added NV24/NV42 as well |
Mark the PR as Ready for review now that I have validated all 6 formats the DCMIPP can output (NV12/NV21/NV16/NV61/YUV420/YVU420) |
Tested OK on N6 for NV12 with #92884 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor comment on format documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see this coming.
A few suggestions for how to improve it just a bit, though all can be done in the future as well.
0108872
to
85c17b2
Compare
@ngphibang @josuah , I've only updated the video.h header with the formats description for now. |
85c17b2
to
d7d223e
Compare
@josuah, @ngphibang, Sorry for the delay in the update. Hopefully fixed all open points. |
#define VIDEO_FMT_IS_SEMI_PLANAR(fmt) \ | ||
(((fmt)->pixelformat == VIDEO_PIX_FMT_NV12 || \ | ||
(fmt)->pixelformat == VIDEO_PIX_FMT_NV21 || \ | ||
(fmt)->pixelformat == VIDEO_PIX_FMT_NV16 || \ | ||
(fmt)->pixelformat == VIDEO_PIX_FMT_NV61) ? true : false) | ||
|
||
#define VIDEO_FMT_IS_PLANAR(fmt) \ | ||
(((fmt)->pixelformat == VIDEO_PIX_FMT_YUV420 || \ | ||
(fmt)->pixelformat == VIDEO_PIX_FMT_YVU420) ? true : false) | ||
|
||
#define VIDEO_Y_PLANE_PITCH(fmt) \ | ||
((VIDEO_FMT_IS_PLANAR(fmt) || VIDEO_FMT_IS_SEMI_PLANAR(fmt)) ? \ | ||
(fmt)->width : (fmt)->pitch) | ||
|
||
#define VIDEO_FMT_PLANAR_Y_PLANE_SIZE(fmt) ((fmt)->width * (fmt)->height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these go into video.h so that others could use ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have actually been wondering about that yesterday when I wrote them, however, this would potentially put a penalty for a driver which only implement say NV12 / NV21 since this would lead to checking for more pixelformat than the driver can actually support. Hence I kept this within the driver to only check what is applicable.
That said, the name of the macro might be better with a more "STM32" specific name since current name make it think that this is a generic function ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right ! Other drivers may just support one or two formats and even don't need a macro. The name is Ok I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the build preview, there seems to be a few doc glitches:
https://builds.zephyrproject.io/zephyr/pr/94081/docs/doxygen/html/group__video__pixel__formats.html
Solved by adding extra @code{.unparsed}
and @endcode
.
Other than that, I did not find any issue.
Thank you for the modifications!
Add description and fourcc define for some of the 2 and 3 planes pixel formats. Signed-off-by: Alain Volmat <[email protected]>
ISP is part of the pixel pipes hence it doesn't make any sense to try to call ISP external handlers if the DCMIPP doesn't have pixel pipes available. Signed-off-by: Alain Volmat <[email protected]>
Add support for NV12/NV21, NV16/NV61 and YUV420/YVU420 (semi)planar formats which can be output by the main zephyrproject-rtos#1 pipe. Signed-off-by: Alain Volmat <[email protected]>
d7d223e
to
e466f62
Compare
|
The STM32 DCMIPP pipe 1 (main) is able to generate semi planar and planar formats such as NV12/NV16 or YUV420.
This PR adds definition of those formats as well as their description in the API header and add their support within the dcmipp driver.