.. | .. |
---|
21 | 21 | */ |
---|
22 | 22 | |
---|
23 | 23 | #include <linux/export.h> |
---|
24 | | -#include <drm/drmP.h> |
---|
| 24 | + |
---|
| 25 | +#include <drm/drm_bridge.h> |
---|
| 26 | +#include <drm/drm_device.h> |
---|
| 27 | +#include <drm/drm_drv.h> |
---|
25 | 28 | #include <drm/drm_encoder.h> |
---|
26 | 29 | |
---|
27 | 30 | #include "drm_crtc_internal.h" |
---|
.. | .. |
---|
137 | 140 | goto out_put; |
---|
138 | 141 | } |
---|
139 | 142 | |
---|
| 143 | + INIT_LIST_HEAD(&encoder->bridge_chain); |
---|
140 | 144 | list_add_tail(&encoder->head, &dev->mode_config.encoder_list); |
---|
141 | 145 | encoder->index = dev->mode_config.num_encoder++; |
---|
142 | 146 | |
---|
.. | .. |
---|
157 | 161 | void drm_encoder_cleanup(struct drm_encoder *encoder) |
---|
158 | 162 | { |
---|
159 | 163 | struct drm_device *dev = encoder->dev; |
---|
| 164 | + struct drm_bridge *bridge, *next; |
---|
160 | 165 | |
---|
161 | 166 | /* Note that the encoder_list is considered to be static; should we |
---|
162 | 167 | * remove the drm_encoder at runtime we would have to decrement all |
---|
163 | 168 | * the indices on the drm_encoder after us in the encoder_list. |
---|
164 | 169 | */ |
---|
165 | 170 | |
---|
166 | | - if (encoder->bridge) { |
---|
167 | | - struct drm_bridge *bridge = encoder->bridge; |
---|
168 | | - struct drm_bridge *next; |
---|
169 | | - |
---|
170 | | - while (bridge) { |
---|
171 | | - next = bridge->next; |
---|
172 | | - drm_bridge_detach(bridge); |
---|
173 | | - bridge = next; |
---|
174 | | - } |
---|
175 | | - } |
---|
| 171 | + list_for_each_entry_safe(bridge, next, &encoder->bridge_chain, |
---|
| 172 | + chain_node) |
---|
| 173 | + drm_bridge_detach(bridge); |
---|
176 | 174 | |
---|
177 | 175 | drm_mode_object_unregister(dev, &encoder->base); |
---|
178 | 176 | kfree(encoder->name); |
---|
.. | .. |
---|
222 | 220 | struct drm_crtc *crtc; |
---|
223 | 221 | |
---|
224 | 222 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
---|
225 | | - return -EINVAL; |
---|
| 223 | + return -EOPNOTSUPP; |
---|
226 | 224 | |
---|
227 | 225 | encoder = drm_encoder_find(dev, file_priv, enc_resp->encoder_id); |
---|
228 | 226 | if (!encoder) |
---|