From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 9/9] drm/atomic: Add encoder_mask to crtc_state.
Date: Tue, 24 Nov 2015 10:34:36 +0100 [thread overview]
Message-ID: <1448357676-27837-10-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1448357676-27837-1-git-send-email-maarten.lankhorst@linux.intel.com>
This allows iteration over encoders without requiring connection_mutex.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 4 ++++
drivers/gpu/drm/i915/intel_display.c | 3 +++
include/drm/drm_crtc.h | 2 ++
3 files changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index fb79c54b2aed..f3fd8f131f92 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -269,6 +269,8 @@ mode_fixup(struct drm_atomic_state *state)
continue;
drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode);
+
+ crtc_state->encoder_mask = 0;
}
for_each_connector_in_state(state, connector, conn_state, i) {
@@ -288,6 +290,8 @@ mode_fixup(struct drm_atomic_state *state)
* it away), so we won't call ->mode_fixup twice.
*/
encoder = conn_state->best_encoder;
+ crtc_state->encoder_mask |= 1 << drm_encoder_index(encoder);
+
funcs = encoder->helper_private;
if (!funcs)
continue;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 21b1984e828b..3317db3806a8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15310,6 +15310,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
crtc->base.state->active = crtc->active;
crtc->base.enabled = crtc->active;
crtc->base.state->connector_mask = 0;
+ crtc->base.state->encoder_mask = 0;
/* Because we only establish the connector -> encoder ->
* crtc links if something is active, this means the
@@ -15363,6 +15364,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
crtc->state->connector_mask |=
1 << drm_connector_index(&connector->base);
+ crtc->state->encoder_mask |=
+ 1 << drm_encoder_index(&encoder->base);
}
if (active && !has_active_crtc) {
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 4999fe530f37..7ea83b6a2864 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -265,6 +265,7 @@ struct drm_atomic_state;
* @connectors_changed: connectors to this crtc have been updated
* @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
* @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors
+ * @encoder_mask: bitmask of (1 << drm_encoder_index(encoder)) of attached encoders
* @last_vblank_count: for helpers and drivers to capture the vblank of the
* update to ensure framebuffer cleanup isn't done too early
* @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
@@ -299,6 +300,7 @@ struct drm_crtc_state {
u32 plane_mask;
u32 connector_mask;
+ u32 encoder_mask;
/* last_vblank_count: for vblank waits before cleanup */
u32 last_vblank_count;
--
2.1.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-11-24 9:34 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 9:34 [PATCH 0/9] drm/atomic: Add encoder_mask and connector_mask to crtc_state Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 1/9] drm/i915: Set connector_state->connector correctly Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 2/9] drm/tegra: Assign conn_state->connector when allocating connector state Maarten Lankhorst
2015-11-24 9:37 ` Thierry Reding
2015-11-24 10:37 ` Daniel Vetter
2015-11-24 10:51 ` Thierry Reding
2015-11-24 11:26 ` Maarten Lankhorst
2015-11-24 13:35 ` [PATCH 1/3] drm/i915: Set connector_state->connector using the helper Maarten Lankhorst
2015-11-24 13:35 ` [PATCH 2/3] drm/atomic: Add __drm_atomic_helper_connector_reset Maarten Lankhorst
2015-12-07 9:58 ` Thierry Reding
2015-12-07 9:58 ` Thierry Reding
2015-11-24 13:35 ` [PATCH 3/3] drm/tegra: Use __drm_atomic_helper_reset_connector for subclassing connector state Maarten Lankhorst
2015-12-07 10:02 ` Thierry Reding
2015-12-08 8:13 ` Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 3/9] drm/core: Add drm_encoder_index Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 4/9] drm/core: Add drm_for_each_encoder_mask Maarten Lankhorst
2015-11-24 18:00 ` [Intel-gfx] " Jani Nikula
2015-11-24 18:07 ` David Herrmann
2015-11-24 9:34 ` [PATCH 5/9] drm/atomic: add connector mask to drm_crtc_state Maarten Lankhorst
2015-12-07 10:24 ` Thierry Reding
2015-11-24 9:34 ` [PATCH 6/9] drm/i915: Update connector_mask during readout Maarten Lankhorst
2015-11-24 10:38 ` Daniel Vetter
2015-11-24 11:30 ` [Intel-gfx] " Maarten Lankhorst
2015-12-07 10:36 ` Thierry Reding
2015-11-24 9:34 ` [PATCH 7/9] drm/atomic: Small documentation fix Maarten Lankhorst
2015-11-24 10:48 ` Daniel Vetter
2015-11-24 9:34 ` [PATCH 8/9] drm/atomic: Remove drm_atomic_connectors_for_crtc Maarten Lankhorst
2015-12-07 10:34 ` Thierry Reding
2015-12-08 8:30 ` Maarten Lankhorst
2015-11-24 9:34 ` Maarten Lankhorst [this message]
2015-12-03 9:53 ` [Intel-gfx] [PATCH 9/9] drm/atomic: Add encoder_mask to crtc_state Daniel Vetter
2015-12-03 11:01 ` Maarten Lankhorst
2015-12-04 8:12 ` [Intel-gfx] " Daniel Vetter
2015-12-14 12:06 ` Maarten Lankhorst
2015-12-15 9:17 ` Daniel Vetter
2015-12-17 9:06 ` Maarten Lankhorst
2015-12-17 9:52 ` [Intel-gfx] " 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=1448357676-27837-10-git-send-email-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox