diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2016-05-11 19:09:21 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-05-11 19:55:16 +0300 |
commit | 9ecb549867d7f642f0379f574f0e52870009a8bf (patch) | |
tree | 3988cedd7ae05165ddb233a3e596ac1864d2ba6f /drivers/gpu/drm/drm_atomic_helper.c | |
parent | 2827635e39a35f7263fc290c0a39ea3d1dbe35fa (diff) | |
download | linux-9ecb549867d7f642f0379f574f0e52870009a8bf.tar.xz |
drm/atomic: Add drm_atomic_helper_best_encoder()
Add (struct drm_connector_helper_funcs *)->best_encoder callback helper
for connectors that support exactly 1 encoder, statically determined at
driver init time.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1462982962-10530-6-git-send-email-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 46a3201b9851..43a0b3dfa846 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2483,6 +2483,23 @@ backoff: EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); /** + * drm_atomic_helper_best_encoder - Helper for &drm_connector_helper_funcs + * ->best_encoder callback + * @connector: Connector control structure + * + * This is a &drm_connector_helper_funcs ->best_encoder callback helper for + * connectors that support exactly 1 encoder, statically determined at driver + * init time. + */ +struct drm_encoder * +drm_atomic_helper_best_encoder(struct drm_connector *connector) +{ + WARN_ON(connector->encoder_ids[1]); + return drm_encoder_find(connector->dev, connector->encoder_ids[0]); +} +EXPORT_SYMBOL(drm_atomic_helper_best_encoder); + +/** * DOC: atomic state reset and initialization * * Both the drm core and the atomic helpers assume that there is always the full |