mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
59fa283238876dac89d077c376965b6fd80d7f39
This commit implements T264 ISP floorsweeping functionality in the Linux kernel driver, extending the existing RCE firmware implementation to provide transparent ISP unit redirection at the kernel level. Changes: - Add isp_capture_query_availability_mask_probe() function to query ISP availability mask from RCE firmware during driver probe via IVC - Add isp_capture_find_first_available() helper function to find the first available ISP unit from a bitmask for HW assignment - Integrate floorsweeping logic into isp_get_nvhost_device() to handle SW-to-HW ISP unit mapping with thread-safe assignment - Add isp_capture_get_capabilities() function to expose ISP availability to userspace via new IOCTL (ISP_CAPTURE_GET_CAPABILITIES) - Add probe-time caching of ISP availability mask to avoid repeated IVC queries during runtime - Add comprehensive error handling and safety mechanisms for unknown configurations Implementation details: - Uses CAPTURE_ISP_FUSE_QUERY_REQ/RESP IVC messages for querying RCE - Maintains SW-to-HW ISP unit mapping array protected by mutex - The SW-to-HW mappings persist for the driver's lifetime, given that multiple channels make use of the same SW unit ID's and we do not have tracking of all open channels during runtime - Integrates with existing ISP setup flow before buffer allocation - Maintains backward compatibility with non-T264 hardware - Conservative approach: blocks requests when no ISP units are available Floorsweeping logic (handled by RCE firmware, exposed as bitmask): - Mask bit N set = ISP N available (not fused off) - Mask bit N clear = ISP N fused off (unavailable) - Examples: - 0x3 (0b11): Both ISP0/ISP1 available (no floorsweeping) - 0x1 (0b01): Only ISP0 available → all requests map to ISP0 - 0x2 (0b10): Only ISP1 available → all requests map to ISP1 - 0x0: No ISP units available (block all requests) Benefits: - Transparent operation for applications using fusacapture library - Automatic ISP unit redirection without API changes - Improved hardware yield by supporting single-ISP configurations - Robust error handling and safety mechanisms - Minimal performance overhead with probe-time caching The implementation complements the existing RCE firmware floorsweeping support and provides a complete end-to-end solution for T264 ISP floorsweeping across all software layers. Bug 5640706 Change-Id: If85ee3178e857394300479dd42e636f5f5d3bd23 Signed-off-by: fraunak <fraunak@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3491180 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Evgeny Kornev <ekornev@nvidia.com> Reviewed-by: Kalle Jokiniemi <kjokiniemi@nvidia.com> Reviewed-by: Semi Malinen <smalinen@nvidia.com> Tested-by: Akihiro Mizusawa <amizusawa@nvidia.com>
Description
No description provided