From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 04/11] drm/i915: Factor out set_encoder_for_connector()
Date: Wed, 26 Apr 2023 19:52:58 +0300 [thread overview]
Message-ID: <20230426165305.2049341-5-imre.deak@intel.com> (raw)
In-Reply-To: <20230426165305.2049341-1-imre.deak@intel.com>
Factor out a function setting the encoder and CRTC in the connector
atomic state, required by a follow up patch.
No functional changes.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
.../drm/i915/display/intel_modeset_setup.c | 28 +++++++++++++------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
index fe83579529b3a..a66085cf82bab 100644
--- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c
+++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
@@ -32,6 +32,24 @@
static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state);
+static void set_encoder_for_connector(struct intel_connector *connector,
+ struct intel_encoder *encoder)
+{
+ struct drm_connector_state *conn_state = connector->base.state;
+
+ if (conn_state->crtc)
+ drm_connector_put(&connector->base);
+
+ if (encoder) {
+ conn_state->best_encoder = &encoder->base;
+ conn_state->crtc = encoder->base.crtc;
+ drm_connector_get(&connector->base);
+ } else {
+ conn_state->best_encoder = NULL;
+ conn_state->crtc = NULL;
+ }
+}
+
static void intel_crtc_disable_noatomic(struct intel_crtc *crtc,
struct drm_modeset_acquire_ctx *ctx)
{
@@ -131,8 +149,7 @@ static void intel_modeset_update_connector_atomic_state(struct drm_i915_private
struct intel_encoder *encoder =
to_intel_encoder(connector->base.encoder);
- if (conn_state->crtc)
- drm_connector_put(&connector->base);
+ set_encoder_for_connector(connector, encoder);
if (encoder) {
struct intel_crtc *crtc =
@@ -140,14 +157,7 @@ static void intel_modeset_update_connector_atomic_state(struct drm_i915_private
const struct intel_crtc_state *crtc_state =
to_intel_crtc_state(crtc->base.state);
- conn_state->best_encoder = &encoder->base;
- conn_state->crtc = &crtc->base;
conn_state->max_bpc = (crtc_state->pipe_bpp ?: 24) / 3;
-
- drm_connector_get(&connector->base);
- } else {
- conn_state->best_encoder = NULL;
- conn_state->crtc = NULL;
}
}
drm_connector_list_iter_end(&conn_iter);
--
2.37.2
next prev parent reply other threads:[~2023-04-26 16:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 16:52 [Intel-gfx] [PATCH 00/11] drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 01/11] drm/i915: Fix PIPEDMC disabling for a bigjoiner configuration Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 02/11] drm/i915: Make the CRTC wrt. CSC state consistent during sanitize-disabling Imre Deak
2023-04-26 17:48 ` Ville Syrjälä
2023-04-26 19:51 ` Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 03/11] drm/i915: Update connector atomic state before crtc sanitize-disabling Imre Deak
2023-04-26 16:52 ` Imre Deak [this message]
2023-04-26 16:52 ` [Intel-gfx] [PATCH 05/11] drm/i915: Add support for disabling any CRTCs during HW readout/sanitization Imre Deak
2023-04-28 14:02 ` Ville Syrjälä
2023-04-28 17:22 ` Imre Deak
2023-04-28 17:47 ` Imre Deak
2023-04-29 7:50 ` Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 06/11] drm/i915/dp: Add link training debug and error printing helpers Imre Deak
2023-04-28 14:21 ` Ville Syrjälä
2023-04-28 19:30 ` Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 07/11] drm/i915/dp: Convert link training error to debug message on disconnected sink Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 08/11] drm/i915/dp: Prevent link training fallback on disconnected port Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 09/11] drm/i915/dp: Factor out intel_dp_get_active_pipes() Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 10/11] drm/i915: Factor out call_with_modeset_ctx() Imre Deak
2023-04-28 14:32 ` Ville Syrjälä
2023-04-28 18:34 ` Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 11/11] drm/i915/tc: Reset TypeC PHYs left enabled in DP-alt mode after the sink disconnects Imre Deak
2023-04-26 19:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue Patchwork
2023-04-26 19:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-26 22:09 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=20230426165305.2049341-5-imre.deak@intel.com \
--to=imre.deak@intel.com \
--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