Lines Matching +full:dp +full:- +full:controller

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
17 * dp_bridge_detect - callback to determine if connector is connected
23 struct msm_dp *dp; in dp_bridge_detect() local
25 dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_detect()
27 drm_dbg_dp(dp->drm_dev, "link_ready = %s\n", in dp_bridge_detect()
28 (dp->link_ready) ? "true" : "false"); in dp_bridge_detect()
30 return (dp->link_ready) ? connector_status_connected : in dp_bridge_detect()
39 struct msm_dp *dp; in dp_bridge_atomic_check() local
41 dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_atomic_check()
43 drm_dbg_dp(dp->drm_dev, "link_ready = %s\n", in dp_bridge_atomic_check()
44 (dp->link_ready) ? "true" : "false"); in dp_bridge_atomic_check()
50 * crtc->active is still true. Any attempt to set the mode or manually in dp_bridge_atomic_check()
57 if (bridge->ops & DRM_BRIDGE_OP_HPD) in dp_bridge_atomic_check()
58 return (dp->link_ready) ? 0 : -ENOTCONN; in dp_bridge_atomic_check()
65 * dp_bridge_get_modes - callback to add drm modes via drm_mode_probed_add()
73 struct msm_dp *dp; in dp_bridge_get_modes() local
78 dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_get_modes()
81 if (dp->link_ready) { in dp_bridge_get_modes()
82 rc = dp_display_get_modes(dp); in dp_bridge_get_modes()
84 DRM_ERROR("failed to get DP sink modes, rc=%d\n", rc); in dp_bridge_get_modes()
88 drm_dbg_dp(connector->dev, "No sink connected\n"); in dp_bridge_get_modes()
95 struct msm_dp *dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_debugfs_init() local
97 dp_display_debugfs_init(dp, root, false); in dp_bridge_debugfs_init()
123 struct msm_dp *dp = to_dp_bridge(drm_bridge)->dp_display; in edp_bridge_atomic_check() local
126 return -ENODEV; in edp_bridge_atomic_check()
128 conn_state->self_refresh_aware = dp->psr_supported; in edp_bridge_atomic_check()
130 if (!conn_state->crtc || !crtc_state) in edp_bridge_atomic_check()
133 if (crtc_state->self_refresh_active && !dp->psr_supported) in edp_bridge_atomic_check()
134 return -EINVAL; in edp_bridge_atomic_check()
142 struct drm_atomic_state *atomic_state = old_bridge_state->base.state; in edp_bridge_atomic_enable()
146 struct msm_dp *dp = dp_bridge->dp_display; in edp_bridge_atomic_enable() local
155 drm_bridge->encoder); in edp_bridge_atomic_enable()
161 if (old_crtc_state && old_crtc_state->self_refresh_active) { in edp_bridge_atomic_enable()
162 dp_display_set_psr(dp, false); in edp_bridge_atomic_enable()
172 struct drm_atomic_state *atomic_state = old_bridge_state->base.state; in edp_bridge_atomic_disable()
176 struct msm_dp *dp = dp_bridge->dp_display; in edp_bridge_atomic_disable() local
179 drm_bridge->encoder); in edp_bridge_atomic_disable()
196 * The eDP controller will be disabled in the in edp_bridge_atomic_disable()
202 if (new_crtc_state->self_refresh_active) { in edp_bridge_atomic_disable()
203 dp_display_set_psr(dp, true); in edp_bridge_atomic_disable()
205 } else if (old_crtc_state->self_refresh_active) { in edp_bridge_atomic_disable()
206 dp_display_set_psr(dp, false); in edp_bridge_atomic_disable()
217 struct drm_atomic_state *atomic_state = old_bridge_state->base.state; in edp_bridge_atomic_post_disable()
222 drm_bridge->encoder); in edp_bridge_atomic_post_disable()
233 if (new_crtc_state->self_refresh_active) in edp_bridge_atomic_post_disable()
240 * edp_bridge_mode_valid - callback to determine if specified mode is valid
250 struct msm_dp *dp; in edp_bridge_mode_valid() local
251 int mode_pclk_khz = mode->clock; in edp_bridge_mode_valid()
253 dp = to_dp_bridge(bridge)->dp_display; in edp_bridge_mode_valid()
255 if (!dp || !mode_pclk_khz || !dp->connector) { in edp_bridge_mode_valid()
257 return -EINVAL; in edp_bridge_mode_valid()
260 if (mode->clock > DP_MAX_PIXEL_CLK_KHZ) in edp_bridge_mode_valid()
264 * The eDP controller currently does not have a reliable way of in edp_bridge_mode_valid()
273 struct msm_dp *dp = to_dp_bridge(bridge)->dp_display; in edp_bridge_debugfs_init() local
275 dp_display_debugfs_init(dp, root, true); in edp_bridge_debugfs_init()
298 dp_bridge = devm_kzalloc(dev->dev, sizeof(*dp_bridge), GFP_KERNEL); in dp_bridge_init()
300 return -ENOMEM; in dp_bridge_init()
302 dp_bridge->dp_display = dp_display; in dp_bridge_init()
304 bridge = &dp_bridge->bridge; in dp_bridge_init()
305 bridge->funcs = dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops; in dp_bridge_init()
306 bridge->type = dp_display->connector_type; in dp_bridge_init()
309 * Many ops only make sense for DP. Why? in dp_bridge_init()
310 * - Detect/HPD are used by DRM to know if a display is _physically_ in dp_bridge_init()
315 * - Currently eDP mode reading is driven by the panel driver. This in dp_bridge_init()
319 if (!dp_display->is_edp) { in dp_bridge_init()
320 bridge->ops = in dp_bridge_init()
326 rc = devm_drm_bridge_add(dev->dev, bridge); in dp_bridge_init()
340 if (dp_display->next_bridge) { in dp_bridge_init()
342 dp_display->next_bridge, bridge, in dp_bridge_init()
359 connector = drm_bridge_connector_init(dp_display->drm_dev, encoder); in dp_drm_connector_init()
363 if (!dp_display->is_edp) in dp_drm_connector_init()
367 connector->ycbcr_420_allowed = true; in dp_drm_connector_init()