Commit Graph

435 Commits

Author SHA1 Message Date
Jon Hunter
d814c113bb drm/tegra: Fix build for Linux v6.17
The arguments to the function drm_helper_mode_fill_fb_struct() and
function pointer fb_create() have been updated in the Linux v6.17. Add
the necessary conftest tests to check for the new variants of these
functions and update the Tegra DRM driver accordingly.

Bug 5420210

Change-Id: Ie1470df199d154d3f94f5f7773dcc1ba138e23da
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423828
(cherry picked from commit dde42d012e4187e798d5d7c3cfa974f49059d0a1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462462
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-02 10:13:45 -07:00
Jon Hunter
e004561637 drm/tegra: Update to Linux v6.16-rc1
Update the Tegra DRM driver to Linux v6.16-rc1. In Linux v6.16-rc1, the
drm_dp_link_power_up/down functions were moved from the Tegra DRM driver
into the main DRM code. Conftest is used to detect this change and the
appropriate updates are made to the Tegra DRM driver.

JIRA LINQPJ14-60

Change-Id: Id5449b22e8eda5ee70eb6aed09ce627e63e7722e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375214
(cherry picked from commit f8adc0c950eb4905d397b6e1d8e524b856945f0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461883
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-01 15:28:42 -07:00
Ivan Raul Guadarrama
fab00a954b drm/tegra: vic: Update FW code section size
Increase the size of the code section by 256 bytes.

Jira EGFX-16888

Change-Id: I86d8d32ebd7ffd25270bf3f4ab25f08244fe940d
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3370316
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:20:35 +00:00
Mainak Sen
3137fbd9b4 gpu: host1x: Fix race in syncpt alloc/free
Fix riace condition between host1x_syncpt_alloc()
and host1x_syncpt_put() by using kref_put_mutex()
instead of kref_put() + manual mutex locking.

This ensures no thread can acquire the
syncpt_mutex after the refcount drops to zero
but before syncpt_release acquires it.
This prevents races where syncpoints could
be allocated while still being cleaned up
from a previous release.

Remove explicit mutex locking in syncpt_release
as kref_put_mutex() handles this atomically.

Bug 5170956

Change-Id: I9e2348482d5c9646556576772f6b90fa7df3acd2
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369121
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:20:35 +00:00
Mainak Sen
cfb3723972 gpu: host1x: Add dma_fence_chain support
Enhance IOCTL handler to identify and
handle dma_fence_chain objects that might contain
host1x dma fences. This fixes issues
when userspace passes a dma_fence_chain
(created by DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT
operations) to HOST1X_IOCTL_FENCE_EXTRACT.

The updated code iteratively unwraps fence
chains until it finds a host1x_syncpt_fence or
reaches a fence it can't process. This ensures
proper operation with DRM-based applications
that use timeline syncobj features which internally
use dma_fence_chain.

Bug 4983872

Change-Id: I3eef9d54e2c42180cb5c74236cd64f42a863b7ea
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3364940
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Tested-by: Arunmozhikannan Soundarapandian <asoundarapan@nvidia.com>
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
2025-07-24 10:20:35 +00:00
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
Mainak Sen
f0404e50f6 drm: tegra: Disable TEGRA_SYNCPT_INCR IOCTL for T264 platform
Conditionally disabled the legacy TEGRA_SYNCPT_INCR IOCTL for T264
platforms since it's no longer needed. This IOCTL is superseded by the
newer TEGRA_SYNCPOINT_INCREMENT IOCTL which provides better functionality
and follows the modern API design.

The conditional compilation helps reduce the attack surface on T264
platforms by removing legacy code paths that aren't needed.

Use CONFIG_ARCH_TEGRA_264_SOC as the proper platform-specific flag
to identify T264 platforms, as this is the standard architecture flag
used throughout the codebase.

This change affects:
1. The IOCTL definition in the tegra_drm_ioctls table
2. The IOCTL handler function implementation

This improves code cleanliness by removing unnecessary legacy code
on newer platforms while maintaining backward compatibility for
older platforms that might depend on this IOCTL.

Bug 5060574

Change-Id: Idd21d69ebd992f976770016b5805f7d6af89c88d
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3342657
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:19 +00:00
Jon Hunter
22336de810 drm/tegra: Update to Linux v6.15-rc3
Update the Tegra DRM to align with Linux v6.15-rc3. In Linux v6.15-rc3,
the arguments of the 'mode_valid' function pointer of the
drm_connector_helper_funcs structure and the 'atomic_async_check'
function pointer of the drm_plane_helper_funcs structure were updated.
Add conftest tests to detect these updates and make the necessary
changes to the Tegra DRM driver.

JIRA LINQPJ14-47

Change-Id: Id1c8db95390f02258952da78af3dd6ff5acfa631
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333838
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Mainak Sen
31b5b5d17a gpu: nvhost-host1x: Move nvhost_get_* APIs to header file
deprecate definition of below APIs from host1x-nvhost.ko -

nvhost_get_default_device
nvhost_get_host1x_device
nvhost_get_host1x

Bug 5176225

Change-Id: I72c3aae62fbc8c297a3871a9337562fe3998621b
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3342019
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Vamsee Vardhan Thummala
05fdb35d8e gpu: host1x: Allow loading tegra-drm without enabled engines
Add support to load tegra-drm without any engine
enabled under host1x node.

Add support to register host1x devices without
requiring subdevices. This ensures syncpoint
functionality remains available even when engine
subdevices are not present.

Bug 5055946

Change-Id: I18076391e37e01926b621bb8f3e19f72f62d2533
Signed-off-by: Vamsee Vardhan Thummala <vthummala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306748
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19: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
Jon Hunter
3ad90175d1 drm/tegra: Update to Linux v6.14
Update Tegra DRM to align with Linux v6.14. The 'drm_client_setup.h' was
moved from the directory 'include/drm/' to 'include/drm/clients' and use
conftest to detect where it is located.

JIRA LINQPJ14-47

Change-Id: I1f1df6da4400e74d2f97926710ac0ddd5e6413e6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333837
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:17 +00:00
Jon Hunter
540737a228 drm/tegra: Update to Linux v6.13
Update the Tegra DRM driver to align with Linux v6.13. A function
pointer 'fbdev_probe' was added to the drm_driver structure in Linux
v6.13 and so use conftest to detect this and make the necessary changes
to the Tegra DRM driver.

JIRA LINQPJ14-47

Change-Id: I0120fe9f13bc39446ce4e0a8827eb5d8b42a082c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333836
Reviewed-by: Mikko Perttunen <mperttunen@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>
2025-07-24 10:19:17 +00:00
Jon Hunter
6be033ba85 drm/tegra: Update to Linux v6.12
Update Tegra DRM to align with Linux v6.12. The output.c driver was
updated to use the 'drm_edid_connector_add_modes()' function that was
first added in Linux v6.3. Use conftest to detect the presence of the
drm_edid_connector_add_modes() function and make the necessary changes
to the driver.

JIRA LINQPJ14-47

Change-Id: I0ff45ef0ada2f2c2353c1ba579c06ae06122727c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333835
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Jon Hunter
13834d4e13 drm/tegra: Update to Linux v6.8
Update the Tegra DRM driver to align with the upstream Linux v6.8 kernel
preserving all the downstream changes that still need to be upstreamed.

JIRA LINQPJ14-47

Change-Id: If0a9149bcfa2fd6276ac8100933abc3d532a5ddc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333320
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Jon Hunter
8a28999d28 drm/tegra: Drop kernel version checks
Drop the kernel version checks from Tegra DRM because these are only
needed for pre-Linux v6.x kernels and these are no longer supported.

JIRA LINQPJ14-47

Change-Id: Ie5190eec6f3e37b477ae2ad84f2ef2f3ed9c3d8a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3333319
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Mainak Sen
585f64d7df gpu: host1x: Add syncpoint name and process name in syncpt_load
Update syncpt name and process info
in debug log.

Bug 5170956

Change-Id: Ie7db05a60b95febcdc645fe406297e09ad97976f
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330491
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +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
970fbbcc73 gpu: host1x: Fix type casting in debug_hw.c
Fix a CERT-C Expression violation (CERT EXP39-C)
by properly casting the mapped pointer to
u32* when passing it to show_gather() function.
This ensures type compatibility between the
function parameter and the actual object
being accessed.

Fixes CID 12627322

Jira HOSTX-5971

Change-Id: I8a7224b46f4e36582a06d6d6ee1ba21da18fe43c
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3324442
Reviewed-by: Vamsee Vardhan Thummala <vthummala@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2025-07-24 10:19:17 +00:00
Mainak Sen
3b36d6b76f gpu: host1x: Fix NULL pointer dereference in job allocation
Fix NULL pointer dereference when num_unpins is 0,
which causes job->addr_phys to be NULL. In this
case, the code was incorrectly trying to set
job->gather_addr_phys to &job->addr_phys[num_relocs],
which would dereference a NULL pointer.

Add proper NULL checks to prevent this issue
both during allocation and when
using job->gather_addr_phys throughout the code.

Fixes CID 12627383:
- CERT-C Expression (CERT EXP34-C)
Fixes CID 12627953:
- Explicit null dereferenced (FORWARD_NULL)

Jira HOSTX-5971

Change-Id: If417ec5b5431a4f4b716ca73ddf279c9b0336c94
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3324441
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Vamsee Vardhan Thummala <vthummala@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@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
praagarwal
4a4300f0e8 gpu: host1x: address INT30-C cert violations
add checks for integer overflow in job.c

Jira HOSTX-5889

Change-Id: Id3336c5c390f2ce771492a686a57e47cc9adf9d2
Signed-off-by: Prateek Agarwal <praagarwal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3299139
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:17 +00:00
Vamsee Vardhan Thummala
15f9feb564 drm/tegra: Remove PM from virtual engine
Remove power management functionality from virtual engine driver
as it's no longer needed. This includes suspend/resume operations
and PM ops structure. The driver now relies on system's default
power management behavior.

Jira HOSTX-5933

Change-Id: I092bfa8e2a01345e149ff2c04ed526a0aa7a0944
Signed-off-by: Vamsee Vardhan Thummala <vthummala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322473
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Mainak Sen
bfe763841a gpu: host1x: Deprecate falcon implementation from host1x driver
This commit deprecates the falcon hardware interface implementation from the host1x-nvhost driver.

falcon_exit() function will be deprecated once usage of
nvhost_module_deinit API is removed from PVA/DLA/Camera elements.

Jira HOSTX-5933

Bug 4918838

Change-Id: I268836c8c8fc2f1ab060412bb4446c7080f846c4
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311319
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Sanif Veeras <sveeras@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
praagarwal
4651a49da8 drm/tegra: address INT30-C cert violations
add integer overflow checks with error handling

Jira HOSTX-5889

Change-Id: Ib31763ab073c2f9b13e2f54fd3c006d977215941
Signed-off-by: Prateek Agarwal <praagarwal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301055
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Mainak Sen
37189ffbdd drm/tegra: Deprecate Legacy DRM IOCTLs
*. TEGRA_OPEN_CHANNEL
*. TEGRA_CLOSE_CHANNEL
*. TEGRA_SYNCPT_WAIT
*. TEGRA_SYNCPT_READ

Jira HOSTX-5843

Change-Id: If1a047c5fdf86a60074e31e92eaef3397f4dce01
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3315044
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Mainak Sen
7c0ab66c2a drm/tegra: Disable power mode change
Compile out Power mode change related functionality
under CONFIG_TEGRA_HOST1X_POWERMODE_CONTROL flag.
This flag is currently disabled in 7.0 release
and expected to enabled in 7.2 release.

Jira HOSTX-5933

Change-Id: I7f35c67950e8684927bfdbd99c716cfaa580cb19
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311122
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vamsee Vardhan Thummala <vthummala@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2025-07-24 10:19:16 +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
Mainak Sen
db0d9da92f drm/tegra: Fix Engine timestamp shift factor
In Orin and previous chipsets, engine timestamp counter
runs 32 times faster than CNTVCT register, so the actual
timestamp is obtained by right shifting with factor of 5.
In Thor onwards, this shift is not required is for VIC engine.

Jira HOSTX-5905

Change-Id: I69980fdfcf50b15db99b1fbad522aecd571a0f17
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306825
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Mainak Sen
b45d59c4a6 gpu: host1x: Enable VI syncpoint pool
Create VI specific syncpoint pool based on
PCT configured VI syncpoint range. VI module shall
allocate syncpoint only from this pool.

Jira HOSTX-5827

Change-Id: I2d6014de2033f0878492d0243010cc7ca507c383
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3290562
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@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
Santosh BS
71c53e0ff0 drm/tegra: set CONFIG_TEGRA_DRM_NATIVE_DIS for emb-linux
Set export variable and build config flag, CONFIG_TEGRA_DRM_NATIVE_DIS,
based on emb-linux platform identifier flag NV_OOT_NVHOST_NATIVE_DIS.

Jira HOSTX-5885

Change-Id: I43d3c08a8494fb25524e4b4a91eb2eb68b3526f2
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297034
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
b577e6d0e9 gpu: host1x: form u64 address for shim address
Store u64 shim address from u32 array fetched from DT.

Jira HOSTX-5885

Change-Id: Icf332585c095f81fadfc05b35cc77b16e6ab3a88
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298399
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Akihiro Mizusawa <amizusawa@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
aa7bcad3cf gpu: host1x: move actmon specific code under CONFIG_PM_DEVFREQ
Move actmon.c file under CONFIG_PM_DEVFREQ and
stub the functions when it is not enabled.

Jira HOSTX-5885

Change-Id: I8e6f86c617061587e4034a184f9a7d82a41a4a03
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297630
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Jon Hunter
2a4ac9e68f drm/tegra: Fix build for Linux v6.14
In Linux v6.14, the 'date' field was removed from the 'drm_driver'
structure. Add a test to conftest to detect this and update the Tegra
DRM driver accordingly.

Jira LINQPJ14-6

Change-Id: Ia3024321f12f8448d382deba996407f9d3232567
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297069
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
df285efd88 drm/tegra: move debug support under CONFIG_DEBUG_FS
Move debug specific code portions in virt.c under CONFIG_DEBUG_FS
config.

Jira HOSTX-5885

Change-Id: Icd90deb7c556ce100c0ee61d69719bde902514d5
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3295412
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
ebe01a47a3 drm/tegra: move tegra iommu domain support under CONFIG_TEGRA_IOMMU_SMMU
Tegra iommu domain is used in legacy chips (<= T210).
Move the related codes under CONFIG_TEGRA_IOMMU_SMMU accordingly.

Jira HOSTX-5833

Change-Id: I1e1e1dab33935b8881b905574ee006bbe8fc61d9
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293445
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:14 +00:00
Mikko Perttunen
92ed8780d2 drm/tegra: Add new syncpoint increment IOCTL
Add new syncpoint increment IOCTL in line with the new channel/
syncpoint IOCTLs, that only allows incrementing owned syncpoints.

Change-Id: Ieed11e1ba840da31ecfe7029051bfa61b88cd2b5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284407
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:14 +00:00
Mikko Perttunen
5362309e7f gpu: host1x: Add option for disabling context stealing
Add kernel module parameter to allow disabling context stealing in
cases where reliability and consistency is preferred.

Change-Id: Iffa3f098814bcdd3ae760a05cb013c3c0c804ad5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284406
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:14 +00:00
Mikko Perttunen
48e383a1b9 drm/tegra: Add option for explicit syncpoint free
Add kernel module parameter to enable a mode where syncpoints
must be freed explicitly (using the free IOCTL) or they will be
left dangling. This ensures that, for particularly locked down
configurations, a syncpoint will be forever left in an expected
state even if the process owning it dies -- for example another
process will not be able to allocate it.

Change-Id: I2f350c710775a296c70910df21e95737a36c6a45
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284405
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:14 +00:00
Mainak Sen
aa3decfdb8 gpu: host1x: Add plausibility check on Host1x calibration data
When syncpoint and channel property are read from device-tree,
add plausibility check to validate against reference data.

Jira HOSTX-5843

Change-Id: I66dd9a5f18200aa8baaeecd36499dfb0ca24ba01
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293524
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
2e59ef0253 gpu: host1x: move disply related code under CONFIG_DRM_TEGRA_HAVE_DISPLAY
As display support is not needed for recent chips,
 move the related codes under CONFIG_DRM_TEGRA_HAVE_DISPLAY configs accordingly.

Jira HOSTX-5833

Change-Id: Ie1cfd730a69fcb7d9e26600487a11f720fc509ba
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292240
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
91751dfb74 drm/tegra: move disply related code under CONFIG_DRM_TEGRA_HAVE_DISPLAY
As Tegra DRM driver display support is not needed for recent chips,
move the related codes under CONFIG_DRM_TEGRA_HAVE_DISPLAY and enable
that flag based on legacy chip configs accordingly.

Jira HOSTX-5833

Change-Id: Iddf884f5abdfe2500e7195778bc77f9423acc2d3
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292246
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
b5acbd1bfc drm/tegra: syncpoint base support for chips <= t186
As syncpoint base feature is not supported from T194 onwards,
moving the related ioctl handling under CONFIG_HOST1X_HAVE_SYNCPT_BASE
accordingly.

Jira HOSTX-5833

Change-Id: Idb5188039ef22e8d27e0a5ddf06a1c447fb323d3
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292251
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
8bfe83d4ee gpu: host1x: syncpoint base support for chips <= t186
As syncpoint base feature is not supported from T194 onwards,
moving the related driver code under CONFIG_HOST1X_HAVE_SYNCPT_BASE
accordingly.

Jira HOSTX-5833

Change-Id: I388dea16527acd0153331710312efc477aa2bbde
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292180
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Manish Bhardwaj
b9ba6056f0 nvidia-oot: remove dependency from I2C config
- remove dependency of all gpu driver from I2C config.
- builld host1x driver
- move drm driver dependency on DRM config

bug 5070220

Change-Id: I24322224d0cc705c25b11453534ca556c2e29bbc
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293057
Reviewed-by: Amlan Kundu <akundu@nvidia.com>
Tested-by: Bharath H S <bhs@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bharath H S <bhs@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:14 +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