aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2016-05-11 12:09:21 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-05-11 12:55:16 -0400
commit9ecb549867d7f642f0379f574f0e52870009a8bf (patch)
tree3988cedd7ae05165ddb233a3e596ac1864d2ba6f
parent2827635e39a35f7263fc290c0a39ea3d1dbe35fa (diff)
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
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c17
-rw-r--r--include/drm/drm_atomic_helper.h2
2 files changed, 19 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:
2483EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); 2483EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
2484 2484
2485/** 2485/**
2486 * drm_atomic_helper_best_encoder - Helper for &drm_connector_helper_funcs
2487 * ->best_encoder callback
2488 * @connector: Connector control structure
2489 *
2490 * This is a &drm_connector_helper_funcs ->best_encoder callback helper for
2491 * connectors that support exactly 1 encoder, statically determined at driver
2492 * init time.
2493 */
2494struct drm_encoder *
2495drm_atomic_helper_best_encoder(struct drm_connector *connector)
2496{
2497 WARN_ON(connector->encoder_ids[1]);
2498 return drm_encoder_find(connector->dev, connector->encoder_ids[0]);
2499}
2500EXPORT_SYMBOL(drm_atomic_helper_best_encoder);
2501
2502/**
2486 * DOC: atomic state reset and initialization 2503 * DOC: atomic state reset and initialization
2487 * 2504 *
2488 * Both the drm core and the atomic helpers assume that there is always the full 2505 * Both the drm core and the atomic helpers assume that there is always the full
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 03642878bc51..ccca709a255b 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -110,6 +110,8 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
110 uint32_t flags); 110 uint32_t flags);
111int drm_atomic_helper_connector_dpms(struct drm_connector *connector, 111int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
112 int mode); 112 int mode);
113struct drm_encoder *
114drm_atomic_helper_best_encoder(struct drm_connector *connector);
113 115
114/* default implementations for state handling */ 116/* default implementations for state handling */
115void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); 117void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);