Commit 38cb8d96 authored by Ville Syrjälä's avatar Ville Syrjälä

drm: Add drm_connector_has_possible_encoder()

Add a small helper for checking whether a connector and
encoder are associated with each other.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-8-ville.syrjala@linux.intel.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7b71ca24
...@@ -331,6 +331,29 @@ int drm_mode_connector_attach_encoder(struct drm_connector *connector, ...@@ -331,6 +331,29 @@ int drm_mode_connector_attach_encoder(struct drm_connector *connector,
} }
EXPORT_SYMBOL(drm_mode_connector_attach_encoder); EXPORT_SYMBOL(drm_mode_connector_attach_encoder);
/**
* drm_connector_has_possible_encoder - check if the connector and encoder are assosicated with each other
* @connector: the connector
* @encoder: the encoder
*
* Returns:
* True if @encoder is one of the possible encoders for @connector.
*/
bool drm_connector_has_possible_encoder(struct drm_connector *connector,
struct drm_encoder *encoder)
{
struct drm_encoder *enc;
int i;
drm_connector_for_each_possible_encoder(connector, enc, i) {
if (enc == encoder)
return true;
}
return false;
}
EXPORT_SYMBOL(drm_connector_has_possible_encoder);
static void drm_mode_remove(struct drm_connector *connector, static void drm_mode_remove(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
......
...@@ -1187,6 +1187,9 @@ struct drm_connector * ...@@ -1187,6 +1187,9 @@ struct drm_connector *
drm_connector_list_iter_next(struct drm_connector_list_iter *iter); drm_connector_list_iter_next(struct drm_connector_list_iter *iter);
void drm_connector_list_iter_end(struct drm_connector_list_iter *iter); void drm_connector_list_iter_end(struct drm_connector_list_iter *iter);
bool drm_connector_has_possible_encoder(struct drm_connector *connector,
struct drm_encoder *encoder);
/** /**
* drm_for_each_connector_iter - connector_list iterator macro * drm_for_each_connector_iter - connector_list iterator macro
* @connector: &struct drm_connector pointer used as cursor * @connector: &struct drm_connector pointer used as cursor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment