Skip to content

Conversation

@djrscally
Copy link

Hello

Working with the imx500 lately, the requirement for the network weights to be passed as a file descriptor gave me some pause, as I was instead storing them as database objects which meant I'd have had to write them out before passing them to the driver. I thought that switching the interface to expect a buffer / size would be a bit more flexible and possibly also a bit more upstream friendly. I opened a pull request for the kernel to implement that: raspberrypi/linux#6904. This pull request updates rpicam-apps to use the new ioctl instead of the removed control.

Thanks
Dan

Replace the use of the custom V4L2 control for passing the network
weights file to the driver with the custom ioctl that was recently
added to the driver. This necessitates reading the file in userspace
since the driver now expects to be passed a buffer rather than the
file descriptor.

Signed-off-by: Daniel Scally <[email protected]>
struct imx500_network_weights network_weights;

network_weights.size = stat.st_size;
network_weights.data = malloc(stat.st_size);
Copy link
Author

Choose a reason for hiding this comment

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

Naturally, the moment I opened the PR I noticed that I never free this.

@naushir
Copy link
Collaborator

naushir commented Sep 8, 2025

I'm assuming this rework is halted. If not, please do reopen.

@naushir naushir closed this Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants