aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-08-16drm/exynos: clear channels only when iommu is enabledJoonyoung Shim1-1/+2
This is simplest solution about reported problem[1]. It's no problem to clear channel only when iommu is enabled, if we consider that we cannot recognize iommu errors when iommu is disabled and it have been valid until now. But this cannot be nice solution. [1] https://lkml.org/lkml/2015/7/21/404 Reported-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: remove drm_iommu_attach_device_if_possibleJoonyoung Shim7-31/+10
Already drm_iommu_attach_device checks whether support iommu internally. It should clear channels always regardless iommu support. We didn't know because we can detect the problem when iommu is enabled, so we don't have to use drm_iommu_attach_device_if_possible and then we can remove drm_iommu_attach_device_if_possible and clear_channels function pointer. Signed-off-by: Joonyoung Shim <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: move order to register vidi kms driverJoonyoung Shim1-3/+3
The vidi is virtual kms driver and now it is registered earlier than actual hw kms drivers, so it will occupy crtc index 0. Some users assume the condition yet that actual hw kms driver has crtc index 0. It may or may not be matter but let's arrange register order. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/mixer: replace MXR_INT_EN register cache with flagAndrzej Hajda1-11/+9
Driver uses only VSYNC interrupts, so we need to cache VSYNC bit state only. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/mixer: simplify poweron flagAndrzej Hajda1-38/+14
The driver uses bool protected by mutex to track power state. The patch replaces this combo with single bit and atomic bitops. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: remove unnecessary checking to support iommuJoonyoung Shim7-38/+13
Already drm_iommu_attach_device and drm_iommu_detach_device check whether support iommu internally, so we don't have to call is_drm_iommu_supported before call them. Signed-off-by: Joonyoung Shim <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: remove to use ifdef CONFIG_ARM_DMA_USE_IOMMUJoonyoung Shim1-4/+0
If CONFIG_ARM_DMA_USE_IOMMU is disable, CONFIG_DRM_EXYNOS_IOMMU also is disable. When CONFIG_DRM_EXYNOS_IOMMU is disable, is_drm_iommu_supported() returns always false, so we can remove to use ifdef CONFIG_ARM_DMA_USE_IOMMU in is_drm_iommu_supported(). Signed-off-by: Joonyoung Shim <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: gsc: Handles the combination of rotation and flipHyungwon Hwang1-0/+16
The unique results of all the combination of rotation and flip can be represented by just 8 states. This patch handles all the combination correctly. Signed-off-by: Hyungwon Hwang <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: remove hdmi_v14_conf structAndrzej Hajda1-318/+109
The patch removes intermediate struct for HDMIv14 register configuration, instead registry values are calculated on the fly. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: remove hdmi_v13_conf structAndrzej Hajda1-179/+101
The patch removes intermediate struct for HDMIv13 register configuration, instead registry values are calculated on the fly. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: remove redundant configuration fieldsAndrzej Hajda1-44/+24
The patch removes redundant fields from hdmi_conf_regs. Their values can be calculated from current_mode. This patch is the first step to remove whole hdmi_conf_regs structure. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: add driver data pointer to private contextAndrzej Hajda1-29/+20
The patch replaces duplicated driver data fields in private context with pointer to driver data. It also simplifies driver data lookup code. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: remove private lock codeAndrzej Hajda1-24/+3
Most of the code is called by drm core framework, so it is already synchronized. The only async function is irq routine which only calls drm framework so it does not need to be synchronized. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: Simplify HPD gpio handlingAndrzej Hajda1-10/+3
GPIO is tested only in hdmi_detect, so there is no reason to set it in other places and to preserve its value in context. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: remove old platform data codeAndrzej Hajda1-31/+5
s5p_hdmi_platform_data were used before device tree introduction. As HDMI driver is DT only we can drop this struct completely. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/fimc: fix runtime pm supportMarek Szyprowski1-1/+0
Once pm_runtime_set_active() gets called, the kernel assumes that given device has already enabled runtime pm and will call pm_runtime_suspend() without matching pm_runtime_resume(). In case of DRM FIMC IPP driver, this will result in calling clk_disable() without respective call to clk_enable(). This patch removes call to pm_runtime_set_active() to ensure that pm_runtime_suspend/resume calls will match. Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/mixer: always update INT_EN cacheAndrzej Hajda1-0/+5
INT_EN cache field was updated only by mixer_enable_vblank. The patch adds update also by mixer_disable_vblank function. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/mixer: correct vsync configuration sequenceAndrzej Hajda1-2/+5
Specification advises to clear vsync indicator before configuring vsync. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/mixer: fix interrupt clearingAndrzej Hajda1-5/+4
The driver used incorrect flags to clear interrupt status. The patch fixes it. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos/hdmi: fix edid memory leakAndrzej Hajda1-1/+6
edid returned by drm_get_edid should be freed. The patch fixes it. Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-16drm/exynos: gsc: fix wrong bitwise operation for swap detectionHyungwon Hwang1-4/+2
The bits for rotation are not used as exclusively. So GSC_IN_ROT_270 can not be used for swap detection. The definition of it is same with GSC_IN_ROT_MASK. It is enough to check GSC_IN_ROT_90 bit is set or not to check whether width / height size swapping is needed. Signed-off-by: Hyungwon Hwang <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-08-15drm/msm/dsi: Introduce DSI configuration moduleHai Li4-146/+177
With more platforms supported, the DSI host configuration array keeps expanding. This change moves those to a separate dsi_cfg module. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Make each PHY type compilation independentHai Li4-4/+33
On a certain platform, only one type of DSI PHY is used. This change allows the user to only compile the PHY type which is being used. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Split PHY drivers to separate filesHai Li6-758/+857
This change moves each PHY type specific code into separate files. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Return void from msm_dsi_phy_disable()Hai Li2-12/+6
We are not checking the return value from msm_dsi_phy_disable(). Change the return type to void. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Specify bitmask to set source PLLHai Li1-5/+11
The bit position to configure source PLL will change on new types of PHYs. The caller should pass down this information. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp: Clear pending interrupt status before enable interruptjilai wang6-10/+23
Pending interrupt status needs to be cleared before enable the interrupt. Otherwise it's possible to get a pending interrupt instead of an incoming interrupt. Signed-off-by: Jilai Wang <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: Add rotation (hflip/vflip) support to MDP5 planes (v2)jilai wang1-8/+41
MDP5 SSPPs can flip the input source horizontally or vertically. This change is to add this support to MDP5 planes. v1: Initial change v2: Use existing "rotation" property instead of creating msm specific properties. In order to be compatiable with legacy non-atomic set_property, switch to drm_atomic_helper_plane_set_property helper function. Signed-off-by: Jilai Wang <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm: add calls to prepare and unprepare panelSrinivas Kandagatla1-2/+6
Prepare the panel before it's enabled and un-prepare after disable, this will make sure that the regulators are switched on and off correctly. Tested it on APQ8064 based IFC6410 with panel. Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Modify dsi manager bridge ops to work with external bridgesArchit Taneja1-15/+28
The dsi bridge ops call drm_panel functions to set up the connected drm_panel. Add checks to make sure these aren't called when we're connected to an external bridge. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Allow dsi to connect to an external bridgeArchit Taneja4-8/+90
There are platforms where the DSI output can be connected to another encoder bridge chip (DSI to HDMI, DSI to LVDS etc). Add support for external bridge support to the dsi driver. We assume that the external bridge chip would be of the type drm_bridge. The dsi driver's internal drm_bridge (msm_dsi->bridge) is linked to the external bridge's drm_bridge struct. In the case we're connected to an external bridge, we don't need to create and manage a connector within our driver, it's the bridge driver's responsibility to create one. v2: - Move the external bridge attaching stuff to dsi manager to make things cleaner. - Force the bridge to connect to a video mode encoder for now (the dsi mode flags may have not been populated by modeset_init) Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Create a helper to check if there is a connected deviceArchit Taneja3-3/+10
Create a helper msm_dsi_device_connected() which checks whether we have a device connected to the dsi host or not. This check gets messy when we have support external bridges too. Having an inline function makes it more legible. For now, the check only consists of msm_dsi->panel being non-NULL. Later, this will check if we have an external bridge or not. This helper isn't used in dsi_connector related code as that's specific to only when a drm_panel is connected. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Refer to connected device as 'device' instead of 'panel'Archit Taneja4-16/+16
We currently support only panels connected to dsi output. We're going to also support external bridge chips now. Change 'panel_node' to 'device_node' in the struct msm_dsi_host and 'panel_flags' to 'device_flags' in msm_dsi. This makes things sound a bit more generic. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Make TE gpio optionalArchit Taneja1-1/+2
Platforms containing only DSI video mode devices don't need a TE gpio. Make TE gpio optional. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm: mdp4 lvds: get panel node via of graph parsingArchit Taneja2-9/+25
We currently get the output connected to LVDS by looking for a phandle called 'qcom,lvds-panel' under the mdp DT node. Use the more standard of_graph approach to create an lvds output port, and retrieve the panel node from the port's endpoint data. v3 - Fix return value checks of of_graph_* calls. Tested-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm: dsi host: Use device graph parsing to parse connected panelArchit Taneja2-19/+68
The dsi host looks for the connected panel node by parsing for a child named 'panel'. This hierarchy isn't very flexible. The connected panel is forced to be a child to the dsi host, and hence, a mipi dsi device. This isn't suitable for dsi devices that don't use mipi dsi as their control bus. Follow the of_graph approach of creating ports and endpoints to represent the connections between the dsi host and the panel connected to it. In our case, the dsi host will only have one output port, linked to the panel's input port. Update DT binding documentation with device graph usage info. v3: - Fix return value checks of of_graph_* calls. - Don't make port a mandatory DT property - Fix defer check when no panel node specified - Rename parse_dt func to align with other dsi_host funcs Reviewed-by: Hai Li <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm: dsi host: add missing of_node_put()Archit Taneja1-1/+5
Decrement device node refcount if of_get_child_by_name is successfully called. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm: Enable clocks during enable/disable_vblank() callbacksHai Li4-2/+102
AHB clock should be enabled before accessing registers during enable/disable_vblank(). Since these 2 callbacks are called in atomic context while clk_prepare may cause thread sleep, a work is scheduled to control vblanks. v2: fixup spinlock initialization Signed-off-by: Hai Li <[email protected]> [add comment about cancel_work_sync() before drm_irq_uninstall()] Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: Add support for msm8x74v1jilai wang1-4/+73
msm8x74v1 has different MDP5 version (v1.0) from msm8x74v2 (v1.2). Add a separate config data to support msm8x74v1. Signed-off-by: Jilai Wang <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: Add DMA pipe planes for MDP5jilai wang1-4/+21
This change is to add planes which use DMA pipes for MDP5. Signed-off-by: Jilai Wang <[email protected]> [slight comment adjust to s/Construct public planes/Construct video planes/ since DMA planes are public planes too, they just can't scale or CSC] Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp: Add capabilities to MDP planes (v2)jilai wang8-63/+114
MDP planes can be implemented using different type of HW pipes, RGB/VIG/DMA pipes for MDP5 and RGB/VG/DMA pipes for MDP4. Each type of pipe has different HW capabilities such as scaling, color space conversion, decimation... Add a variable in plane data structure to specify the difference of each plane which comes from mdp5_cfg data and use it to differenciate the plane operation. V1: Initial change V2: Fix a typo in mdp4_kms.h Signed-off-by: Jilai Wang <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: add more YUV formats for MDP5Stephane Viau2-47/+77
Add packed YUV422 and planar YUV420 formats to MDP supported formats. Signed-off-by: Stephane Viau <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: use 2 memory clients for YUV formats on newer mdp5Wentao Xu3-6/+25
Newer MDP5 uses 2 shared memory pool clients for certain YUV formats. For example, if VIG0 is used to fetch data in YUYV format, it will use VIG0_Y for Y component, and VIG0_Cr for UV packed. Signed-off-by: Wentao Xu <[email protected]> [rebase] Signed-off-by: Stephane Viau <[email protected]>
2015-08-15drm/msm/mdp: mark if a MDP format is YUV at definitionWentao Xu2-14/+16
This makes it easy to determine if a format is YUV. The old method of using chroma sample type incorrectly marks YUV444 as RGB format. Signed-off-by: Wentao Xu <[email protected]> [rebase] Signed-off-by: Stephane Viau <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dp: use flags argument of devm_gpiod_get to set directionUwe Kleine-König1-15/+2
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Use this to simplify the driver. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. Acked-by: Alexandre Courbot <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Save/Restore PLL status across PHY resetHai Li5-36/+68
Reset DSI PHY silently changes its PLL registers to reset status, which will make cached status in clock driver invalid and result in wrong output rate of link clocks. The current restore mechanism in DSI PLL does not cover all the cases. This change is to recover PLL status after PHY reset to match HW status with cached status in clock driver. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: One function call less in dsi_init() after error detectionMarkus Elfring1-13/+9
The dsi_destroy() function was called in two cases by the dsi_init() function during error handling even if the passed variable contained a null pointer. * This implementation detail could be improved by adjustments for jump targets according to the Linux coding style convention. * Drop an unnecessary initialisation for the variable "msm_dsi" then. Signed-off-by: Markus Elfring <[email protected]> [add couple missing ERR_PTR()'s] Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy"Markus Elfring1-3/+1
The dsi_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: Allocate CTL0/1 for dual DSI single FLUSHHai Li4-23/+129
This change takes advantage of a HW feature that synchronize flush operation on CTL1 to CTL0, to keep dual DSI pipes in sync. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2015-08-15drm/msm/mdp5: Allocate CTL for each display interfaceHai Li7-79/+80
In MDP5, CTL contains information of the whole pipeline whose output goes down to a display interface. In various cases, one interface may require 2 CRTCs, but only one CTL. Some interfaces also require to use certain CTLs. Instead of allocating CTL for each active CRTC, this change is to associate a CTL with each interface. Signed-off-by: Hai Li <[email protected]> Signed-off-by: Rob Clark <[email protected]>