提交 f1c79df3 编写于 作者: Z Zhenyu Wang 提交者: Eric Anholt

drm/i915: Add new helper to return current attached encoder for connector

For introducing splitted encoder/connector structure, this helper will return
connector's attached encoder when needed.
Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 5daa55eb
......@@ -4982,6 +4982,31 @@ struct drm_encoder *intel_best_encoder(struct drm_connector *connector)
return &intel_encoder->enc;
}
/*
* Return which encoder is currently attached for connector.
*/
struct drm_encoder *intel_attached_encoder (struct drm_connector *connector)
{
struct drm_mode_object *obj;
struct drm_encoder *encoder;
int i;
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
if (connector->encoder_ids[i] == 0)
break;
obj = drm_mode_object_find(connector->dev,
connector->encoder_ids[i],
DRM_MODE_OBJECT_ENCODER);
if (!obj)
continue;
encoder = obj_to_encoder(obj);
return encoder;
}
return NULL;
}
/*
* set vga decode state - true == enable VGA decode
*/
......
......@@ -190,6 +190,7 @@ extern void intel_encoder_prepare (struct drm_encoder *encoder);
extern void intel_encoder_commit (struct drm_encoder *encoder);
extern struct drm_encoder *intel_best_encoder(struct drm_connector *connector);
extern struct drm_encoder *intel_attached_encoder(struct drm_connector *connector);
extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
struct drm_crtc *crtc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册