diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-09 11:20:55 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-09 12:00:43 -0400 |
commit | df0e924883d029a8651a2a0c7b8da67a07611ed2 (patch) | |
tree | 7482d6c4942c709f2c6812f397c3239326ade3b8 /drivers/gpu/drm/i915/intel_display.c | |
parent | f875c15a4fbf37534dda30771d8bde8604fbbf09 (diff) |
drm/i915: Make the connector->encoder relationship explicit
Currently we have a exact mapping of a connector onto an encoder for its
whole lifetime. Make this an explicit property of the structure and so
simplify the code.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 7e67bf534f89..a9df2787d752 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6120,26 +6120,17 @@ void intel_modeset_cleanup(struct drm_device *dev) | |||
6120 | /* | 6120 | /* |
6121 | * Return which encoder is currently attached for connector. | 6121 | * Return which encoder is currently attached for connector. |
6122 | */ | 6122 | */ |
6123 | struct drm_encoder *intel_attached_encoder (struct drm_connector *connector) | 6123 | struct drm_encoder *intel_best_encoder(struct drm_connector *connector) |
6124 | { | 6124 | { |
6125 | struct drm_mode_object *obj; | 6125 | return &intel_attached_encoder(connector)->base; |
6126 | struct drm_encoder *encoder; | 6126 | } |
6127 | int i; | ||
6128 | |||
6129 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { | ||
6130 | if (connector->encoder_ids[i] == 0) | ||
6131 | break; | ||
6132 | |||
6133 | obj = drm_mode_object_find(connector->dev, | ||
6134 | connector->encoder_ids[i], | ||
6135 | DRM_MODE_OBJECT_ENCODER); | ||
6136 | if (!obj) | ||
6137 | continue; | ||
6138 | 6127 | ||
6139 | encoder = obj_to_encoder(obj); | 6128 | void intel_connector_attach_encoder(struct intel_connector *connector, |
6140 | return encoder; | 6129 | struct intel_encoder *encoder) |
6141 | } | 6130 | { |
6142 | return NULL; | 6131 | connector->encoder = encoder; |
6132 | drm_mode_connector_attach_encoder(&connector->base, | ||
6133 | &encoder->base); | ||
6143 | } | 6134 | } |
6144 | 6135 | ||
6145 | /* | 6136 | /* |