aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-13drm/tegra: gem: Use dma_mmap_writecombine()Thierry Reding1-4/+12
Use the existing API rather than open-coding equivalent functionality in the driver. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: gem: Remove redundant drm_gem_free_mmap_offset()Thierry Reding1-2/+0
The drm_gem_object_release() function already performs this cleanup, so there is no reason to do it explicitly. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: gem: Cleanup tegra_bo_create_with_handle()Thierry Reding1-8/+6
There is only a single location where the function needs to do cleanup. Skip the error unwinding path and call the cleanup function directly instead. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: gem: Extract tegra_bo_alloc_object()Thierry Reding1-39/+38
This function implements the common buffer object allocation used for both allocation and import paths. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Set up PHY_TIMING & BTA_TIMING registers earlierSean Paul1-4/+7
Make sure the DSI PHY_TIMING and BTA_TIMING registers are initialized when the clocks are set up as opposed to when the output is enabled. This makes sure that the PHY timings are properly set up when the panel is prepared and that DCS commands sent at that time use the appropriate timings. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Replace 1000000 by USEC_PER_SECThierry Reding1-1/+1
Using the symbolic constant instantly provides a lot more context. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Replace 1000000000UL by NSEC_PER_SECThierry Reding1-1/+1
Using the symbolic constant instantly provides a lot more context. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Implement host transfersThierry Reding2-1/+279
Add support for sending MIPI DSI command packets from the host to a peripheral. This is required for panels that need configuration before they accept video data. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Add ganged mode supportThierry Reding3-29/+195
Implement ganged mode support for the Tegra DSI driver. The DSI host controller to gang up with is specified via a phandle in the device tree and the resolved DSI host controller used for the programming of the ganged-mode registers. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Split out tegra_dsi_set_timeout()Thierry Reding1-15/+23
In preparation for adding ganged-mode support, this commit splits out the tegra_dsi_set_timeout() function so that it can be reused for the slave DSI controller. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Add command mode supportThierry Reding1-19/+63
Add support for DC-driven command mode. This is a mode where the video stream sent by the display controller is packed into DCS command packets (write_memory_start and write_memory_continue) by the DSI controller. It can be used for panels with a remote framebuffer and is useful to save power when used with a dynamic refresh rate (not yet supported by the driver). Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Refactor in preparation for command modeThierry Reding1-19/+81
For command mode panels, the DSI controller needs to be enabled and configured so that panel drivers can send commands prior to the video stream being enabled. Move code from the monolithic output enable/disable functions into smaller, reusable units to allow more fine-grained control over the controller state. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Properly cleanup on probe failureThierry Reding1-15/+37
The driver wasn't even attempting to do any cleanup when probing failed. Fix this by releasing any resources acquired up to the point of failure and putting the device back into the original state (reset, clocks off). Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Mark connector hotpluggableThierry Reding1-2/+4
DSI panels can always be hotplugged via the DSI bus' attach/detach infrastructure, so unconditionally mark the connector hotpluggable. While at it, also make sure that when a panel is detached the connector is marked unconnected before calling into the DRM hotplug helpers to reflect the correct state. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Leave parent clock aloneThierry Reding1-7/+0
The common clock framework will take care of preparing and enabling the parent of the DSI clock automatically. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Do not manage clock on enable/disableThierry Reding1-15/+14
In preparation for supporting command mode panels, don't disable the clock when the output is disabled. The output will be enabled only after the panel has been programmed in command mode, so the clock must always remain on. As a side-effect, pad calibration now only needs to be done at driver probe time, since neither power nor controller state will go away before driver removal. While at it, use a 32-bit variable to store register content because the registers are 32-bit even on 64-bit Tegra. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dsi: Make FIFO depths host parametersThierry Reding1-4/+6
Rather than hardcoding them as macros, make the host and video FIFO depths parameters so that they can be more easily adjusted if a new generation of the Tegra SoC changes them. While at it, set the depth of the video FIFO to the correct value of 1920 *words* rather than *bytes*. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: DPMS off/on in encoder prepare/commitSean Paul1-0/+2
Previously the panel and output were only enabled on encoder->dpms(). If userspace called dpms on before doing a modeset, the driver would get into a state where the connector had a dpms state of ON, but the encoder and output were not enabled (because the encoder is not yet attached to the connector). Subsequent dpms ON calls are ignored b/c the connector's state already matches the desired state. This patch enables/disables the panel and output on modeset as well, so we can catch the above case. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: Do not enable output on .mode_set()Thierry Reding1-6/+0
The output is already enabled in .dpms(), doing it in .mode_set() too can cause noticeable flicker. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/tegra: dc: Add powergate supportThierry Reding2-3/+43
Both display controllers are in their own power partition. Currently the driver relies on the assumption that these partitions are on (which is the hardware default). However some bootloaders may disable them, so the driver must make sure to turn them back on to avoid hangs. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: mipi: Set MIPI_CAL_BIAS_PAD_CFG1 registerSean Paul1-0/+4
During calibration, sets the "internal reference level for drive pull- down" to the value specified in the Tegra TRM. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: mipi: Calibrate clock lanesSean Paul1-32/+92
Include the clock lanes when calibrating the MIPI PHY on Tegra124 compatible devices. Signed-off-by: Sean Paul <[email protected]> [[email protected]: bikeshedding] Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: mipi: Preserve the contents of MIPI_CAL_CTRLSean Paul1-1/+3
By paving the CTRL reg value, the current code changes MIPI_CAL_PRESCALE ("Auto-cal calibration step prescale") from 1us to 0.1us (val=0). In the description for PHY's noise filter (MIPI_CAL_NOISE_FLT), the TRM states that if the value of the prescale is 0 (or 0.1us), the filter should be set between 2-5. However, the current code sets it to 0. For now, let's keep the prescale and filter values as-is, which is most likely the power-on-reset values of 0x2 and 0xa, respectively. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: mipi: Registers are 32 bits wideThierry Reding1-8/+8
On 64-bit platforms an unsigned long would be 64 bit and cause unnecessary casting when being passed to writel() or returned from readl(). Make register values 32 bits wide to avoid that. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13gpu: host1x: Make gather offsets unsignedThierry Reding1-1/+1
Use the u32 type for the offset in the host1x_job_gather structure for consistentcy with other structures. Negative offsets don't make sense in this context. 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 Reding3-4/+4
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 Reding2-16/+23
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-11-13drm/tegra: Depend on COMMON_CLKThierry Reding1-0/+1
The introduction of the COMPILE_TEST dependency in commit 158b50aefa14 (drm/tegra: Increase compile test coverage) removes the dependency on COMMON_CLK (implicitly selected via ARCH_TEGRA, ARCH_MULTI_V7 and ARCH_MULTIPLATFORM). Reported-by: Russell King <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13Merge branch 'drm/panel/for-next' into drm/tegra/for-nextThierry Reding11-64/+382
2014-11-13drm/panel: Add Sharp LQ101R1SX01 supportThierry Reding4-0/+527
This panel requires dual-channel mode. The device accepts command-mode data on 8 lanes and will therefore need a dual-channel DSI controller. The two interfaces that make up this device need to be instantiated in the controllers that gang up to provide the dual-channel DSI host. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Do not require .owner field to be setThierry Reding4-6/+12
Drivers now no longer need to set the .owner field. It will be automatically set at registration time. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Resolve MIPI DSI device from phandleThierry Reding2-0/+24
Add a function, of_find_mipi_dsi_device_by_node(), that can be used to resolve a phandle to a MIPI DSI device. Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement DCS set_{column,page}_address commandsThierry Reding2-0/+52
Provide small convenience wrappers to set the column and page extents of the frame memory accessed by the host processors. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement DCS {get,set}_pixel_format commandsThierry Reding2-0/+48
Provide small convenience wrappers to query or set the pixel format used by the interface. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement DCS get_power_mode commandThierry Reding2-0/+32
Provide a small convenience wrapper that transmits a DCS get_power_mode command. A set of bitmasks for the mode bits is also provided. Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement DCS soft_reset commandThierry Reding2-0/+19
Provide a small convenience wrapper that transmits a DCS soft_reset command. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement DCS nop commandThierry Reding2-0/+19
Provide a small convenience wrapper that transmits a DCS nop command. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Add to DocBook documentationThierry Reding3-4/+36
Integrate the MIPI DSI helpers into DocBook and clean up various kerneldoc warnings. Also add a brief DOC section and clarify some aspects of the mipi_dsi_host struct's .transfer() operation. Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement some standard DCS commandsYoungJun Cho2-0/+137
Add helpers for the {enter,exit}_sleep_mode, set_display_{on,off} and set_tear_{on,off} DCS commands. Signed-off-by: YoungJun Cho <[email protected]> Reviewed-by: Sean Paul <[email protected]> [treding: kerneldoc and other minor cleanup] Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Implement generic read and write commandsThierry Reding2-0/+95
Implement generic read and write commands. Selection of the proper data type for packets is done automatically based on the number of parameters or payload length. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/panel: s6e8aa0: Use standard MIPI DSI functionThierry Reding1-14/+2
Use the newly introduced mipi_dsi_set_maximum_return_packet_size() function to replace an open-coded version. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Add mipi_dsi_set_maximum_return_packet_size() helperYoungJun Cho2-0/+26
This function can be used to set the maximum return packet size for a MIPI DSI peripheral. Signed-off-by: YoungJun Cho <[email protected]> Reviewed-by: Sean Paul <[email protected]> [treding: endianess, kerneldoc, return value] Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Constify mipi_dsi_msgThierry Reding2-2/+2
struct mipi_dsi_msg is a read-only structure, drivers should never need to modify it. Make this explicit by making all references to the struct const. Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Make mipi_dsi_dcs_{read,write}() symmetricalThierry Reding3-15/+70
Currently the mipi_dsi_dcs_write() function requires the DCS command byte to be embedded within the write buffer whereas mipi_dsi_dcs_read() has a separate parameter. Make them more symmetrical by adding an extra command parameter to mipi_dsi_dcs_write(). The S6E8AA0 driver relies on the old asymmetric API and there's concern that moving to the new API may be less efficient. Provide a new function with the old semantics for those cases and make the S6E8AA0 driver use it instead. Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Add DSI transfer helperThierry Reding1-16/+16
A common pattern is starting to emerge for higher level transfer helpers. Create a new helper that encapsulates this pattern and avoids code duplication. Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Add message to packet translatorThierry Reding2-0/+71
This commit introduces a new function, mipi_dsi_create_packet(), which converts from a MIPI DSI message to a MIPI DSI packet. The MIPI DSI packet is as close to the protocol described in the DSI specification as possible and useful in drivers that need to write a DSI packet into a FIFO to send a message off to the peripheral. Suggested-by: Andrzej Hajda <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/dsi: Introduce packet format helpersThierry Reding2-0/+70
Add two helpers, mipi_dsi_packet_format_is_{short,long}(), that help in determining the format of a packet. Signed-off-by: Thierry Reding <[email protected]>
2014-11-13drm/cma: Remove call to drm_gem_free_mmap_offset()Thierry Reding1-2/+0
drm_gem_object_release() called later in the drm_gem_cma_free_object() function already calls this, so there's no need to do this explicitly. Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Thierry Reding <[email protected]>