aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/dev.h
AgeCommit message (Collapse)AuthorFilesLines
2019-10-29gpu: host1x: Set DMA mask based on IOMMU setupThierry Reding1-0/+1
If the Tegra DRM clients are backed by an IOMMU, push buffers are likely to be allocated beyond the 32-bit boundary if sufficient system memory is available. This is problematic on earlier generations of Tegra where host1x supports a maximum of 32 address bits for the GATHER opcode. More recent versions of Tegra (Tegra186 and later) have a wide variant of the GATHER opcode, which allows addressing up to 64 bits of memory. If host1x itself is behind an IOMMU as well this doesn't matter because the IOMMU's input address space is restricted to 32 bits on generations without support for wide GATHER opcodes. However, if host1x is not behind an IOMMU, it won't be able to process push buffers beyond the 32-bit boundary on Tegra generations that don't support wide GATHER opcodes. Restrict the DMA mask to 32 bits on these generations prevents buffers from being allocated from beyond the 32-bit boundary. Signed-off-by: Thierry Reding <[email protected]>
2019-10-28gpu: host1x: Do not limit DMA segment sizeThierry Reding1-0/+2
host1x nor any its clients have any limitations on the DMA segment size, so don't pretend that they do. Signed-off-by: Thierry Reding <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201Thomas Gleixner1-12/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 228 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Steve Winslow <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-04gpu: host1x: Set up stream ID tableThierry Reding1-0/+8
In order to enable the MMIO path stream ID protection provided by the incarnation of host1x found in Tegra186 and later, the host1x must be provided with the list of stream ID register offsets for each of its clients. Some clients (such as VIC) have multiple stream ID registers that are assumed to be contiguous. The host1x is programmed with the base offset and a limit which provide the range of registers that the host1x needs to monitor for writes. Signed-off-by: Thierry Reding <[email protected]>
2018-05-18gpu: host1x: Remove wait check supportThierry Reding1-8/+0
The job submission userspace ABI doesn't support this and there are no plans to implement it, so all of this code is dead and can be removed. Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2017-12-21gpu: host1x: Use IOMMU groupsThierry Reding1-0/+1
Use IOMMU groups to attach the host1x device to its IOMMU domain. This is not strictly necessary because the domain isn't shared with any other device, but it makes the code consistent with how IOMMU is handled in other drivers and provides an easy way to detect when no IOMMU has been attached via device tree. Signed-off-by: Thierry Reding <[email protected]>
2017-10-20gpu: host1x: Enable Tegra186 syncpoint protectionMikko Perttunen1-0/+15
Since Tegra186 the Host1x hardware allows syncpoints to be assigned to specific channels, preventing any other channels from incrementing them. Enable this feature where available and assign syncpoints to channels when submitting a job. Syncpoints are currently never unassigned from channels since that would require extra work and is unnecessary with the current channel allocation model. Signed-off-by: Mikko Perttunen <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2017-10-20gpu: host1x: Add Tegra186 supportMikko Perttunen1-0/+4
Add support for the implementation of Host1x present on the Tegra186. The register space has been shuffled around a little bit, requiring addition of some chip-specific code sections. Tegra186 also adds several new features, most importantly the hypervisor, but those are not yet supported with this commit. Signed-off-by: Mikko Perttunen <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2017-06-15gpu: host1x: Refactor channel allocation codeMikko Perttunen1-4/+2
This is largely a rewrite of the Host1x channel allocation code, bringing several changes: - The previous code could deadlock due to an interaction between the 'reflock' mutex and CDMA timeout handling. This gets rid of the mutex. - Support for more than 32 channels, required for Tegra186 - General refactoring, including better encapsulation of channel ownership handling into channel.c Signed-off-by: Mikko Perttunen <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2017-04-05gpu: host1x: Support module resetThierry Reding1-0/+2
Newer versions of Tegra come with early boot software that aggressively puts various modules in reset. Add support to the host1x driver to take the module out of reset on probe, and assert reset on removal. Signed-off-by: Thierry Reding <[email protected]>
2017-04-05gpu: host1x: Sort includes alphabeticallyThierry Reding1-3/+3
Sorting includes alphabetically makes it easier and less conflict-prone to add new includes subsequently. Signed-off-by: Thierry Reding <[email protected]>
2017-04-05gpu: host1x: Add IOMMU supportMikko Perttunen1-0/+6
Add support for the Host1x unit to be located behind an IOMMU. This is required when gather buffers may be allocated non-contiguously in physical memory, as can be the case when TegraDRM is also using the IOMMU. Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-11-11gpu: host1x: Add locking to syncptArto Merilainen1-1/+2
Currently syncpoints are not locked by mutex and this causes races if we are aggressively freeing and allocating syncpoints. This patch adds missing mutex protection to syncpoint structures. Signed-off-by: Arto Merilainen <[email protected]> Reviewed-by: Shridhar Rasal <[email protected]> Signed-off-by: Mikko Perttunen <[email protected]> [[email protected]: use better label names, don't reset local variable] Signed-off-by: Thierry Reding <[email protected]>
2016-06-23gpu: host1x: Use unsigned int consistently for IDsThierry Reding1-11/+12
IDs can never be negative so use unsigned int. In some instances an explicitly sized type (such as u32) was used for no particular reason, so turn those into unsigned int as well for consistency. Signed-off-by: Thierry Reding <[email protected]>
2016-06-23gpu: host1x: Consistently use unsigned int for countsThierry Reding1-7/+7
The number of channels, syncpoints, bases and mlocks can never be negative, so use unsigned int instead of int. Also make loop variables the same type for consistency. Signed-off-by: Thierry Reding <[email protected]>
2016-06-23gpu: host1x: hw: intr_hw: Remove create_workqueueBhaktipriya Shridhar1-1/+0
System workqueues have been able to handle high level of concurrency for a long time now and there's no reason to use dedicated workqueues just to gain concurrency. Since the workqueue host->intr_wq is involved in sync point interrupts, and sync point wait and is not being used on a memory reclaim path, dedicated host->intr_wq has been replaced with the use of system_wq. Unlike a dedicated per-cpu workqueue created with create_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantees unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. cancel_work_sync() has been used in _host1x_free_syncpt_irq() to ensure that no work is pending by the time exit path runs. Signed-off-by: Bhaktipriya Shridhar <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-03-04gpu: host1x: Set DMA maskAlexandre Courbot1-0/+1
The default DMA mask covers a 32 bits address range, but host1x devices can address a larger range on TK1 and TX1. Set the DMA mask to the range addressable when we use the IOMMU to prevent the use of bounce buffers. Signed-off-by: Alexandre Courbot <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-12-19gpu: host1x: Add MIPI pad calibration supportThierry Reding1-0/+2
This driver adds support to perform calibration of the MIPI pads for CSI and DSI. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Add syncpoint base supportArto Merilainen1-0/+2
This patch adds support for hardware syncpoint bases. This creates a simple mechanism to stall the command FIFO until an operation is completed. Signed-off-by: Arto Merilainen <[email protected]> Reviewed-by: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-10-31drm/tegra: Move subdevice infrastructure to host1xThierry Reding1-5/+4
The Tegra DRM driver currently uses some infrastructure to defer the DRM core initialization until all required devices have registered. The same infrastructure can potentially be used by any other driver that requires more than a single sub-device of the host1x module. Make the infrastructure more generic and keep only the DRM specific code in the DRM part of the driver. Eventually this will make it easy to move the DRM driver part back to the DRM subsystem. Signed-off-by: Thierry Reding <[email protected]>
2013-09-03gpu: host1x: Sort drivers by probe orderThierry Reding1-1/+1
External driver declarations are sorted by probe order for consistency. Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Rework CPU syncpoint incrementArto Merilainen1-4/+4
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. User space interface is modified accordingly to pass return values. Signed-off-by: Arto Merilainen <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-04-22gpu: host1x: Remove second host1x driverTerje Bergstrom1-0/+6
Remove second host1x driver, and bind tegra-drm to the new host1x driver. The logic to parse device tree and track clients is moved to drm.c. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-04-22gpu: host1x: Add debug supportTerje Bergstrom1-0/+42
Add support for host1x debugging. Adds debugfs entries, and dumps channel state to UART in case of stuck job. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-04-22gpu: host1x: Add channel supportTerje Bergstrom1-0/+113
Add support for host1x client modules, and host1x channels to submit work to the clients. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-04-22gpu: host1x: Add syncpoint wait and interruptsTerje Bergstrom1-0/+51
Add support for sync point interrupts, and sync point wait. Sync point wait used interrupts for unblocking wait. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-04-22gpu: host1x: Add host1x driverTerje Bergstrom1-0/+96
Add host1x, the driver for host1x and its client unit 2D. The Tegra host1x module is the DMA engine for register access to Tegra's graphics- and multimedia-related modules. The modules served by host1x are referred to as clients. host1x includes some other functionality, such as synchronization. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Terje Bergstrom <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Signed-off-by: Thierry Reding <[email protected]>