All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: daniel@ffwll.ch, linux-kernel@vger.kernel.org,
	"Noralf Trønnes" <noralf@tronnes.org>
Subject: [PATCH v2 5/6] drm/atomic: Add drm_atomic_helper_best_encoder()
Date: Wed, 11 May 2016 18:09:21 +0200	[thread overview]
Message-ID: <1462982962-10530-6-git-send-email-noralf@tronnes.org> (raw)
In-Reply-To: <1462982962-10530-1-git-send-email-noralf@tronnes.org>

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>
---
 drivers/gpu/drm/drm_atomic_helper.c | 17 +++++++++++++++++
 include/drm/drm_atomic_helper.h     |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 46a3201..43a0b3d 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
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 0364287..ccca709 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,
 				uint32_t flags);
 int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
 				     int mode);
+struct drm_encoder *
+drm_atomic_helper_best_encoder(struct drm_connector *connector);
 
 /* default implementations for state handling */
 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
-- 
2.8.2

WARNING: multiple messages have this Message-ID (diff)
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/6] drm/atomic: Add drm_atomic_helper_best_encoder()
Date: Wed, 11 May 2016 18:09:21 +0200	[thread overview]
Message-ID: <1462982962-10530-6-git-send-email-noralf@tronnes.org> (raw)
In-Reply-To: <1462982962-10530-1-git-send-email-noralf@tronnes.org>

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>
---
 drivers/gpu/drm/drm_atomic_helper.c | 17 +++++++++++++++++
 include/drm/drm_atomic_helper.h     |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 46a3201..43a0b3d 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
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 0364287..ccca709 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,
 				uint32_t flags);
 int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
 				     int mode);
+struct drm_encoder *
+drm_atomic_helper_best_encoder(struct drm_connector *connector);
 
 /* default implementations for state handling */
 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
-- 
2.8.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-05-11 16:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 16:09 [PATCH v2 0/6] drm: Add various helpers for simple drivers Noralf Trønnes
2016-05-11 16:09 ` Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 1/6] drm/fb-helper: Remove mention of CONFIG_FB_DEFERRED_IO in docs Noralf Trønnes
2016-05-11 16:09   ` Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 2/6] drm/fb-cma-helper: Hook up to DocBook and fix some docs Noralf Trønnes
2016-05-11 16:09   ` Noralf Trønnes
2016-05-11 16:48   ` Daniel Vetter
2016-05-11 16:48     ` Daniel Vetter
2016-05-11 16:09 ` [PATCH v2 3/6] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Noralf Trønnes
2016-05-11 16:09   ` Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 4/6] drm/atomic: Don't skip drm_bridge_*() calls if !drm_encoder_helper_funcs Noralf Trønnes
2016-05-11 16:09   ` Noralf Trønnes
2016-05-11 16:55   ` Daniel Vetter
2016-05-11 16:55     ` Daniel Vetter
2016-05-11 16:09 ` Noralf Trønnes [this message]
2016-05-11 16:09   ` [PATCH v2 5/6] drm/atomic: Add drm_atomic_helper_best_encoder() Noralf Trønnes
2016-05-11 16:55   ` Daniel Vetter
2016-05-11 16:55     ` Daniel Vetter
2016-05-11 16:09 ` [PATCH v2 6/6] drm: Add helper for simple display pipeline Noralf Trønnes
2016-05-11 16:09   ` Noralf Trønnes
2016-05-11 17:09   ` Daniel Vetter
2016-05-11 17:09     ` Daniel Vetter
2016-05-11 19:10     ` Paul Bolle
2016-05-11 19:10       ` Paul Bolle
2016-05-11 19:30       ` Noralf Trønnes
2016-05-11 19:30         ` Noralf Trønnes
2016-05-11 19:27     ` Noralf Trønnes
2016-05-11 19:27       ` Noralf Trønnes
2016-05-12  8:11     ` Daniel Vetter
2016-05-12  8:11       ` Daniel Vetter
2016-05-12 10:18       ` Noralf Trønnes
2016-05-12 10:18         ` Noralf Trønnes
2016-05-12 10:44         ` Daniel Vetter
2016-05-12 10:44           ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462982962-10530-6-git-send-email-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.