-
Notifications
You must be signed in to change notification settings - Fork 5k
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
vc04_services: codec: Allocate the max number of buffers on the VPU #6348
Conversation
The VPU's API can't match the use of VIDIOC_CREATE_BUFS to add buffers to the internal pool whilst a port is enabled, therefore allocate the maximum number of buffers possible in V4L2 to avoid the issue. As these are only buffer headers, the overhead is relatively small. Signed-off-by: Dave Stevenson <[email protected]>
@JamesH65 from our discussion. |
Feedback from @jc-kynesim would be nice, but I could be persuaded to merge this now. |
I was waiting for the same. ... And have just had an email from John
Merge away. |
Seems good to me - I am just running the exact same test I gave you, and apart from the caveat above it seems good. Doesn't break vlc either. |
Logging it for my own info, each buffer adds 656 bytes to the allocation, so we've probably added 40kB per decode instance (~30 extra buffers on each of 2 queues). That doesn't seem to extreme to me. |
Even if that is GPU memory (and I assume it is?) that seems completely survivable to me. I guess there may be someone somewhere running 16 decodes of tiny video but that is still only +640k which seems entirely reasonable to me. |
It's VPU non-relocatable heap. |
See: raspberrypi/linux#6371 kernel: drm: vc4: Fix interpolate bit for nearest neighbour filter See: raspberrypi/linux#6364 kernel: drm: panel: ili9881: Correct symmetry on enable/disable return codes See: raspberrypi/linux#6360 kernel: vc04_services: codec: Allocate the max number of buffers on the VPU See: raspberrypi/linux#6348 kernel: ASoC: add the HiFiBerry 8-channel ADC soundcard See: raspberrypi/linux#6353
See: raspberrypi/linux#6371 kernel: drm: vc4: Fix interpolate bit for nearest neighbour filter See: raspberrypi/linux#6364 kernel: drm: panel: ili9881: Correct symmetry on enable/disable return codes See: raspberrypi/linux#6360 kernel: vc04_services: codec: Allocate the max number of buffers on the VPU See: raspberrypi/linux#6348 kernel: ASoC: add the HiFiBerry 8-channel ADC soundcard See: raspberrypi/linux#6353
The VPU's API can't match the use of VIDIOC_CREATE_BUFS to add buffers to the internal pool whilst a port is enabled, therefore allocate the maximum number of buffers possible in V4L2 to avoid the issue. As these are only buffer headers, the overhead is relatively small.
@jc-kynesim. This fixes up the kernel splats in your test case.
I do still get the error
after the first couple of loops. That's a funny one, but likely down in the codec rather than framework. Yet more logging required.