aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-05-27remove lots of IS_ERR_VALUE abusesArnd Bergmann1-1/+1
Most users of IS_ERR_VALUE() in the kernel are wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. However, anything that passes an 'unsigned short' or 'unsigned int' argument into IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Andrzej Hajda has already fixed a lot of the worst abusers that were causing actual bugs, but it would be nice to prevent any users that are not passing 'unsigned long' arguments. This patch changes all users of IS_ERR_VALUE() that I could find on 32-bit ARM randconfig builds and x86 allmodconfig. For the moment, this doesn't change the definition of IS_ERR_VALUE() because there are probably still architecture specific users elsewhere. Almost all the warnings I got are for files that are better off using 'if (err)' or 'if (err < 0)'. The only legitimate user I could find that we get a warning for is the (32-bit only) freescale fman driver, so I did not remove the IS_ERR_VALUE() there but changed the type to 'unsigned long'. For 9pfs, I just worked around one user whose calling conventions are so obscure that I did not dare change the behavior. I was using this definition for testing: #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \ unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO)) which ends up making all 16-bit or wider types work correctly with the most plausible interpretation of what IS_ERR_VALUE() was supposed to return according to its users, but also causes a compile-time warning for any users that do not pass an 'unsigned long' argument. I suggested this approach earlier this year, but back then we ended up deciding to just fix the users that are obviously broken. After the initial warning that caused me to get involved in the discussion (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus asked me to send the whole thing again. [ Updated the 9p parts as per Al Viro - Linus ] Signed-off-by: Arnd Bergmann <[email protected]> Cc: Andrzej Hajda <[email protected]> Cc: Andrew Morton <[email protected]> Link: https://lkml.org/lkml/2016/1/7/363 Link: https://lkml.org/lkml/2016/5/27/486 Acked-by: Srinivas Kandagatla <[email protected]> # For nvmem part Signed-off-by: Linus Torvalds <[email protected]>
2015-12-14gpu: host1x: Add Tegra210 supportThierry Reding6-0/+755
The host1x unit found in Tegra210 SoCs is very similar to the unit in Tegra124, but it has 2 additional channels for a total of 14 channels. Signed-off-by: Thierry Reding <[email protected]>
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 <[email protected]> Reviewed-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
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 <[email protected]>
2014-11-13gpu: host1x: Fix typo in commentThierry Reding1-1/+1
Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: Make mapped field of push buffers void *Thierry Reding1-2/+2
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 <[email protected]>
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 <[email protected]>
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: <[email protected]> # 3.10 Signed-off-by: Stephen Warren <[email protected]> Acked-By: Terje Bergstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
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 <[email protected]>
2013-12-19gpu: host1x: Add Tegra124 supportThierry Reding6-0/+755
Tegra124 has 192 syncpoints whereas its predecessors had 32 syncpoints. This required changes to the hardware register layout. Signed-off-by: Arto Merilainen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
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 <[email protected]>
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 <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Add syncpoint base supportArto Merilainen2-0/+26
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-31gpu: host1x: Add support for Tegra114Thierry Reding5-0/+607
Tegra114 uses a slightly updated version of host1x with an additional syncpoint. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Use relative include pathsThierry Reding6-24/+24
This is slightly safer than adding -Idrivers/gpu/host1x to cflags-y. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Expose syncpt and channel functionalityThierry Reding2-2/+0
Expose the buffer objects, syncpoint and channel functionality in the public public header so that drivers can use them. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Make host1x header file publicThierry Reding1-1/+2
In preparation to support host1x clients other than DRM, move this header into a public location. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Cleanup includesThierry Reding1-7/+0
Most of the included files are either not required or already included by some other header file. Signed-off-by: Thierry Reding <[email protected]>
2013-10-31gpu: host1x: Remove unused MakefileThierry Reding1-6/+0
Signed-off-by: Thierry Reding <[email protected]>
2013-06-22gpu: host1x: Rework CPU syncpoint incrementArto Merilainen2-8/+6
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: Add debug supportTerje Bergstrom8-0/+491
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 Bergstrom8-0/+881
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 Bergstrom3-0/+187
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 Bergstrom6-0/+267
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]>