path: root/drivers/gpu/drm/msm/dsi/dsi.c
AgeCommit message (Collapse)AuthorFilesLines
2019-06-28Merge tag 'drm-msm-next-2019-06-25' of ↵Dave Airlie1-0/+2 into drm-next + usual progress on cleanups + dsi vs EPROBE_DEFER fixes + msm8998 (snapdragon 835 support) + a540 gpu support (mesa support already landed) + dsi, dsi-phy support + mdp5 and dpu interconnect (bus/memory scaling) support + initial prep work for per-context pagetables (at least the parts that don't have external dependencies like iommu/arm-smmu) There is one more patch for fixing DSI cmd mode panels (part of a set of patches to get things working on nexus5), but it would be conflicty with 1cff7440a86e04a613665803b42034 in drm-next without rebasing or back-merge, and since it doesn't conflict with anything in msm-next, I think it best if Sean merges that through drm-mix-fixes instead. (In other news, I've been making some progress w/ getting efifb working properly on sdm850 laptop without horrible hacks, and drm/msm + clk stuff not totally falling over when bootloader enables display and things are already running when driver probes.. but not quite ready yet, hopefully we can post some of that for 5.4.. should help for both the sdm835 and sdm850 laptops.) Signed-off-by: Dave Airlie <> From: Rob Clark <> Link:
2019-06-20drm/msm/dsi: Move setup_encoder to modeset_initSean Paul1-0/+2
Now that the panel probe/setup is in the modeset path, we can call dsi_manager_setup_encoder() in a common place for both internal and external bridge setups. Reviewed-by: Rob Clark <> Signed-off-by: Sean Paul <> Link:
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 and only version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 294 file(s). Signed-off-by: Thomas Gleixner <> Reviewed-by: Allison Randal <> Reviewed-by: Alexios Zavras <> Cc: Link: Signed-off-by: Greg Kroah-Hartman <>
2018-12-11drm: msm: Use DRM_DEV_* instead of dev_*Mamta Shukla1-5/+5
Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate drm-formatted specific log messages so that it will be easy to differentiate in case of multiple instances of driver. Signed-off-by: Mamta Shukla <> Signed-off-by: Rob Clark <>
2018-10-03drm/msm: Don't fail bind if nothing connected to dsiSean Paul1-2/+7
If there is no bridge or panel connected to a dsi node, don't fail the entire msm bind. Just ignore the dsi block and move on. Cc: Doug Anderson <> Reviewed-by: Abhinav Kumar <> Signed-off-by: Sean Paul <> Signed-off-by: Rob Clark <>
2018-10-03drm/msm: dsi: Initialize msm_dsi->id to -1Sean Paul1-0/+1
Currently msm_dsi->id is initialized to 0 during kzalloc. If bind fails for a secondary dsi device before its id can be properly set (such as during dt parsing), the id will point to the primary dsi device, causing its reference to be removed from dsi_manager's global (msm_dsim_glb) array. This patch initializes the id to -1 and checks for negative in the manager cleanup. Cc: Doug Anderson <> Reviewed-by: Abhinav Kumar <> Signed-off-by: Sean Paul <> Signed-off-by: Rob Clark <>
2018-07-26drm/msm/dsi: Use one connector for dual DSI modeChandan Uddaraju1-0/+3
Current DSI driver uses two connectors for dual DSI case even though we only have one panel. Fix this by implementing one connector/bridge for dual DSI use case. Use master DSI controllers to register one connector/bridge. Changes in v3: - None Reviewed-by: Archit Taneja <> Signed-off-by: Chandan Uddaraju <> [seanpaul removed unused local var causing a build warning] Signed-off-by: Sean Paul <> Signed-off-by: Rob Clark <>
2018-03-19drm/msm/dsi: Fix potential NULL pointer dereference in msm_dsi_modeset_initGustavo A. R. Silva1-1/+2
_dev_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after _dev_ has been null checked. Fixes: d4e7f38d70ef ("drm/msm/dsi: check msm_dsi and dsi pointers before use") Signed-off-by: Gustavo A. R. Silva <> Signed-off-by: Rob Clark <>
2018-02-20drm/msm/dsi: check msm_dsi and dsi pointers before useLloyd Atkinson1-12/+10
Move null checks of pointer arguments to the beginning of the modeset init function since they are referenced immediately instead of after they have already been used. Signed-off-by: Lloyd Atkinson <> Signed-off-by: Rob Clark <>
2017-08-02drm/msm/dsi: Implement RPM suspend/resume callbacksArchit Taneja1-0/+5
The bus clocks are always enabled/disabled along with the power domain, so move it to the runtime suspend/resume ops. This cleans up the clock code a bit. Get rid of the clk_mutex mutex since it isn't needed. Signed-off-by: Archit Taneja <> Signed-off-by: Rob Clark <>
2017-02-06drm/msm: Construct only one encoder for DSIArchit Taneja1-9/+5
We currently create 2 encoders for DSI interfaces, one for command mode and other for video mode operation. This isn't needed as we can't really use both the encoders at the same time. It also makes connecting bridges harder. Switch to creating a single encoder. For now, we assume that the encoder is configured only in video mode. Later, the same encoder would be usable in both modes. Signed-off-by: Archit Taneja <> Signed-off-by: Rob Clark <>
2017-02-06drm/msm/dsi: Set msm_dsi->encoders before initializing bridgeArchit Taneja1-5/+3
The commit "drm: bridge: Link encoder and bridge in core code" updated the drm_bridge_attach() API to also include the drm_encoder pointer the bridge attaches to. The func msm_dsi_manager_bridge_init() now relies on the drm_encoder pointer stored in msm_dsi->encoders to pass the encoder to the bridge API. msm_dsi->encoders is unfortunately set after this function is called, resulting in us passing a NULL pointer to drm_brigde_attach. This results in an error and the DSI driver probe fails. Move the initialization of msm_dsi->encoders[] a bit up. Also, don't try to set the encoder's bridge. That's now managed by the bridge API. Cc: Laurent Pinchart <> Reviewed-by: Laurent Pinchart <> Signed-off-by: Archit Taneja <> Signed-off-by: Rob Clark <>
2016-07-16drm/msm/dsi: Use generic PHY bindingsArchit Taneja1-1/+1
The DSI host links to the DSI PHY device using a custom binding. Switch to the generic PHY bindings. The DSI PHY driver itself doesn't use the common PHY framework for now. Signed-off-by: Archit Taneja <> Signed-off-by: Rob Clark <>
2015-08-15drm/msm/dsi: Allow dsi to connect to an external bridgeArchit Taneja1-5/+23
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 <> Signed-off-by: Rob Clark <>
2015-08-15drm/msm/dsi: Create a helper to check if there is a connected deviceArchit Taneja1-1/+1
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 <> Signed-off-by: Rob Clark <>
2015-08-15drm/msm/dsi: Refer to connected device as 'device' instead of 'panel'Archit Taneja1-1/+1
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 <> Signed-off-by: Rob Clark <>
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 <> [add couple missing ERR_PTR()'s] Signed-off-by: Rob Clark <>
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 <> Signed-off-by: Rob Clark <>
2015-06-11drm/msm/dsi: Separate PHY to another platform deviceHai Li1-9/+36
There are different types of PHY from one chipset to another, while the DSI host controller is relatively consistent across platforms. Also, the PLL inside PHY is providing the source of DSI byte and pixel clocks, which are used by DSI host controller. Separated devices for clock provider and clock consumer make DSI driver better fit into common clock framework. Signed-off-by: Hai Li <> Signed-off-by: Rob Clark <>
2015-06-11drm/msm/dsi: Enable PLL driver in MSM DSIHai Li1-0/+14
This change activates PLL driver for DSI to work with common clock framework. Signed-off-by: Hai Li <> Signed-off-by: Rob Clark <>
2015-05-14drm/msm: Attach assigned encoder to eDP and DSI connectorsHai Li1-5/+5
drm_mode_connector_attach_encoder() function call is missing during eDP and DSI connector initialization. As a result, no encoder is returned by DRM_IOCTL_MODE_GETCONNECTOR system call. This change is to fix this issue. Signed-off-by: Hai Li <>
2015-04-01drm/msm: Initial add DSI connector supportHai Li1-0/+212
This change adds the DSI connector support in msm drm driver. v1: Initial change v2: - Address comments from Archit + minor clean-ups - Rebase to not depend on msm_drm_sub_dev change [Rob's comment] v3: Fix issues when initialization is failed Signed-off-by: Hai Li <> Signed-off-by: Rob Clark <>