Skip to content

postproc: imx500: Use new ioctl for network weight loading #825

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 <dan.scally@ideasonboard.com>
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.

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.

1 participant