forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/msm/edp/edp_bridge.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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.
124 */
135
146 #include "edp.h"
....@@ -52,26 +44,25 @@
5244 }
5345
5446 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)
5749 {
5850 struct drm_device *dev = bridge->dev;
5951 struct drm_connector *connector;
6052 struct edp_bridge *edp_bridge = to_edp_bridge(bridge);
6153 struct msm_edp *edp = edp_bridge->edp;
6254
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));
7156
7257 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) {
7566 msm_edp_ctrl_timing_cfg(edp->ctrl,
7667 adjusted_mode, &connector->display_info);
7768 break;
....@@ -106,7 +97,7 @@
10697 bridge = &edp_bridge->base;
10798 bridge->funcs = &edp_bridge_funcs;
10899
109
- ret = drm_bridge_attach(edp->encoder, bridge, NULL);
100
+ ret = drm_bridge_attach(edp->encoder, bridge, NULL, 0);
110101 if (ret)
111102 goto fail;
112103