Lines Matching +full:self +full:- +full:powered
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
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()
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()
78 dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_get_modes()
81 if (dp->link_ready) { 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()
123 struct msm_dp *dp = to_dp_bridge(drm_bridge)->dp_display; in edp_bridge_atomic_check()
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()
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()
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()
179 drm_bridge->encoder); in edp_bridge_atomic_disable()
192 * Set self refresh mode if current crtc state is active. in edp_bridge_atomic_disable()
199 * We observed sink is stuck in self refresh if psr exit is skipped in edp_bridge_atomic_disable()
202 if (new_crtc_state->self_refresh_active) { in edp_bridge_atomic_disable()
205 } else if (old_crtc_state->self_refresh_active) { 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()
231 * Self refresh mode is already set in edp_bridge_atomic_disable. 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
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()
273 struct msm_dp *dp = to_dp_bridge(bridge)->dp_display; 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()
310 * - Detect/HPD are used by DRM to know if a display is _physically_ in dp_bridge_init()
311 * there, not whether the display is powered on / finished initting. 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()