public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/atomic-helper: Add an atomice best_encoder callback
@ 2015-08-03 15:24 Daniel Vetter
  2015-08-03 15:24 ` [PATCH 2/4] drm/i915: Fixup dp mst encoder selection Daniel Vetter
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Daniel Vetter @ 2015-08-03 15:24 UTC (permalink / raw)
  To: DRI Development, Intel Graphics Development
  Cc: Daniel Vetter, Daniel Vetter, Linus Torvalds, Theodore Ts'o

With legacy helpers all the routing was already set up when calling
best_encoder and so could be inspected. But with atomic it's staged,
hence we need a new atomic compliant callback for drivers which need
to inspect the requested state and can't just decided the best encoder
statically.

This is needed to fix up i915 dp mst where we need to pick the right
encoder depending upon the requested CRTC for the connector.

v2: Don't forget to amend the kerneldoc

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 7 ++++++-
 include/drm/drm_crtc_helper.h       | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index aac212297b49..8694ca9beee3 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -196,7 +196,12 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
 	}
 
 	funcs = connector->helper_private;
-	new_encoder = funcs->best_encoder(connector);
+
+	if (funcs->atomic_best_encoder)
+		new_encoder = funcs->atomic_best_encoder(connector,
+							 connector_state);
+	else
+		new_encoder = funcs->best_encoder(connector);
 
 	if (!new_encoder) {
 		DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index c8fc187061de..918aa68b5199 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -168,6 +168,7 @@ struct drm_encoder_helper_funcs {
  * @get_modes: get mode list for this connector
  * @mode_valid: is this mode valid on the given connector? (optional)
  * @best_encoder: return the preferred encoder for this connector
+ * @atomic_best_encoder: atomic version of @best_encoder
  *
  * The helper operations are called by the mid-layer CRTC helper.
  */
@@ -176,6 +177,8 @@ struct drm_connector_helper_funcs {
 	enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
 					   struct drm_display_mode *mode);
 	struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
+	struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector,
+						   struct drm_connector_state *connector_state);
 };
 
 extern void drm_helper_disable_unused_functions(struct drm_device *dev);
-- 
2.5.0

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-08-04  9:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 15:24 [PATCH 1/4] drm/atomic-helper: Add an atomice best_encoder callback Daniel Vetter
2015-08-03 15:24 ` [PATCH 2/4] drm/i915: Fixup dp mst encoder selection Daniel Vetter
2015-08-03 15:24 ` [PATCH 3/4] drm/dp-mst: Remove debug WARN_ON Daniel Vetter
2015-08-04  8:53   ` Thierry Reding
2015-08-03 15:24 ` [PATCH 4/4] drm/atomic-helpers: Make encoder picking more robust Daniel Vetter
2015-08-04  8:56   ` Ander Conselvan De Oliveira
2015-08-04  9:11     ` [Intel-gfx] " Daniel Vetter
2015-08-04  8:56   ` Thierry Reding
2015-08-04  8:52 ` [PATCH 1/4] drm/atomic-helper: Add an atomice best_encoder callback Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox