Commit Graph

18 Commits

Author SHA1 Message Date
Arvind M
4bf26c4247 host1x-emu: kmd: Add support for ACPI
This change enable device probing for ACPI device.

Bug 5011544

Change-Id: Ibfc85be18b0d73e813f68c699e4baa3de9682b5d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3276952
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
(cherry picked from commit bbfa4c3afd2dd3856b01be1b15c3023549dd079b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3272347
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Ayush Kumar <ayushk@nvidia.com>
Reviewed-by: Amitabh Dutta <amitabhd@nvidia.com>
Reviewed-by: Vishal Thoke <vthoke@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:20:18 +00:00
Jon Hunter
a59a10dfeb drivers: Update timer APIs for Linux v6.15
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:18 +00:00
amitabhd
26b29860fd host1x_emu: DT Property based syncpoint memory
This change uses DT property to select syncpoint memory.
If property "syncpoints-mem" is defined hypervisor syncpoint
memory mechanism is used. Otherwise memory is allocated from
guest kernel.

Previously this was based on code level MACRO. Changing it to
DT simplify selection of syncpoint memory.

Jira HOSTX-5982

Change-Id: I5e26ef2d42d5d01d6aff0f2b43fd11c23218057d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3329245
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
Tested-by: Amitabh Dutta <amitabhd@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Amitabh Dutta <amitabhd@nvidia.com>
2025-07-24 10:19:17 +00:00
amitabhd
d460bf1928 host1x_emu: Support host1x dispatch api in DLA.
Add change to enable host1x dynamic dispatch api
provided by host1x-fence module.

Bug 5064819

Change-Id: Ibad4a6741d9a8227fc6c0098c83a1ed6ec0cc09a
signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3310175
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Mainak Sen <msen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
2025-07-24 10:19:17 +00:00
Mainak Sen
261488ef83 gpu: host1x-emu: Add host1x_syncpt_get_shim_info
Implement host1x_syncpt_get_shim_info function for
host1x-emu driver and add it to the dynamic dispatch
mechanism in host1x-fence.

This function provides clients with the physical address
of syncpoint aperture, stride and number of
syncpoints, which is needed by various client drivers
like ISP, VI, PVA, GPU etc

Jira HOSTX-5971

Change-Id: I50e60222a035228c981dfa993cb0088e1d15dad2
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3323327
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: Amitabh Dutta <amitabhd@nvidia.com>
2025-07-24 10:19:17 +00:00
amitabhd
2cc3c99c6e host1x_emu: Adding API dispatch functionality
Adding dynamic APi dispatch functionality in host1x-fence
modue. This CL exports new host1x wrapper API, which can
be called by client kernel modules. The wrapper API dispatch
call to either Host1x module or Host1x-EMU depending if the
host1x-emu driver registered its interface during its probe.

Bug 5064819

Change-Id: I49445cdce7c3795a2c94fde9d0871da393993554
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306857
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2025-07-24 10:19:15 +00:00
amitabhd
909b489e87 host1x_emu: Fence polling modification
In simulation platform enabling hrtimer fence polling
is causing kernel to block/unresposive.

This issue is not observed in sillicon platforms.
As per this CL making following changes.

1. Added flag for kernel Thread polling.
2. Enabling HRTimer fence polling for silicon platform.
   only.

Bug 5094695

Change-Id: I011900e9299be71413c92952d447e53abfd34128
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297995
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:15 +00:00
amitabhd
090b44a9f1 host1x_emu: Enable event-service for Host1x-EMU
Add change to host1x-fence kernel module to support
its functionality over host1x-emu driver.

Jira HOSTX-5818

Change-Id: I09c7f2ee2059e0eeee11429b059c5152ffd855d5
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3285249
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:15 +00:00
Martin Radev
bbf4752022 host1x_emu: fix syncpoint 0 WAR
This patch fixes the existing WAR to not allocate
syncpoint id 0. The bug was that indexing starts
from 1, but syncpoint array starts from 0. The fix
is to start syncpoint array iteration from 1 as
well.

Bug 5064819

Change-Id: I4120d83dd33ef134d80417dcf9e1c75b55b99719
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3287523
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Tested-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Amitabh Dutta <amitabhd@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:14 +00:00
amitabhd
d31f4870be host1x_emu: Fix symbol-emu header.
If the flag "CONFIG_TEGRA_HOST1X_EMU_DBG_SYMBL" is
disabled it cause build failure.

Jira HOSTX-5527

Change-Id: I540a1d4e658fac065880d55974d00cd9c3df7b00
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3289217
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2025-07-24 10:19:14 +00:00
amitabhd
0f04d6c204 host1x_emu: HR Timer Syncpoint Fence Polling
1. This change enable HR Timer Syncpoint polling and
disable the thread based fence polling.

2. Default timer interval is 200usec. The timer value
is taken from DT. If the timer interval in DT is less
then 50usec, default timer interval is taken.

Jira HOSTX-5527

Change-Id: I6644f1362f28a8901e4e384f1290be9807c30036
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268636
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:13 +00:00
amitabhd
a2dba7e53b host1x_emu: SyncpointIncre per-improvement
1. Add mechanism(s) to trigger syncpoint fence scan when
syncpoint increment UMD called. Following methods are added.
 - METHOD-1: Check fence expire in user context when syncpoint
   increment  UMD API is  called.
 - METHOD-2: Add tasklet based mechanism that schedule tasklet to scan for
   syncpoint fence expiry. This also improve signaling latency.

   METHOD-1 is enabled by default, to enable METHOD-2 define MACRO
   "HOST1X_EMU_SYNC_INC_TASKLET".

2. Add interface "host1x_syncpt_fence_scan()" that can be called from
   client interrupt handler to initiate syncpoint fence scan.

Jira HOSTX-5527

Change-Id: I4d5a0ba9fd67042d824a1df2794b316831001dc4
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267144
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: Sanif Veeras <sveeras@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
2025-07-24 10:19:13 +00:00
amitabhd
8e20f0d104 host1x_emu: Fix Host1x_EMU devnode permission
Set R/W permission for group and others.

Bug 5019709

Change-Id: Ia007623c891a10669ba92ab4de1d50a1d4f7ce9f
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3271151
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
amitabhd
d1d3b883df host1x_emu: Fix NvHost Interface and IOCTL
1. The nvhost interface like syncpoint offset/aperture were
taking "pdev" of Host1x device, but emulated syncpoint driver
implementd the interface with "pdev" of clinet device. This was
done to align all other interface input parameter.

This patch revert the above alignment of intput parameter change.

2. This patch modify SyncpointWait IOCTL handler to return timestamp
of signal observed by KMD to UMD

Bug 4895937

Change-Id: I61ba02992963ba272e5c2514ffe8c24fff510c3a
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3226744
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2025-07-24 10:19:11 +00:00
amitabhd
d5573ecc31 host1x_emu: Fix fence object memory leak
Set release callback function for dma_fence
object to release struct host1x_syncpt_fence.

Jira HOSTX-5546
Bug 4919054

Change-Id: I0f06fc6e4b1d1b38f56c779898fb09990364cc87
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3260748
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: Sanif Veeras <sveeras@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
33ffbe3ff2 gpu: host1x-emu: Fix build for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update the host1x-emu drivers
as necessary to fix this.

Bug 4749580

Change-Id: I9b4bddd4ae57087c34ce34cea7e8b54b14d4793c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3202780
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:07 +00:00
amitabhd
872cead7b6 host1x: Emulated Syncpoint KMD Driver
1. Update Host1x-Syncpt
   - add syncpt-list in syncpoint-pool structure.
   - add exported "host1x-syncpt-*" interface and supporting private interface.
2. Update Host1x-NvHost
   - add support for nvhost-syncpt and nvhost-client interface and supporting private interface.
   - falcon and pm interface not supported
3. Update Host1x-Fence
   - add exported "host1x-fence-*" interface and supporting private interface.
4. Add Host1x-Poll
   - Per Pool polling workequeue created
   - add poll supporting private interface.
5. Add new IOCTL

Jira HOSTX-5514

Change-Id: I187fa7ed89a3479e51b79f9d8d438ede75e1a36a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3136834
Tested-by: Amitabh Dutta <amitabhd@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Amitabh Dutta <amitabhd@nvidia.com>
2025-07-24 10:18:57 +00:00