|
11 | 11 | #include <linux/slab.h>
|
12 | 12 |
|
13 | 13 | #include <drm/drm_bridge.h>
|
| 14 | +#include <drm/drm_bridge_connector.h> |
14 | 15 | #include <drm/drm_crtc.h>
|
15 | 16 | #include <drm/drm_managed.h>
|
16 | 17 | #include <drm/drm_modeset_helper_vtables.h>
|
@@ -53,7 +54,9 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
|
53 | 54 | struct device_node *enc_node)
|
54 | 55 | {
|
55 | 56 | struct rcar_du_encoder *renc;
|
| 57 | + struct drm_connector *connector; |
56 | 58 | struct drm_bridge *bridge;
|
| 59 | + int ret; |
57 | 60 |
|
58 | 61 | /*
|
59 | 62 | * Locate the DRM bridge from the DT node. For the DPAD outputs, if the
|
@@ -103,9 +106,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
|
103 | 106 |
|
104 | 107 | renc->output = output;
|
105 | 108 |
|
106 |
| - /* |
107 |
| - * Attach the bridge to the encoder. The bridge will create the |
108 |
| - * connector. |
109 |
| - */ |
110 |
| - return drm_bridge_attach(&renc->base, bridge, NULL, 0); |
| 109 | + /* Attach the bridge to the encoder. */ |
| 110 | + ret = drm_bridge_attach(&renc->base, bridge, NULL, |
| 111 | + DRM_BRIDGE_ATTACH_NO_CONNECTOR); |
| 112 | + if (ret) { |
| 113 | + dev_err(rcdu->dev, "failed to attach bridge for output %u\n", |
| 114 | + output); |
| 115 | + return ret; |
| 116 | + } |
| 117 | + |
| 118 | + /* Create the connector for the chain of bridges. */ |
| 119 | + connector = drm_bridge_connector_init(&rcdu->ddev, &renc->base); |
| 120 | + if (IS_ERR(connector)) { |
| 121 | + dev_err(rcdu->dev, |
| 122 | + "failed to created connector for output %u\n", output); |
| 123 | + return PTR_ERR(connector); |
| 124 | + } |
| 125 | + |
| 126 | + return drm_connector_attach_encoder(connector, &renc->base); |
111 | 127 | }
|
0 commit comments