aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-02gpu: host1x: Fix MLOCK's debug infoDmitry Osipenko4-13/+13
MLOCK's debug info, spewed on CDMA timeout, contains meaningless MLOCK owner channel ID because HOST1X_SYNC_MLOCK_OWNER_CHID_F() returns shifted value, while unshifted should be used. Fix it by changing '_F' to '_V'. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Power down regulators when unusedThierry Reding1-12/+98
Keep track of the number of users of DSI and CSI pads and power down the regulators that supply the bricks when all users are gone. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Add Tegra210 supportThierry Reding1-1/+35
Some changes are needed to the configuration settings for some lanes. In addition, the clock lanes for the CSI pads can no longer be calibrated. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Add Tegra132 supportThierry Reding1-0/+18
While Tegra132 has the same pads as Tegra124, some configuration values need to be programmed slightly differently. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Constify OF match tableThierry Reding1-1/+1
This table is never modified and can therefore reside in read-only memory. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Clear calibration statusThierry Reding1-0/+4
Before starting a new calibration cycle, make sure to clear the current status by writing a 1 to the various "calibration done" bits. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Fix clock lane register for DSIThierry Reding1-5/+5
Use more consistent names for the clock lane configuration registers and fix the offset of the upper clock lane configuration register for the first DSI pad. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13gpu: host1x: mipi: Parameterize to support future SoCsThierry Reding1-8/+79
Parameterize more of the register programming to accomodate for changes required by future SoC generations. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-04-02gpu: host1x: Export host1x_syncpt_read()Thierry Reding1-0/+6
This function is used to read the current value of the syncpt and is useful in situations where drivers don't schedule work and wait for the syncpoint to increment. One particular use-case is using the syncpoint as a VBLANK counter. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-01-27gpu: host1x: Provide a proper struct bus_typeThierry Reding3-40/+81
Previously the struct bus_type exported by the host1x infrastructure was only a very basic skeleton. Turn that implementation into a more full- fledged bus to support proper probe ordering and power management. Note that the bus infrastructure needs to be available before any of the drivers can be registered. This is automatically ensured if all drivers are built as loadable modules (via symbol dependencies). If all drivers are built-in there are no such guarantees and the link order determines the initcall ordering. Adjust drivers/gpu/Makefile to make sure that the host1x bus infrastructure is initialized prior to any of its users (only drm/tegra currently). v2: Fix building host1x and tegra-drm as modules Reported-by: Dave Airlie <airlied@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Mark Zhang <markz@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-01-23gpu: host1x: Factor out __host1x_device_del()Thierry Reding1-44/+49
This function is needed in several places, so factor it out. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-01-23gpu: host1x: Call host1x_device_add() under lockThierry Reding1-4/+2
Instead of locking within host1x_device_add(), call it under the lock to make the locking more consistent. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-01-23gpu: host1x: Call ->remove() only when a device is boundThierry Reding1-2/+7
When a driver's ->probe() function fails, the host1x bus must not call its ->remove() function because the driver will already have cleaned up in the error handling path in ->probe(). Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: mipi: Set MIPI_CAL_BIAS_PAD_CFG1 registerSean Paul1-0/+4
During calibration, sets the "internal reference level for drive pull- down" to the value specified in the Tegra TRM. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: mipi: Calibrate clock lanesSean Paul1-32/+92
Include the clock lanes when calibrating the MIPI PHY on Tegra124 compatible devices. Signed-off-by: Sean Paul <seanpaul@chromium.org> [treding@nvidia.com: bikeshedding] Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: mipi: Preserve the contents of MIPI_CAL_CTRLSean Paul1-1/+3
By paving the CTRL reg value, the current code changes MIPI_CAL_PRESCALE ("Auto-cal calibration step prescale") from 1us to 0.1us (val=0). In the description for PHY's noise filter (MIPI_CAL_NOISE_FLT), the TRM states that if the value of the prescale is 0 (or 0.1us), the filter should be set between 2-5. However, the current code sets it to 0. For now, let's keep the prescale and filter values as-is, which is most likely the power-on-reset values of 0x2 and 0xa, respectively. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: mipi: Registers are 32 bits wideThierry Reding1-8/+8
On 64-bit platforms an unsigned long would be 64 bit and cause unnecessary casting when being passed to writel() or returned from readl(). Make register values 32 bits wide to avoid that. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: Make gather offsets unsignedThierry Reding1-1/+1
Use the u32 type for the offset in the host1x_job_gather structure for consistentcy with other structures. Negative offsets don't make sense in this context. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: Print address/offset pairs consistentlyThierry Reding2-4/+4
Consistently use a format of %pad+%#x to print address/offset in debug messages. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: Fix typo in commentThierry Reding1-1/+1
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: Make mapped field of push buffers void *Thierry Reding3-4/+4
This reduces the amount of casting that needs to be done to get rid of annoying warnings on 64-bit builds. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-13gpu: host1x: Use struct host1x_bo pointers in tracesThierry Reding1-4/+8
Rather than cast to a u32 use the struct host1x_bo pointers directly. This avoid annoying warnings for 64-bit builds. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-08-04drm/tegra: Make job submission 64-bit safeThierry Reding1-11/+11
Job submission currently relies on the fact that struct drm_tegra_reloc and struct host1x_reloc are the same size and uses a simple call to the copy_from_user() function to copy them to kernel space. This causes the handle to be stored in the buffer object field, which then needs a cast to a 32 bit integer to resolve it to a proper buffer object pointer and store it back in the buffer object field. On 64-bit architectures that will no longer work, since pointers are 64 bits wide whereas handles will remain 32 bits. This causes the sizes of both structures to because different and copying will no longer work. Fix this by adding a new function, host1x_reloc_get_user(), that copies the structures field by field. While at it, use substructures for the command and target buffers in struct host1x_reloc for better readability. Also use unsized types to make it more obvious that this isn't part of userspace ABI. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-05gpu: host1x: Rename internal functions for clarityThierry Reding1-6/+6
The internal host1x_{,un}register_client() functions can potentially be confused with public the host1x_client_{,un}register() functions. Rename them to host1x_{add,del}_client() to remove some of the possible confusion. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-04-16gpu: host1x: handle the correct # of syncpt regsStephen Warren1-2/+2
BIT_WORD() truncates rather than rounds, so the loops in syncpt_thresh_isr() and _host1x_intr_disable_all_syncpt_intrs() use <= rather than < in an attempt to process the correct number of registers when rounding of the conversion of count of bits to count of words is necessary. However, when rounding isn't necessary because the value is already a multiple of the divisor (as is the case for all values of nb_pts the code actually sees), this causes one too many registers to be processed. Solve this by using and explicit DIV_ROUND_UP() call, rather than BIT_WORD(), and comparing with < rather than <=. Fixes: 7ede0b0bf3e2 ("gpu: host1x: Add syncpoint wait and interrupts") Cc: <stable@vger.kernel.org> # 3.10 Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-04-05Merge tag 'drm/tegra/for-3.15-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-nextDave Airlie1-0/+1
drm/tegra: Changes for v3.15-rc1 Implement eDP support for Tegra124 and support the PRIME vmap()/vunmap() operations. A symbol that is required for upcoming V4L2 support is now exported by the host1x driver. Relicense drivers under the GPL v2 for consistency. One exception is the public header file, which is relicensed under MIT to abide by the common rule. * tag 'drm/tegra/for-3.15-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Use standard GPL v2 license text drm/tegra: Relicense under GPL v2 drm/tegra: Relicense public header under MIT drm/tegra: Add eDP support gpu: host1x: export host1x_syncpt_incr_max() function drm/tegra: prime: Add vmap support
2014-04-04gpu: host1x: export host1x_syncpt_incr_max() functionBryan Wu1-0/+1
Tegra V4L2 camera driver needs this function to do frame capture. Signed-off-by: Bryan Wu <pengw@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-02-12gpu: host1x: do not check previously handled gathersErik Faye-Lund1-1/+1
When patching gathers, we don't need to check against gathers with lower indices than the current one, as they are guaranteed to already have been handled. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-01-14gpu: host1x: Remove unnecessary includeThierry Reding1-1/+0
Nothing from the asm/mach/irq.h header is needed in this file, so there is no need to include it. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Add Tegra124 supportThierry Reding8-1/+768
Tegra124 has 192 syncpoints whereas its predecessors had 32 syncpoints. This required changes to the hardware register layout. Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Fix build warningsThierry Reding1-5/+8
When debugfs support isn't enabled, gcc complains about some variables being unused. To avoid further #ifdefery, move debugfs specific setup code into static functions and use IS_ENABLED(CONFIG_DEBUG_FS) to have the compiler, rather than the preprocessor, discard them when unused. The advantage of doing it this way is that all the code will be compile-tested whether or not debugfs support is enabled. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Increase compile test coverageThierry Reding1-1/+1
The ARCH_MULTIPLATFORM dependency was introduced back when Tegra didn't support multiplatform yet as a means to allow the driver to be easily compile-tested along with other DRM drivers. In the meantime, the new COMPILE_TEST Kconfig option has been introduced for exactly that purpose, so use that instead to clarify the intention. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Fix more sparse warningsThierry Reding1-0/+3
Include the linux/host1x.h and dev.h headers so that function prototypes are visible to keep sparse from suggesting that their implementations be made static. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Use the correct HW headers for host1x02Thierry Reding3-2/+150
An earlier patch added a subset of the required HW specific header files but didn't actually include the right ones when compiling for host1x02. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Export public APIThierry Reding4-0/+22
Make the public API symbols visible so that depending drivers can be built as a module. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-19gpu: host1x: Add MIPI pad calibration supportThierry Reding4-4/+288
This driver adds support to perform calibration of the MIPI pads for CSI and DSI. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-03gpu: host1x: Fix a few sparse warningsThierry Reding1-2/+3
Include the bus.h header, so that various function declarations are visible in the source file that implements those functions. This keeps sparse from suggesting that they should be made static. Make the host1x_bus_type variable static since it isn't used globally. Finally replace the slightly unsafe dev_set_name(dev, name) by the more secure dev_set_name(dev, "%s", name). Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-11-28gpu: host1x: Silence a few warnings with LPAE=yOlof Johansson2-4/+4
When building with LPAE=y (64-bit dma_addr_t), the following warnings are seen: drivers/gpu/host1x/hw/cdma_hw.c:57:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' drivers/gpu/host1x/hw/debug_hw.c:167:10: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t' The agreed-to solution for this is upcast to u64 and using %llx. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Add syncpoint base supportArto Merilainen5-2/+87
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 <amerilainen@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Add 'flags' field to syncpt requestArto Merilainen1-7/+11
Functions host1x_syncpt_request() and _host1x_syncpt_alloc() have been taking a separate boolean flag ('client_managed') for indicating if the syncpoint value should be tracked by the host1x driver. This patch converts the field into generic 'flags' field so that we can easily add more information while requesting a syncpoint. Clients are adapted to use the new interface accordingly. Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Disable clock on probe failureWei Yongjun1-1/+3
Add a missing clk_disable_unprepare() before returning from the driver's .probe() function on error. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Add support for Tegra114Thierry Reding7-1/+620
Tegra114 uses a slightly updated version of host1x with an additional syncpoint. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Move driver to DRM treeThierry Reding16-5707/+0
In order to make subsystem-wide changes easier, move the Tegra DRM driver back into the DRM tree. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Use relative include pathsThierry Reding7-26/+24
This is slightly safer than adding -Idrivers/gpu/host1x to cflags-y. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Move subdevice infrastructure to host1xThierry Reding11-364/+853
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 <treding@nvidia.com>
2013-10-31gpu: host1x: Expose syncpt and channel functionalityThierry Reding13-254/+26
Expose the buffer objects, syncpoint and channel functionality in the public public header so that drivers can use them. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Introduce tegra_drm_client structureThierry Reding5-83/+94
This structure derives from host1x_client. DRM-specific fields are moved from host1x_client to this structure, so that host1x_client can remain agnostic of DRM. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Make host1x header file publicThierry Reding4-35/+5
In preparation to support host1x clients other than DRM, move this header into a public location. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: gem: Miscellaneous cleanupsThierry Reding1-11/+10
Rename the host1x_to_drm_bo() macro to host1x_to_tegra_bo() for consistency and fixup various stylistic issues. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Rename gr2d to tegra-gr2dThierry Reding1-1/+1
Other drivers use the tegra- prefix in their names, so add it to this driver's name as well for consistency. Signed-off-by: Thierry Reding <treding@nvidia.com>