aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x (follow)
AgeCommit message (Collapse)AuthorFilesLines
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>
2013-10-31drm/tegra: gr2d: Miscellaneous cleanupsThierry Reding1-51/+49
Rework the address table code for the host1x firewall. The previous implementation allocated a bitfield but didn't check for a valid pointer so it could potentially crash. Instead, embed a static bitmap within the gr2d structure to avoid the allocation and use the Linux bitmap API to reduce code complexity. Don't annotate the driver's .remove() function __exit. Even if built in the driver can be unloaded via sysfs, so .remove() needs to stick around after initialization. Also remove the explicit initialization of the driver's .owner field to THIS_MODULE because that's now handled by the driver core. Furthermore make an error message more consistent with other subdrivers, index the syncpts array for better readability, remove a gratuituous newline and reorder some variable declarations to make the code easier to read. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: firewall: Refactor register checkThierry Reding1-26/+31
The same code sequence is used in various places to validate a register access in the command stream. This can be refactored into a separate function. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: firewall: Rename cmdbuf_id -> cmdbufThierry Reding1-5/+5
The value stored in this field is a pointer to a command buffer, not an ID. Avoid some confusion by reflecting that in the field's name. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Fix alignment of function argumentsThierry Reding1-1/+1
Arguments on subsequent lines should be aligned with the first argument. This one occurrence went unnoticed during code review. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Do not discard .remove()Thierry Reding1-4/+3
The device can be unbound from the driver via sysfs, so regardless of whether the driver is builtin or a module, its .remove() function needs to stick around. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Cleanup includesThierry Reding9-51/+2
Most of the included files are either not required or already included by some other header file. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Rename host1x_drm_context to tegra_drm_contextThierry Reding3-20/+28
The structure represents a context associated with a particular process that has opened the Tegra DRM device and requested a channel. This is a very DRM-specific notion and has nothing to do with host1x. Rename the structure to more clearly mark the boundaries between the two. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Rename host1x_drm_file to tegra_drm_fileThierry Reding2-15/+15
This structure extends drm_file with Tegra DRM specific fields and has nothing to do with host1x. Rename the structure to more clearly mark the boundaries between host1x and Tegra DRM. While at it, move the structure definition out of the header. It's never used outside of the drm.c source file, so it can be defined within that. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Rename host1x_drm structure to tegra_drmThierry Reding8-116/+115
The host1x and Tegra DRM drivers are currently tightly coupled. Renaming the structure marks the boundary more clearly. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Cleanup tegra_dc structureThierry Reding1-4/+1
Remove the unused host1x field from the structure and group the fields more logically. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31drm/tegra: Remove unused fieldsThierry Reding1-4/+0
Some of the fields in struct host1x_drm haven't been used for a while, so remove them. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: Remove unused MakefileThierry Reding1-6/+0
Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-31gpu: host1x: check relocs after all gathers are consumedErik Faye-Lund1-4/+4
The num_relocs count are passed to the kernel per job, not per gather. For multi-gather jobs, we would previously fail if there were relocs in other gathers aside from the first one. Fix this by simply moving the check until all gathers have been consumed. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Arto Merilainen <amerilainen@nvidia.com> Acked-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-10-09drm: Make irq_enabled boolVille Syrjälä1-1/+1
irq_enabled is only ever 0 or 1, so make it a bool. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-05Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds9-57/+31
Pull drm tree changes from Dave Airlie: "This is the main drm pull request, I have some overlap with sound and arm-soc, the sound patch is acked and may conflict based on -next reports but should be a trivial fixup, which I'll leave to you! Highlights: - new drivers: MSM driver from Rob Clark - non-drm: switcheroo and hdmi audio driver support for secondary GPU poweroff, so drivers can use runtime PM to poweroff the GPUs. This can save 5 or 6W on some optimus laptops. - drm core: combined GEM and TTM VMA manager per-filp mmap permission tracking initial rendernode support (via a runtime enable for now, until we get api stable), remove old proc support, lots of cleanups of legacy code hdmi vendor infoframes and 4k modes lots of gem/prime locking and races fixes async pageflip scaffolding drm bridge objects - i915: Haswell PC8+ support and eLLC support, HDMI 4K support, initial per-process VMA pieces, watermark reworks, convert to generic hdmi infoframes, encoder reworking, fastboot support, - radeon: CIK PM support, remove 3d blit code in favour of DMA engines, Berlin GPU support, HDMI audio fixes - nouveau: secondary GPU power down support for optimus laptops, lots of fixes, use MSI, VP3 engine support - exynos: runtime pm support for g2d, DT support, remove non-DT, - tda998x i2c driver: lots of fixes for sync issues - gma500: lots of cleanups - rcar: add LVDS support, fbdev emulation, - tegra: just minor fixes" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (684 commits) drm/exynos: Fix build error with exynos_drm_connector.c drm/exynos: Remove non-DT support in exynos_drm_fimd drm/exynos: Remove non-DT support in exynos_hdmi drm/exynos: Remove non-DT support in exynos_drm_g2d drm/exynos: Remove non-DT support in exynos_hdmiphy drm/exynos: Remove non-DT support in exynos_ddc drm/exynos: Make Exynos DRM drivers depend on OF drm/exynos: Consider fallback option to allocation fail drm/exynos: fimd: move platform data parsing to separate function drm/exynos: fimd: get signal polarities from device tree drm/exynos: fimd: replace struct fb_videomode with videomode drm/exynos: check a pixel format to a particular window layer drm/exynos: fix fimd pixel format setting drm/exynos: Add NULL pointer check drm/exynos: Remove redundant error messages drm/exynos: Add missing of.h header include drm/exynos: Remove redundant NULL check in exynos_drm_buf drm/exynos: add device tree support for rotator drm/exynos: Add missing includes drm/exynos: add runtime pm interfaces to g2d driver ...
2013-09-04Merge tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-nextDave Airlie5-17/+23
drm/tegra: Changes for v3.12-rc1 Only a couple of small patches this time around. These are mostly fixes for minor bugs that showed up, but there is also some preparatory work that will come in handy for future patches. * tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Parse device tree earlier gpu: host1x: Sort drivers by probe order gpu: host1x: Check for valid host1x pointer gpu: host1x: returning success instead of -ENOMEM gpu: host1x: fix an integer overflow check drm/tegra: hdmi: Make sure clock is enabled before dumping registers
2013-09-03drm/tegra: Parse device tree earlierThierry Reding1-7/+7
Parsing the device tree may cause probing to be deferred. Doing this as early as possible prevents any other resources from being requested and enabled, therefore reducing the need to cleanup on deferred probe while at the same time not wasting precious CPU cycles determining if probing needs to be deferred or not. Signed-off-by: Thierry Reding <treding@nvidia.com>
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 <treding@nvidia.com>
2013-09-03gpu: host1x: Check for valid host1x pointerThierry Reding1-1/+1
Under rare circumstances it can happen that the host1x driver's .probe() doesn't finish properly, in which case the device's driver-specific data will not be set. Instead of crashing in such a situation, propagate the error to callers of the host1x_get_drm_data() function. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-09-02drm/tegra: fix up page flip flags.Dave Airlie1-1/+1
This was one level away from where I'd grepped. Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-30video/hdmi: Use hdmi_vendor_infoframe for the HDMI specific infoframeLespiau, Damien1-3/+3
We just got rid of the version of hdmi_vendor_infoframe that had a byte array for anyone to poke at. It's now time to shuffle around the naming of hdmi_hdmi_infoframe to make hdmi_vendor_infoframe become the HDMI vendor specific structure. Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-08-30gpu: host1x: Port the HDMI vendor infoframe code the common helpersLespiau, Damien1-20/+4
I just wrote the bits to define and pack HDMI vendor specific infoframe. Port the host1x driver to use those so I can refactor the infoframe code a bit more. This changes the length of the infoframe payload from 6 to 5, which is enough for the "frame packing" stereo format. v2: Pimp up the commit message with the note about the length (Ville Syrjälä) Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Terje Bergström <tbergstrom@nvidia.com> Cc: linux-tegra@vger.kernel.org Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-08-27gpu: host1x: returning success instead of -ENOMEMDan Carpenter1-2/+1
There is a mistake here so it returns PTR_ERR(NULL) which is success instead of -ENOMEM. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Thierry Reding <treding@nvidia.com>