.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 and |
---|
6 | | - * only version 2 as published by the Free Software Foundation. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope that it will be useful, |
---|
9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
11 | | - * GNU General Public License for more details. |
---|
12 | 4 | */ |
---|
13 | 5 | |
---|
14 | 6 | #include "edp.h" |
---|
.. | .. |
---|
52 | 44 | } |
---|
53 | 45 | |
---|
54 | 46 | static void edp_bridge_mode_set(struct drm_bridge *bridge, |
---|
55 | | - struct drm_display_mode *mode, |
---|
56 | | - struct drm_display_mode *adjusted_mode) |
---|
| 47 | + const struct drm_display_mode *mode, |
---|
| 48 | + const struct drm_display_mode *adjusted_mode) |
---|
57 | 49 | { |
---|
58 | 50 | struct drm_device *dev = bridge->dev; |
---|
59 | 51 | struct drm_connector *connector; |
---|
60 | 52 | struct edp_bridge *edp_bridge = to_edp_bridge(bridge); |
---|
61 | 53 | struct msm_edp *edp = edp_bridge->edp; |
---|
62 | 54 | |
---|
63 | | - DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x", |
---|
64 | | - mode->base.id, mode->name, |
---|
65 | | - mode->vrefresh, mode->clock, |
---|
66 | | - mode->hdisplay, mode->hsync_start, |
---|
67 | | - mode->hsync_end, mode->htotal, |
---|
68 | | - mode->vdisplay, mode->vsync_start, |
---|
69 | | - mode->vsync_end, mode->vtotal, |
---|
70 | | - mode->type, mode->flags); |
---|
| 55 | + DBG("set mode: " DRM_MODE_FMT, DRM_MODE_ARG(mode)); |
---|
71 | 56 | |
---|
72 | 57 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
---|
73 | | - if ((connector->encoder != NULL) && |
---|
74 | | - (connector->encoder->bridge == bridge)) { |
---|
| 58 | + struct drm_encoder *encoder = connector->encoder; |
---|
| 59 | + struct drm_bridge *first_bridge; |
---|
| 60 | + |
---|
| 61 | + if (!connector->encoder) |
---|
| 62 | + continue; |
---|
| 63 | + |
---|
| 64 | + first_bridge = drm_bridge_chain_get_first_bridge(encoder); |
---|
| 65 | + if (bridge == first_bridge) { |
---|
75 | 66 | msm_edp_ctrl_timing_cfg(edp->ctrl, |
---|
76 | 67 | adjusted_mode, &connector->display_info); |
---|
77 | 68 | break; |
---|
.. | .. |
---|
106 | 97 | bridge = &edp_bridge->base; |
---|
107 | 98 | bridge->funcs = &edp_bridge_funcs; |
---|
108 | 99 | |
---|
109 | | - ret = drm_bridge_attach(edp->encoder, bridge, NULL); |
---|
| 100 | + ret = drm_bridge_attach(edp->encoder, bridge, NULL, 0); |
---|
110 | 101 | if (ret) |
---|
111 | 102 | goto fail; |
---|
112 | 103 | |
---|