Commit Graph

12 Commits

Author SHA1 Message Date
Jon Hunter
233a7eb320 drivers: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
(cherry picked from commit ab65399274)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063003
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 13:55:11 -08:00
Mikko Perttunen
41c454c6e4 gpu: host1x-fence: Skip over stub fences
Since kernel 6.1, merging SYNC_FILE FDs will coalesce
signaled fences into a stub fence - no longer a host1x
fence. To avoid breakage on userspace side, detect such
situations here and instead of returning an error, omit
such fences when processing.

Bug 4199972

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I22451ffa22c388bbeeb3528e4760730c3f83bc1b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002691
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-24 23:58:02 -07:00
Jon Hunter
ce678a37b1 drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.

Bug 4183168
Bug 4221847

Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:54:05 -07:00
Jon Hunter
ae64ed46c8 gpu: host1x: Add conftest support
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. This
is beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work.

Bug 4119327

Change-Id: I56281fa5d95862338bd8a43d6e22225c27590462
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984422
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:27 -07:00
Johnny Liu
6323c46280 gpu: host1x-fence: Share host1x compatible string
Same compatible string can be shared between host1x_next and
host1x_fence kernel modules so that those two modules will get
automatically loaded.

Bug 4291144

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Icf8b3fce960318c129194330c694e47826c440ee
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983673
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:22:03 -07:00
Shardar Mohammed
4be2dd36bb nvidia-oot: remove module * from class_create()
Remove the module pointer from the class_create() based
on following change in core kernel

======
driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something.  So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====

Bug 4276500

Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-08 18:09:50 -07:00
Mikko Perttunen
0898aa355a gpu: host1x-fence: Multiple triggers for pollfd
Allow multiple simultaneous triggers for pollfd, as is
required by CUDA.

Bug 3960834
Bug 4011607
Jira HOSTX-4670

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I69479551f5f56cfb565699123ced35d844423703
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2872368
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-22 18:53:57 -07:00
Jon Hunter
ee4413e974 gpu: host1x-fence: Fix build for Linux v6.2
Upstream Linux kernel commit ff62b8e6588f ("driver core: make struct
class.devnode() take a const *") updated the 'devnode' function pointer
under the class structure to take a const device struct. This breaks
building the Tegra host1x-fence driver with Linux v6.2. Make the
necessary changes to the host1x-fence driver to fix the build breakage.

Bug 3936429

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: Ia7abb62424c9532342a16ca7b5e8470e96b91d25
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2841034
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-11 11:26:51 -08:00
Mikko Perttunen
e2b55e1a2c gpu: host1x-fence: Add Tegra234 compatible string
To allow detection of host1x instances on Tegra234, add the
corresponding compatible string.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Idf3259403793faeedd467e3b3fd012acb468e608
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2823261
Reviewed-by: Deepak Kumar Badgaiyan <dbadgaiyan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Deepak Kumar Badgaiyan <dbadgaiyan@nvidia.com>
2022-12-12 15:06:29 -08:00
Mikko Perttunen
f4a3e6b49a gpu: host1x-fence: Add pollfd support
Add support for pollfds, which are essentially file descriptors
with SYNC_FILE polling characteristics but that can have new
fences assigned to after the previous expires.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I6471720089041d3cc72dfaf2d1de221d80d28c27
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2806032
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-24 18:08:56 -08:00
Mikko Perttunen
6da4ac36e6 gpu: host1x-fence: Adapt for change in host1x_fence_create
Add 'true' parameter to enable internal timeout since there is no
external cancellation mechanism.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I6ff40e7a38a6273cfa4ee07c2a347636f5f0ecc5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2786639
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-27 11:55:13 -07:00
Mikko Perttunen
5b33382ce2 gpu: Add host1x-fence driver
Add driver for implementing an UAPI for conversion between
SYNC_FILE FDs and raw syncpoint ID / value pairs.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I54e30877f782e3e67ca91e09589d0c4862a257cd
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2729238
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-05 14:30:11 -07:00