Skip to content
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

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2871,8 +2871,14 @@ static int bcm2835_codec_queue_setup(struct vb2_queue *vq,

if (*nbuffers < port->minimum_buffer.num)
*nbuffers = port->minimum_buffer.num;
/* Add one buffer to take an EOS */
port->current_buffer.num = *nbuffers + 1;

/*
* The VPU uses this number to allocate a pool of headers at port_enable.
* We can't increase it later, so use of CREATE_BUFS is going to result
* in bad things happening. Adopt worst-case allocation, and add one
* buffer to take an EOS
*/
port->current_buffer.num = VB2_MAX_FRAME + 1;

return 0;
}
Expand Down