aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra
Commit message (Collapse)AuthorAge
...
| * | drm/tegra: Implement race-free hotplug detectionThierry Reding2014-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A race condition currently exists on Tegra, where it can happen that a monitor attached via HDMI isn't detected during the initial FB helper setup, but the hotplug event happens too early to be processed by the poll helpers because they haven't been initialized yet. This happens because on some boards the HDMI driver can control the regulator that supplies the +5V pin on the HDMI connector. Therefore depending on the timing between the initialization of the HDMI driver and the rest of DRM, it's possible that the monitor returns the hotplug signal right within the window where we would miss it. Unfortunately, drm_kms_helper_poll_init() will wreak havoc when called before at least some parts of the FB helpers have been set up. This commit fixes this by splitting out the minimum of initialization required to make drm_kms_helper_poll_init() work into a separate function that can be called early. It is then safe to move all of the poll helper initialization to an earlier point in time (before the HDMI output driver has a chance to enable the +5V supply). That way if the hotplug signal is returned before the initial FB helper setup, the monitor will be forcefully detected at that point, and if the hotplug signal is returned after that it will be properly handled by the poll helpers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * | drm: Introduce drm_fb_helper_prepare()Thierry Reding2014-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To implement hotplug detection in a race-free manner, drivers must call drm_kms_helper_poll_init() before hotplug events can be triggered. Such events can be triggered right after any of the encoders or connectors are initialized. At the same time, if the drm_fb_helper_hotplug_event() helper is used by a driver, then the poll helper requires some parts of the FB helper to be initialized to prevent a crash. At the same time, drm_fb_helper_init() requires information that is not necessarily available at such an early stage (number of CRTCs and connectors), so it cannot be used yet. Add a new helper, drm_fb_helper_prepare(), that initializes the bare minimum needed to allow drm_kms_helper_poll_init() to execute and any subsequent hotplug events to be processed properly. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * | drm: Constify struct drm_fb_helper_funcsThierry Reding2014-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need for this to be modifiable. Make it const so that it can be put into the .rodata section. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * | drm: add register and unregister functions for connectorsThomas Wood2014-06-19
| |/ | | | | | | | | | | | | | | | | | | Introduce generic functions to register and unregister connectors. This provides a common place to add and remove associated user space interfaces. Signed-off-by: Thomas Wood <thomas.wood@intel.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* / dma-buf: use reservation objectsMaarten Lankhorst2014-07-08
|/ | | | | | | | | | | | | This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com> #drivers/media/v4l2-core/ Acked-by: Thomas Hellstrom <thellstrom@vmware.com> #drivers/gpu/drm/ttm Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> #drivers/gpu/drm/armada/ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drm/tegra: sor - Remove obsolete commentThierry Reding2014-06-09
| | | | | | | | | According to the DP specification the disparity of the first symbol should always be negative. It is therefore safe to assume that panels will conform to that and therefore parameterizing this field should never be necessary. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Enable only the necessary number of lanesThierry Reding2014-06-09
| | | | | | | Instead of always enabling all four lanes, enable only the number probed from the link. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Power on only the necessary lanesThierry Reding2014-06-09
| | | | | | Power on only those lanes required for the specified link. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Do not program interlaced mode registersThierry Reding2014-06-09
| | | | | | | Interlaced mode is currently not supported on the SOR, so don't program any associated registers. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Do not hardcode link speedThierry Reding2014-06-09
| | | | | | | Use the speed probed from the link at runtime rather than relying on a hardcoded default. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Do not hardcode number of blank symbolsThierry Reding2014-06-09
| | | | | | | | | | | The number of HBLANK and VBLANK symbols can be computed at runtime so that they can be set appropriately depending on the video mode and DP link. These values are used by the packet generation logic to determine how many audio samples can be transferred during the blanking intervals. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Don't hardcode link parametersThierry Reding2014-06-09
| | | | | | | | | | | | | | | The currently hardcoded link parameters don't work on all eDP panels, so compute the parameters at runtime depending on the mode and panel type to allow the driver to cope with a wider variety of panels. Note that the number of bits per pixel of the panel is still hardcoded, but this can be addressed in a separate patch. This is largely based on a patch by Stéphane Marchesin but the algorithm was largely rewritten to be more readable and concise. Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Change power down orderingStéphane Marchesin2014-06-09
| | | | | | | | Lanes are powered up in decreasing order. Power them down in increasing order for consistency. Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Fix copy/paste errorStéphane Marchesin2014-06-09
| | | | | | | | The comment above mentions link A/B but this isn't what the code does, so let's fix that. Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Remove pixel clock roundingStéphane Marchesin2014-06-09
| | | | | | | | | | The code currently rounds up the clock to the next MHZ, which is rounding up a 69.5MHz clock to 70MHz on my machine. This in turn prevents the display from syncing. Removing this rounding fixes eDP for me. Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Make debugfs setup consistentThierry Reding2014-06-06
| | | | | | | Other output drivers set up debugfs slightly differently. Bring the SOR driver in line with those for consistency. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Recursively remove debugfs treeThierry Reding2014-06-06
| | | | | | | | Removing only the root directory will fail when there are still files in it. Instead of manually removing all files, remove the whole directory recursively. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dp - Mark the connector as hotplug capableThierry Reding2014-06-05
| | | | | | | Doing so allows the hotplug events generated by the connector to be properly handled by the DRM poll helpers. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dp - Implement hotplug detection in work queueThierry Reding2014-06-05
| | | | | | | | Calling the drm_helper_hpd_irq_event() helper can sleep, so instead of invoking it directly from the interrupt handler, schedule a work queue and run it from there. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: Add hardware cursor supportThierry Reding2014-06-05
| | | | | | | | Enable hardware cursor support on Tegra124. Earlier generations support the hardware cursor to some degree as well, but not in a way that can be generically exposed. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: Remove host1x drm_bus implementationThierry Reding2014-06-05
| | | | | | | The DRM core can now cope with drivers that don't have an associated struct drm_bus, so the host1x implementation is no longer useful. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: gem - Make tegra_bo_import() staticThierry Reding2014-06-05
| | | | | | | The function is never used outside of the source file and therefore can be locally scoped. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Add Tegra124 supportThierry Reding2014-06-05
| | | | | | | | Tegra124 is mostly backwards-compatible with Tegra114. However, Tegra124 supports a few more features (e.g. interlacing, ...). Introduce a new compatible string and TMDS tables to cope with these differences. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Protect CRC debugfs against enable stateThierry Reding2014-06-05
| | | | | | | | Accessing the CRC debugfs file will hang the system if the SOR is not enabled, so make sure that it is stays enabled until the CRC has been read. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Do not needlessly recompute pclkThierry Reding2014-06-05
| | | | | | | | | In some cases the pixel clock used to not be correct, which is why it had to be recomputed. It turns out that the reason why it wasn't correct is that it was used wrongly. If used correctly there's not need for the recomputation. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Compute shift clock divider in output driversThierry Reding2014-06-05
| | | | | | | | The shift clock divider is highly dependent on the type of output, so push computation of it down into the output drivers. The old code used to work merely by accident. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Move around shift clock programmingThierry Reding2014-06-05
| | | | | | | Program the shift clock divider in tegra_crtc_setup_clk() since that's where the divider is computed, so passing it around can be avoided. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Reset controller on driver unloadThierry Reding2014-06-05
| | | | | | | | Assert the DSI controller's reset when the driver is unloaded to reduce power consumption and to put the controller into a known state for subsequent driver reloads. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Fix typo when disabling controllerThierry Reding2014-06-05
| | | | | | | When disabling the DSI controller, the code wasn't really doing what it was supposed to. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Add enable guardThierry Reding2014-06-05
| | | | | | | | To prevent the enable or disable operations to potentially be run multiple times, add guards to return early when the output is already in the targetted state. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Initialize proper packet sequencesThierry Reding2014-06-05
| | | | | | | | | The packet sequencer needs to be programmed depending on the video mode of the attached peripheral. Add support for non-burst video modes with sync events (as opposed to sync pulses) and select either sequence depending on the video mode. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Implement VDD supply supportThierry Reding2014-06-05
| | | | | | | | | The DSI controllers are powered by a (typically 1.2V) regulator. Usually this is always on, so there was no need to support enabling or disabling it thus far. But in order not to consume any power when DSI is inactive, give the driver a chance to enable or disable the supply as needed. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Remove unneeded codeThierry Reding2014-06-05
| | | | | | | | A bunch of registers are initialized to 0 upon during driver probe. It turns out that none of these are actually needed, so they can simply be dropped. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dsi - Use internal pixel formatThierry Reding2014-06-05
| | | | | | | | The pixel format enumeration values used by the Tegra DSI controller don't match those defined by the DSI framework. Make sure to convert them to the internal format before writing it to the register. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Fix disable sequenceThierry Reding2014-06-05
| | | | | | | | | | | For some reason when the PW*_ENABLE and PM*_ENABLE fields are cleared during disable, the HDMI output stops working properly. Resetting and initializing doesn't help. Comment out those accesses for now until it has been determined what to do about them. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Disable LVDS modeThierry Reding2014-06-05
| | | | | | | | Disable LVDS mode according to register documentation. It seems like this has no effect on the operation of HDMI, but it's probably a good idea to do this anyway. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Use proper power-up sequenceThierry Reding2014-06-05
| | | | | | | This reflects the power-up sequence as described in the documentation, but it doesn't seem to be strictly necessary to get HDMI to work. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Clean up clock usageThierry Reding2014-06-05
| | | | | | | Clocks are never enabled or disabled in atomic context, so we can use the clk_prepare_enable() and clk_disable_unprepare() helpers instead. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Reverse regulator enable orderingThierry Reding2014-06-05
| | | | | | | Schematics indicate that the AVDD_HDMI_PLL supply should be enabled prior to the AVDD_HDMI supply. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Remove duplicate codeThierry Reding2014-06-05
| | | | | | | The generic Tegra output code already sets up the clocks properly, so there's no need to do it again when the HDMI output is enabled. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: hdmi - Add connector supply supportThierry Reding2014-06-05
| | | | | | | | | | | | | | | | | | | | | | | Revert commit 18ebc0f404d5 "drm/tegra: hdmi: Enable VDD earlier for hotplug/DDC" and instead add a new supply for the +5V pin on the HDMI connector. The vdd-supply property refers to the regulator that supplies the AVDD_HDMI input on Tegra, rather than the +5V HDMI connector pin. This was never a problem before, because all boards had that pin hooked up to a regulator that was always on. Starting with Dalmore and continuing with Venice2, the +5V pin is controllable via a GPIO. For reasons unknown, the GPIO ended up as the controlling GPIO of the AVDD_HDMI supply in the Dalmore and Venice2 DTS files. But that's not correct. Instead, a separate supply must be introduced so that the +5V pin can be controlled separately from the supplies that feed the HDMI block within Tegra. A new hdmi-supply property is introduced that takes the place of the vdd-supply and vdd-supply is only enabled when HDMI is enabled rather than all the time. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Use proper H/V ref-to-sync valuesThierry Reding2014-06-05
| | | | | | For HDMI compliance both of these values need to be set to 1. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Do not touch power control registerThierry Reding2014-06-05
| | | | | | | | Setting the bits in this register is dependent on the output type driven by the display controller. All output drivers already set these properly so there is no need to do it here again. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Reshuffle code to get rid of prototypesThierry Reding2014-06-05
| | | | | | | | The tegra_dc_format() and tegra_dc_setup_window() functions are only used internally by the display controller driver. Move them upwards in order to make them static and get rid of the function prototypes. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Rename INVERT_V to V_DIRECTIONThierry Reding2014-06-05
| | | | | | | V_DIRECTION is the name of the field in the documentation, so use that for consistency. Also add the H_DIRECTION field for completeness. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: sor - Add CRC debugfs supportThierry Reding2014-06-05
| | | | | | | | The SOR allows the computation of a 32 bit CRC of the content that it transmits. This functionality is exposed via debugfs and is useful to verify proper operation of the SOR. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: dc - Add YUYV supportThierry Reding2014-06-05
| | | | | | | | | | | | YUYV is UYVY with swapped bytes. Luckily the Tegra DC hardware can swap bytes during scan-out, so supporting YUYV is simply a matter of writing the correct value to the byteswap register. This patch modifies tegra_dc_format() to return the byte swap parameter via an output parameter in addition to returning the pixel format. Many other formats can potentially be supported in a similar way. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm/tegra: Cleanup header fileThierry Reding2014-06-05
| | | | | | | Remove extern keyword from function prototypes since it isn't needed and drop an unnecessary forward declaration. Signed-off-by: Thierry Reding <treding@nvidia.com>
* drm: add drm_fb_helper_restore_fbdev_mode_unlocked()Rob Clark2014-06-04
| | | | | | | | | All drm_fb_helper_restore_fbdev_mode() call sites, save one, do the same locking. Simplify this into drm_fb_helper_restore_fbdev_mode_unlocked(). Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/dp: add a hw mutex around the transfer functions. (v2)Dave Airlie2014-06-04
| | | | | | | | | This should avoid races between connector probing and HPD irqs in the future, currently mode_config.mutex blocks this possibility. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>