Also limit call of VIDIOC_STREAMON to stateful decoder so there is no
such call before driver initializes the correct video size.Can you split this into a separate commit since it is a separate change?
Tested with H264/H265/VP8/AV1 v4l2 stateless decoder found on RK3588,I'm in PST. Tomorrow, I can do some testing on Mediatek and Qualcomm devices with your changes.
// Sends the EXT_CTRLS ioctl for 10-bit video at the specified |size|. This
// will enable retrieving the proper format from the CAPTURE queue. |size| is
// needed so that we are passing in all the information that might be needed
// by the driver to know what the format is.Nit: please update the method documentation
```suggestion
// Sends the EXT_CTRLS ioctl with the specified |size| and |bit_depth|. This
// is required by the V4L2 stateless decoder spec at 4.5.3.2. Initialization.
```
VLOGF(1) << "Need to set EXT_CTRLS at initialization";This log does not seem necessary since it happens regardless of bit depth. Can you remove it, or drop the level?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Also limit call of VIDIOC_STREAMON to stateful decoder so there is no
such call before driver initializes the correct video size.Can you split this into a separate commit since it is a separate change?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Sends the EXT_CTRLS ioctl for 10-bit video at the specified |size|. This
// will enable retrieving the proper format from the CAPTURE queue. |size| is
// needed so that we are passing in all the information that might be needed
// by the driver to know what the format is.Nit: please update the method documentation
```suggestion
// Sends the EXT_CTRLS ioctl with the specified |size| and |bit_depth|. This
// is required by the V4L2 stateless decoder spec at 4.5.3.2. Initialization.
```
Fix applied.
VLOGF(1) << "Need to set EXT_CTRLS at initialization";This log does not seem necessary since it happens regardless of bit depth. Can you remove it, or drop the level?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Also limit call of VIDIOC_STREAMON to stateful decoder so there is no
such call before driver initializes the correct video size.Jianfeng LiuCan you split this into a separate commit since it is a separate change?
Sure, I will create a separate cl for this.
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#if BUILDFLAG(IS_CHROMEOS)As discussed in crrev.com/c/6632634, AV1 can't be enabled by default. This needs to be
```
#if BUILDFLAG(USE_AV1_HW_DECODER)
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
I did some playback testing with 10-bit and 8-bit and the changes worked well on Mediatek (which uses stateless).
Thanks for the change! I have one nit-pick request which I am sorry that I didn't notice during my first read through.
// TODO(b/): Add other codecsNit: I think it is fine to drop this comment. There is no ticket for adding any other codec that we need to link. Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Nit: I think it is fine to drop this comment. There is no ticket for adding any other codec that we need to link. Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I just notice that mainline kernel is also checking flags in ctrl for av1 since v6.19: https://github.com/torvalds/linux/commit/2ce45197befbdc60f72288346c67930db3a4489e. So I add the necessary flags `V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X | V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y` for profile 0 with subsampling 4:2:0.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// TODO(b/): Add other codecsJianfeng LiuNit: I think it is fine to drop this comment. There is no ticket for adding any other codec that we need to link. Thanks!
Done
Sorry for the late response. Can you re-add the return path, but leave out the code comment?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// TODO(b/): Add other codecsJianfeng LiuNit: I think it is fine to drop this comment. There is no ticket for adding any other codec that we need to link. Thanks!
Nathan HebertDone
Sorry for the late response. Can you re-add the return path, but leave out the code comment?
Marked as unresolved.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// TODO(b/): Add other codecsJianfeng LiuNit: I think it is fine to drop this comment. There is no ticket for adding any other codec that we need to link. Thanks!
Nathan HebertDone
Nathan HebertSorry for the late response. Can you re-add the return path, but leave out the code comment?
Marked as unresolved.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
media/gpu/v4l2: Follow v4l2 stateless spec at initialization
According to v4l2 stateless decoder spec at 4.5.3.2. Initialization [1],
Userspace should send EXT_CTRLS ioctl before CAPTURE format negotiation.
But now it is only sent when decoding 10bit videos. Some kernel driver
like rkvdec has to initialize image format of CAPTURE queue from
VIDIOC_S_EXT_CTRLS before CAPTURE queue buffers are allocated.
Remove the limitation of sending EXT_CTRLS only for 10 bit videos so that
this ioctl is always sent after calling VIDIOC_S_FMT to OUTPUT queue.
Tested with H264/H265/VP8/AV1 v4l2 stateless decoder found on RK3588,
VP9 v4l2 stateless decoder found on RK3399, and H264/VP8/VP9/AV1 v4l2
stateful decoder found on Cix P1 SoC.
[1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-stateless-decoder.html#initialization
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |