mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
The copyengine code to do big transfers or memsets supports a 64-bit size. Each copy is done as a rectangle with either side being at most 2GB, so a size that does not align nicely is split into multiple ops. It turns out that there are at most two of these ops, so structure the code to not loop but do two ops explicitly. The first copyengine operation works with the first chunk that is less than two gigabytes long. That leaves the remaining size to be a multiple of two gigabytes, so it's sufficient to do just another operation as a 2D rectangle whose width is two gigabytes; the remaining size determines the height, i.e. the number of two-gig lines. The loop did just this already, but now with at most two operations per submit the required pushbuf length is seen more easily from the code. Jira NVGPU-5172 Change-Id: I6bca3b1204db3b79e131898c07018a1337d85774 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2402028 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>