Commit Graph

10 Commits

Author SHA1 Message Date
Santosh BS
32221411a4 gpu: host1x: add .signaled op for host1x_syncpt_fence_ops
Add a callback function host1x_syncpt_fence_signaled() to
.signaled op under host1x_syncpt_fence_ops.

.signaled is a optional operation. The change here is a performance
improvement and acts as temporary workaround for sync_file code not
calling enable_signaling.

Bug 4085239

Change-Id: Ief19c2d9af3f504bb1a067bfc9a31b9ef2ecd8fc
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2935867
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-20 01:10:50 -07:00
Mikko Perttunen
a351c7681e gpu: host1x: Timestamp syncpoint wait completions
Collect CLOCK_MONOTONIC timestamps in the interrupt handler when
a syncpoint wait completes, and report it back in dma_fences and
syncpoint wait UAPI.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I9f783833698df7d96c99c9ffef3205aa82adceb5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2801167
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
25f41bc212 gpu: host1x: External timeout/cancellation for fences
Currently all fences have a 30 second timeout to ensure they are
cleaned up if the fence never completes otherwise. However, this
one size fits all solution doesn't actually fit in every case,
such as syncpoint waiting where we want to be able to have timeouts
longer than 30 seconds. As such, we want to be able to give control
over fence cancellation to the caller (and maybe eventually get rid
of the internal timeout altogether).

Here we add this cancellation mechanism by essentially adding a
function for entering the timeout path by function call, and changing
the syncpoint wait function to use it.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I4600544afe21efdd3f7d06362bd124130ddec3db
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2786637
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
33a40367c0 gpu: host1x: Rewrite syncpoint interrupt handling
Move from the old, complex intr handling code to a new implementation
based on dma_fences. While there is a fair bit of churn to get there,
the new implementation is much simpler and likely faster as well due
to allowing signaling directly from interrupt context.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I81c47fa1946679813f90e3fd8e1d1e9d6342143e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2786635
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 12:36:25 +00:00
Jon Hunter
9edef092b1 gpu: host1x: Update to Linux v5.19-rc1
Update the host1x driver to align with the latest upstream host1x
driver from Linux v5.19-rc1. Please note that the context bus support
is not included, because this needs to be built into the kernel.

Bug 3724727

Change-Id: Ic6fbe001462d160d1bb24f76038dd755c5550690
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2739538
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
45652ce93f gpu: host1x: Restore host1x_fence_extract
host1x_fence_extract is currently not in upstream due to no upstream
callers, but nvgpu needs it, so restore it here for now.

JIRA LS-128

Change-Id: Ie2ccf6380e4bf506378a04bc8fd894c7ca7414c6
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653093
GVS: Gerrit_Virtual_Submit
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
65b76aee13 gpu: host1x: Merge upstream changes
Merge upstream changes from linux-next, including merged version
of new UAPI.

JIRA LS-128

Change-Id: I32c6745d2c17902e8216e9b376fd74d38a3b5904
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653092
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00
Thierry Reding
d42946f160 gpu: host1x: Plug potential memory leak
The memory allocated for a DMA fence could be leaked if the code failed
to allocate the waiter object. Make sure to release the fence allocation
on failure.

Change-Id: Ie5608246225f17883d005b7975bed1ca4742b321
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2604935
(cherry picked from commit 3142088147c0a8b69cd692405c98a9cdb96b6006)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2605432
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00
Jon Hunter
27ced8b315 gpu: host1x: Update to UAPI series v5
Update the host1x driver to the 'Host1x/Tegra UAPI v5' series [0]. This
fixes a few minor bugs found in the previous series.

[0] https://patchwork.ozlabs.org/project/linux-tegra/list/?series=223684

Bug 200687525

Change-Id: I680bfb9e8db73b9e2571551f22fadca1f2974498
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2469983
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00
Jon Hunter
cc5bcef3f6 gpu: host1x: Add upstream host1x driver
Add the upstream host1x driver with the 'Host1x/Tegra UAPI' series [0]
applied. This driver will be built as an external module for use with
the NVGPU driver on upstream Linux kernels.

The following modifications have been made to the series posted upstream
1. Update the Makefile to always build the driver as a module
2. Remove the tests to see if CONFIG_DRM_TEGRA_STAGING is enabled
3. Rename the include/linux/host1x.h to include/linux/host1x-next.h to
   avoid conflicts with upstream headers when building as an external
   module.
4. Rename the include/uapi/linux/host1x.h to
   include/uapi/linux/host1x-next.h to avoid conflicts with upstream
   headers when building as an external module.
5. Rename the module that is built to be host1x-next.ko instead of
   host1x.ko to avoid any depmod conflicts with the upstream driver.

[0] https://patchwork.ozlabs.org/project/linux-tegra/list/?series=215770

Bug 3156385

Change-Id: Ic60299546809097dd0e4a9a7157bce1491d9f794
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2435801
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00