summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra
AgeCommit message (Collapse)AuthorFilesLines
2015-08-17Merge tag 'drm/tegra/for-4.3-rc1' of ↵Dave Airlie13-757/+1837
git://anongit.freedesktop.org/tegra/linux into drm-next drm/tegra: Changes for v4.3-rc1 There are a bunch of non-critical fixes here that I've collected over the past few months, but the biggest part is Tegra210 support, in the DC, DSI and SOR/HDMI drivers. Also this finally restores DPMS with atomic mode-setting, something that has been broken since the conversion and which I had originally expected to take far less longer to fix. * tag 'drm/tegra/for-4.3-rc1' of git://anongit.freedesktop.org/tegra/linux: (41 commits) drm/tegra: sor: Add HDMI support drm/tegra: sor: Add Tegra210 eDP support drm/tegra: dc: Implement atomic DPMS drm/tegra: sor: Restore DPMS drm/tegra: dsi: Restore DPMS drm/tegra: hdmi: Restore DPMS drm/tegra: rgb: Restore DPMS drm/tegra: sor: Use DRM debugfs infrastructure for CRC drm/tegra: sor: Write correct head state registers drm/tegra: sor: Constify display mode drm/tegra: sor: Reset the correct debugfs fields drm/tegra: sor: Set minor after debugfs initialization drm/tegra: sor: Provide error messages in probe drm/tegra: sor: Rename registers for consistency drm/tegra: dpaux: Disable interrupt when detached drm/tegra: dpaux: Configure pads as I2C by default drm/tegra: dpaux: Provide error message in probe drm/tegra: dsi: Add Tegra210 support drm/tegra: dsi: Add Tegra132 support drm/tegra: dsi: Add Tegra124 support ...
2015-08-13drm/tegra: sor: Add HDMI supportThierry Reding4-34/+1051
The SOR1 introduced on Tegra210 supports HDMI 2.0 and DisplayPort. Add HDMI support and name the debugfs node after the type of SOR. The SOR introduced with Tegra124 is known simply as "sor", whereas the additional SOR found on Tegra210 is known as "sor1". Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Add Tegra210 eDP supportThierry Reding2-0/+2
The SOR found on Tegra210 is very similar to the version found on Tegra124, except that it no longer supports LVDS. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Implement atomic DPMSThierry Reding1-100/+102
Move all code into the new canonical ->disable() and ->enable() helper callbacks so that they play extra nice with atomic DPMS. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Restore DPMSThierry Reding1-138/+82
In order to restore DPMS with atomic mode-setting, move all code from the ->mode_set() callback into ->enable(). At the same time, rename the ->prepare() callback to ->disable() to use the names preferred by atomic mode-setting. This simplifies the calling sequence and will allow DPMS to use runtime PM in subsequent patches. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dsi: Restore DPMSThierry Reding1-59/+51
In order to restore DPMS with atomic mode-setting, move all code from the ->mode_set() callback into ->enable(). At the same time, rename the ->prepare() callback to ->disable() to use the names preferred by atomic mode-setting. This simplifies the calling sequence and will allow DPMS to use runtime PM in subsequent patches. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: hdmi: Restore DPMSThierry Reding1-45/+29
In order to restore DPMS with atomic mode-setting, move all code from the ->mode_set() callback into ->enable(). At the same time, rename the ->prepare() callback to ->disable() to use the names preferred by atomic mode-setting. This simplifies the calling sequence and will allow DPMS code to use runtime PM in subsequent patches. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: rgb: Restore DPMSThierry Reding1-36/+13
In order to restore DPMS with atomic mode-setting, move all code from the ->mode_set() callback into ->enable(). At the same time, rename the ->prepare() callback to ->disable() to use the names preferred by atomic mode-setting. This simplifies the calling sequence and will allow DPMS code to use runtime PM in subsequent patches. While at it, remove the enabled field that hasn't been used since the demidlayering of the output drivers done in preparation for the atomic mode-setting conversion. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Use DRM debugfs infrastructure for CRCThierry Reding1-37/+8
Instead of duplicating most of the code to set up a debugfs file, use the existing DRM core debugfs infrastructure instead. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Write correct head state registersThierry Reding1-4/+6
The head state registers are per head, so they must be properly indexed. This has worked fine so far because all boards with eDP use it as the primary output, so it is very likely to end up attached to head 0. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Constify display modeThierry Reding1-1/+1
The data structure is always only read, never written, and can hence be referred to by a const pointer. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Reset the correct debugfs fieldsThierry Reding1-2/+2
When tearing down debugfs support, make sure to reset the fields to NULL in the correct order, otherwise the debugfs root will not be properly removed. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Set minor after debugfs initializationThierry Reding1-0/+2
The DRM minor is needed to teardown debugfs, so it needs to be tracked to prevent a crash on driver removal. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Provide error messages in probeThierry Reding1-6/+23
When probing the SOR device fails, output proper error messages to help diagnose the cause of the failure. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: sor: Rename registers for consistencyThierry Reding2-289/+290
The TRM lists indexed registers without an underscore to separate name from index. Use that convention in the driver for consistency. While at it, rename some of the field names to the names used in the TRM. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dpaux: Disable interrupt when detachedThierry Reding1-1/+7
When the DPAUX isn't attached to an SOR the interrupts are not useful. This also prevents a race that could potentially cause a crash on driver removal. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dpaux: Configure pads as I2C by defaultThierry Reding2-0/+27
The DPAUX code paths already configure the pads in AUX mode, but there is no way to reconfigure them in I2C mode for HDMI (the DPAUX module is unused in that case). Enabling the pads in I2C mode by default is the quickest way to support HDMI. Eventually this may need an explicit call in the user drivers. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dpaux: Provide error message in probeThierry Reding1-6/+24
When probing the dpaux device fails, output proper error messages to help diagnose the cause of the failure. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dsi: Add Tegra210 supportThierry Reding3-0/+10
The DSI host controller hasn't changed from Tegra132 to Tegra210, but different characterization parameters may be required. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dsi: Add Tegra132 supportThierry Reding2-0/+2
The DSI host controller hasn't changed from Tegra124 to Tegra132, but different characterization parameters may be required. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dsi: Add Tegra124 supportThierry Reding2-0/+2
The DSI host controller hasn't changed from Tegra114 to Tegra124, but different characterization parameters may be required. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dsi: Use proper back-porch for non-sync video modeThierry Reding1-2/+7
In video modes without sync pulses, the horizontal back-porch needs to include the horizontal sync width. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Rename BASE_COLOR_SIZE* fieldsThierry Reding2-1/+10
Use an underscore to separate the prefix from the color size suffix. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Don't explicitly set owner moduleThierry Reding1-1/+0
The call to platform_driver_register() will already set up the .owner field, so there's no need to do it explicitly. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Rename register for consistencyThierry Reding2-4/+4
The horizontal pulse enable bits are named H_PULSE{0,1,2}_ENABLE in the TRM. Modify the driver to use the same naming for consistency. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Record statisticsThierry Reding2-3/+49
Record interrupt statistics, such as the number of frames and VBLANKs received and the number of FIFO underflow and overflows. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Request syncpoint earlierThierry Reding1-4/+4
Request a syncpoint for display prior to registering the host1x client. This will ensure that the syncpoint will be acquired when the KMS driver initializes. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Remove gratuituous blank lineThierry Reding1-1/+0
Blank lines at the end of functions are hideous, so get rid of it. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Clarify comment about cursor treatmentThierry Reding1-3/+5
Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Implement CRC debugfs interfaceThierry Reding2-0/+27
Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Add Tegra210 supportThierry Reding2-0/+13
Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: dc: Reset VBLANK to offThierry Reding2-2/+4
Upon driver load, reset the VBLANK machinery to off to reflect the hardware state. Since the ->reset() callback is called from the initial drm_mode_config_reset() call, move the latter after the VBLANK machinery initialization by drm_vblank_init(). Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: output: Support low-active hotplug detectThierry Reding2-8/+14
Support low-active hotplug detect signals by storing the GPIO flags parsed from device tree. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: Use SIMPLE_DEV_PM_OPSThierry Reding1-3/+2
Use this macro to reduce some of the boilerplate. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-13drm/tegra: Allow VBLANK to be disabledThierry Reding1-0/+1
Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-08-06drm/tegra: Use new drm_fb_helper functionsArchit Taneja1-26/+9
Use the newly created wrapper drm_fb_helper functions instead of calling core fbdev functions directly. They also simplify the fb_info creation. v2: - Fix up error handling path in tegra_fbdev_probe Cc: Thierry Reding <thierry.reding@gmail.com> Cc: "Terje Bergström" <tbergstrom@nvidia.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-07-27drm: Make the connector dpms callback return a value, v2.Maarten Lankhorst4-6/+10
This is required to properly handle failing dpms calls. When making a wait in i915 interruptible, I've noticed that the dpms sequence could fail with -ERESTARTSYS because it was waiting interruptibly for flips. So from now on allow drivers to fail in their connector dpms callback. Encoder and crtc dpms callbacks are unaffected. Changes since v1: - Update kerneldoc for the drm helper functions. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [danvet: Resolve conflicts due to different merge order.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-07-27drm/atomic: pass old crtc state to atomic_begin/flush.Maarten Lankhorst1-2/+4
In intel it's useful to keep track of some state changes with old crtc state vs new state, for example to disable initial planes or when a modeset's prevented during fastboot. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> [danvet: squash in fixup for exynos provided by Maarten.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-06-18Merge tag 'drm/tegra/for-4.2-rc1' of ↵Dave Airlie3-40/+36
git://anongit.freedesktop.org/tegra/linux into drm-next drm/tegra: Changes for v4.2-rc1 This contains a couple of mostly fixes for issues that have crept up in recent versions of linux-next. One issue is that DP AUX transactions of more than 4 bytes will access the wrong FIFO registers and hence become corrupt. Another fix is required to restore functionality of Tegra20 if using the GART. The current code expects the IOMMU aperture to be the complete 4 GiB address space, whereas the GART on Tegra20 only provides a 128 MiB aperture. One more issue with IOMMU support is that on 64-bit ARM, swiotlb is the default IOMMU implementation backing the DMA API. A side-effect of that is that when dma_map_sg() is called to flush caches (yes, this is a bit of a hack, but ARM does not provide a better API), swiotlb will immediately run out of memory because its bounce buffer is too small to make a framebuffer. Finally I've included a mostly cosmetic fix that stores register values in u32 rather than unsigned long to avoid sign-extension issues on 64- bit ARM. This is only a precaution since it hasn't caused any issues (yet). * tag 'drm/tegra/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: dpaux: Registers are 32-bit drm/tegra: gem: Flush pages after allocation drm/tegra: gem: Take into account IOMMU aperture drm/tegra: dpaux: Fix transfers larger than 4 bytes
2015-06-12drm/tegra: dpaux: Registers are 32-bitThierry Reding1-11/+10
Use a sized unsigned 32-bit data type (u32) to store register contents. The DPAUX registers are 32 bits wide irrespective of the architecture's data width. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-06-12drm/tegra: gem: Flush pages after allocationThierry Reding1-17/+8
Pages allocated from shmemfs don't end up being cleared and flushed on ARMv7, so they must be flushed explicitly. Use the DMA mapping API for that purpose, even though it's not used for anything else. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-06-12drm/tegra: gem: Take into account IOMMU apertureThierry Reding1-2/+10
The IOMMU may not always be able to address 2 GiB of memory. On Tegra20, the GART supports 32 MiB starting at 0x58000000. Also the aperture on Tegra30 and later is in fact the full 4 GiB, rather than just 2 GiB as currently assumed. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-06-12drm/tegra: dpaux: Fix transfers larger than 4 bytesThierry Reding1-10/+8
The DPAUX read/write FIFO registers aren't sequential in the register space, causing transfers larger than 4 bytes to cause accesses to non- existing FIFO registers. Fixes: 6b6b604215c6 ("drm/tegra: Add eDP support") Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-05-08drm/tegra: Don't use vblank_disable_immediate on incapable driver.Mario Kleiner1-1/+0
Tegra would not only need a hardware vblank counter that increments at leading edge of vblank, but also support for instantaneous high precision vblank timestamp queries, ie. a proper implementation of dev->driver->get_vblank_timestamp(). Without these, there can be off-by-one errors during vblank disable/enable if the scanout is inside vblank at en/disable time, and additionally clients will never see any useable vblank timestamps when querying via drmWaitVblank ioctl. This would negatively affect swap scheduling under X11 and Wayland. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-21dma-buf: cleanup dma_buf_export() to make it easily extensibleSumit Semwal1-2/+8
At present, dma_buf_export() takes a series of parameters, which makes it difficult to add any new parameters for exporters, if required. Make it simpler by moving all these parameters into a struct, and pass the struct * as parameter to dma_buf_export(). While at it, unite dma_buf_export_named() with dma_buf_export(), and change all callers accordingly. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
2015-04-08Merge tag 'drm/tegra/for-4.1-rc1' of ↵Dave Airlie7-66/+270
git://anongit.freedesktop.org/tegra/linux into drm-next drm/tegra: Changes for v4.1-rc1 Perhaps the most noteworthy change in this set is the implementation of a hardware VBLANK counter using host1x syncpoints. The SOR registers can now be dumped via debugfs, which can be useful while debugging. The IOVA address space maintained by the driver can also be dumped via debugfs. Other than than, these changes are mostly cleanup work, such as making register names more consistent or removing unused code (that was left over after the atomic mode-setting conversion). There's also a fix for eDP that makes the driver cope with firmware that already initialized the display (such as the firmware on the Tegra-based Chromebooks). * tag 'drm/tegra/for-4.1-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: sor: Reset during initialization drm/tegra: gem: Return 64-bit offset for mmap(2) drm/tegra: hdmi: Name register fields consistently drm/tegra: hdmi: Resets are synchronous drm/tegra: dc: Document tegra_dc_state_setup_clock() drm/tegra: dc: Remove unused callbacks drm/tegra: dc: Remove unused function drm/tegra: dc: Use base atomic state helpers drm/atomic: Add helpers for state-subclassing drivers drm/tegra: dc: Implement hardware VBLANK counter gpu: host1x: Export host1x_syncpt_read() drm/tegra: sor: Dump registers via debugfs drm/tegra: sor: Registers are 32-bit drm/tegra: Provide debugfs file for the IOVA space drm/tegra: dc: Check for valid parent clock
2015-04-02drm/tegra: sor: Reset during initializationTomeu Vizoso1-0/+18
As there isn't a way for the firmware on the Nyan Chromebooks to hand over the display to the kernel, and the kernel isn't redoing the whole configuration at present. With this patch, the SOR is brought to a known state and we get correct display on every boot. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-04-02drm/tegra: hdmi: Name register fields consistentlyThierry Reding2-2/+2
Name the fields of the SOR_SEQ_CTL register consistently. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-04-02drm/tegra: hdmi: Resets are synchronousThierry Reding1-1/+1
Resets on Tegra are synchronous, so keep the clock enabled while asserting the reset. Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-04-02drm/tegra: dc: Document tegra_dc_state_setup_clock()Thierry Reding1-0/+12
This function is called by output drivers so should be documented. While at it, move it to a more appropriate location. Signed-off-by: Thierry Reding <treding@nvidia.com>