aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-06-09drm/tegra: sor - Remove obsolete commentThierry Reding1-1/+1
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>
2014-06-09drm/tegra: sor - Enable only the necessary number of lanesThierry Reding1-1/+1
Instead of always enabling all four lanes, enable only the number probed from the link. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-09drm/tegra: sor - Power on only the necessary lanesThierry Reding1-3/+17
Power on only those lanes required for the specified link. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-09drm/tegra: sor - Do not program interlaced mode registersThierry Reding1-3/+0
Interlaced mode is currently not supported on the SOR, so don't program any associated registers. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-09drm/tegra: sor - Do not hardcode link speedThierry Reding1-2/+2
Use the speed probed from the link at runtime rather than relying on a hardcoded default. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-09drm/tegra: sor - Do not hardcode number of blank symbolsThierry Reding1-3/+23
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>
2014-06-09drm/tegra: sor - Don't hardcode link parametersThierry Reding1-10/+213
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>
2014-06-09drm/tegra: sor - Change power down orderingStéphane Marchesin1-1/+1
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>
2014-06-09drm/tegra: sor - Fix copy/paste errorStéphane Marchesin1-1/+1
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>
2014-06-09drm/tegra: sor - Remove pixel clock roundingStéphane Marchesin1-3/+0
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>
2014-06-06drm/tegra: sor - Make debugfs setup consistentThierry Reding1-6/+5
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>
2014-06-06drm/tegra: sor - Recursively remove debugfs treeThierry Reding1-1/+1
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>
2014-06-05drm/tegra: dp - Mark the connector as hotplug capableThierry Reding1-0/+1
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>
2014-06-05drm/tegra: dp - Implement hotplug detection in work queueThierry Reding1-10/+20
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>
2014-06-05drm/tegra: Add hardware cursor supportThierry Reding2-3/+138
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>
2014-06-05drm/tegra: Remove host1x drm_bus implementationThierry Reding10-96/+52
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>
2014-06-05drm/tegra: gem - Make tegra_bo_import() staticThierry Reding1-1/+2
The function is never used outside of the source file and therefore can be locally scoped. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-05drm/tegra: hdmi - Add Tegra124 supportThierry Reding2-0/+89
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>
2014-06-05drm/tegra: sor - Protect CRC debugfs against enable stateThierry Reding1-24/+45
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>
2014-06-05drm/tegra: dsi - Do not needlessly recompute pclkThierry Reding1-1/+0
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>
2014-06-05drm/tegra: dc - Compute shift clock divider in output driversThierry Reding6-41/+82
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>
2014-06-05drm/tegra: dc - Move around shift clock programmingThierry Reding1-9/+10
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>
2014-06-05drm/tegra: dsi - Reset controller on driver unloadThierry Reding1-0/+1
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>
2014-06-05drm/tegra: dsi - Fix typo when disabling controllerThierry Reding1-1/+1
When disabling the DSI controller, the code wasn't really doing what it was supposed to. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-05drm/tegra: dsi - Add enable guardThierry Reding1-0/+11
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>
2014-06-05drm/tegra: dsi - Initialize proper packet sequencesThierry Reding1-4/+46
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>
2014-06-05drm/tegra: dsi - Implement VDD supply supportThierry Reding1-0/+17
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>
2014-06-05drm/tegra: dsi - Remove unneeded codeThierry Reding1-85/+0
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>
2014-06-05drm/tegra: dsi - Use internal pixel formatThierry Reding2-1/+43
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>
2014-06-05drm/tegra: hdmi - Fix disable sequenceThierry Reding1-0/+8
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>
2014-06-05drm/tegra: hdmi - Disable LVDS modeThierry Reding2-1/+10
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>
2014-06-05drm/tegra: hdmi - Use proper power-up sequenceThierry Reding1-0/+11
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>
2014-06-05drm/tegra: hdmi - Clean up clock usageThierry Reding1-14/+6
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>
2014-06-05drm/tegra: hdmi - Reverse regulator enable orderingThierry Reding1-12/+12
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>
2014-06-05drm/tegra: hdmi - Remove duplicate codeThierry Reding1-10/+0
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>
2014-06-05drm/tegra: hdmi - Add connector supply supportThierry Reding1-9/+23
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>
2014-06-05drm/tegra: dc - Use proper H/V ref-to-sync valuesThierry Reding1-3/+2
For HDMI compliance both of these values need to be set to 1. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-05drm/tegra: dc - Do not touch power control registerThierry Reding1-4/+0
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>
2014-06-05drm/tegra: dc - Reshuffle code to get rid of prototypesThierry Reding2-251/+248
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>
2014-06-05drm/tegra: dc - Rename INVERT_V to V_DIRECTIONThierry Reding2-4/+5
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>
2014-06-05drm/tegra: sor - Add CRC debugfs supportThierry Reding2-0/+125
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>
2014-06-05drm/tegra: dc - Add YUYV supportThierry Reding2-6/+22
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>
2014-06-05drm/tegra: Cleanup header fileThierry Reding1-26/+23
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>
2014-06-05drm: add drm_fb_helper_restore_fbdev_mode_unlocked()Rob Clark1-5/+2
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>
2014-06-05drm/dp: add a hw mutex around the transfer functions. (v2)Dave Airlie1-2/+2
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>
2014-05-01Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-nextDave Airlie1-11/+0
Next pull request, this time more of the drm de-midlayering work. The big thing is that his patch series here removes everything from drm_bus except the set_busid callback. Thierry has a few more patches on top of this to make that one optional to. With that we can ditch all the non-pci drm_bus implementations, which Thierry has already done for the fake tegra host1x drm_bus. Reviewed by Thierry, Laurent and David and now also survived some testing on my intel boxes to make sure the irq fumble is fixed correctly ;-) The last minute rebase was just to add the r-b tags from Thierry for the 2 patches I've redone. * 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm: drm/<drivers>: don't set driver->dev_priv_size to 0 drm: Remove dev->kdriver drm: remove drm_bus->get_name drm: rip out dev->devname drm: inline drm_pci_set_unique drm: remove bus->get_irq implementations drm: pass the irq explicitly to drm_irq_install drm/irq: Look up the pci irq directly in the drm_control ioctl drm/irq: track the irq installed in drm_irq_install in dev->irq drm: rename dev->count_lock to dev->buf_lock drm: Rip out totally bogus vga_switcheroo->can_switch locking drm: kill drm_bus->bus_type drm: remove drm_dev_to_irq from drivers drm/irq: remove cargo-culted locking from irq_install/uninstall drm/irq: drm_control is a legacy ioctl, so pci devices only drm/pci: fold in irq_by_busid support drm/irq: simplify irq checks in drm_wait_vblank
2014-04-28Merge tag 'drm/tegra/for-3.15-rc3' of git://anongit.freedesktop.org/tegra/linux into drm-nextDave Airlie1-1/+1
drm/tegra: Fixes for v3.15-rc3 A single fix for some framebuffer reference counting fallout caused by the primary plane helpers introduced in 3.15-rc1. * tag 'drm/tegra/for-3.15-rc3' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: restrict plane loops to legacy planes
2014-04-24drm/tegra: restrict plane loops to legacy planesDaniel Vetter1-1/+1
In Matt Ropers primary plane series a set of prep patches like commit af2b653bfb4ef40931b4d101ca842ce0c5da57ef Author: Matt Roper <matthew.d.roper@intel.com> Date: Tue Apr 1 15:22:32 2014 -0700 drm/i915: Restrict plane loops to only operate on overlay planes (v2) ensured that all exisiting users of the mode_config->plane_list wouldn't change behaviour. Unfortunately tegra seems to have fallen through the cracks. Fix it. This regression was introduced in commit e13161af80c185ecd8dc4641d0f5df58f9e3e0af Author: Matt Roper <matthew.d.roper@intel.com> Date: Tue Apr 1 15:22:38 2014 -0700 drm: Add drm_crtc_init_with_planes() (v2) The result was that we've unref'ed the fb for the primary plane twice, leading to a use-after free bug. This is because the drm core will already set crtc->primary->fb to NULL and do the unref for us, and the crtc disable hook is called by the drm crtc helpers for exactly this case. Aside: Now that the fbdev helpers clean up planes there's no longer a need to do this in drivers. So this could probably be nuked entirely in linux-next. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-04-23drm: rip out dev->devnameDaniel Vetter1-10/+0
This was only ever used to pretty-print the irq driver name. And on kms systems due to set_version bonghits we never set up the prettier name, ever. Which make this a bit pointless. Also, we can always dig out the driver-instance/irq relationship through other means, so this isn't that useful. So just rip it out to simplify the set_version/set_busid insanity a bit. Also delete the temporary busname from drm_pci_set_busid, it's now unused. v2: Rebase on top of the new host1x drm_bus for tegra. Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-22drm: kill drm_bus->bus_typeDaniel Vetter1-1/+0
Completely unused. Hooray, midlayer mistakes that didn't cause work to undo! v2: Rebase on top of the recent tegra changes which added a host1x drm bus. Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>