From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH v2 2/6] drm/i915/lspcon: add intel_lspcon_active() and use it
Date: Tue, 4 Feb 2025 15:58:39 +0200 [thread overview]
Message-ID: <3eabe0cb07a84c63119ea893e149de410b4356b0.1738677489.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1738677489.git.jani.nikula@intel.com>
Hide the direct lspcon->active use behind intel_lspcon_active().
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++---
drivers/gpu/drm/i915/display/intel_dp.c | 7 ++++---
drivers/gpu/drm/i915/display/intel_lspcon.c | 7 +++++++
drivers/gpu/drm/i915/display/intel_lspcon.h | 1 +
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index efc412165a3c..c59b7fec20f0 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3029,7 +3029,7 @@ static void intel_ddi_pre_enable(struct intel_atomic_state *state,
/* FIXME precompute everything properly */
/* FIXME how do we turn infoframes off again? */
- if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
+ if (intel_lspcon_active(dig_port) && intel_dp_has_hdmi_sink(&dig_port->dp))
dig_port->set_infoframes(encoder,
crtc_state->has_infoframe,
crtc_state, conn_state);
@@ -3385,7 +3385,7 @@ static void intel_ddi_enable_dp(struct intel_atomic_state *state,
drm_connector_update_privacy_screen(conn_state);
intel_edp_backlight_on(crtc_state, conn_state);
- if (!dig_port->lspcon.active || intel_dp_has_hdmi_sink(&dig_port->dp))
+ if (!intel_lspcon_active(dig_port) || intel_dp_has_hdmi_sink(&dig_port->dp))
intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
trans_port_sync_stop_link_train(state, encoder, crtc_state);
@@ -4086,7 +4086,7 @@ static void intel_ddi_read_func_ctl_dp_sst(struct intel_encoder *encoder,
intel_de_read(display,
dp_tp_ctl_reg(encoder, crtc_state)) & DP_TP_CTL_FEC_ENABLE;
- if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
+ if (intel_lspcon_active(dig_port) && intel_dp_has_hdmi_sink(&dig_port->dp))
crtc_state->infoframes.enable |=
intel_lspcon_infoframes_enabled(encoder, crtc_state);
else
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index cc6aba353c11..ef182ef574f7 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3500,9 +3500,10 @@ void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode)
ret = drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, mode);
} else {
+ struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct intel_lspcon *lspcon = dp_to_lspcon(intel_dp);
- lspcon_resume(dp_to_dig_port(intel_dp));
+ lspcon_resume(dig_port);
/* Write the source OUI as early as possible */
intel_dp_init_source_oui(intel_dp);
@@ -3518,7 +3519,7 @@ void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode)
msleep(1);
}
- if (ret == 1 && lspcon->active)
+ if (ret == 1 && intel_lspcon_active(dig_port))
lspcon_wait_pcon_mode(lspcon);
}
@@ -5569,7 +5570,7 @@ intel_dp_update_420(struct intel_dp *intel_dp)
intel_dp->downstream_ports);
/* on-board LSPCON always assumed to support 4:4:4->4:2:0 conversion */
intel_dp->dfp.ycbcr_444_to_420 =
- dp_to_dig_port(intel_dp)->lspcon.active ||
+ intel_lspcon_active(dp_to_dig_port(intel_dp)) ||
drm_dp_downstream_444_to_420_conversion(intel_dp->dpcd,
intel_dp->downstream_ports);
intel_dp->dfp.rgb_to_ycbcr =
diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.c b/drivers/gpu/drm/i915/display/intel_lspcon.c
index 0c8bf477c2fb..e54aad8a5f7f 100644
--- a/drivers/gpu/drm/i915/display/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/display/intel_lspcon.c
@@ -689,6 +689,13 @@ bool lspcon_init(struct intel_digital_port *dig_port)
return true;
}
+bool intel_lspcon_active(struct intel_digital_port *dig_port)
+{
+ struct intel_lspcon *lspcon = &dig_port->lspcon;
+
+ return lspcon->active;
+}
+
u32 intel_lspcon_infoframes_enabled(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config)
{
diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.h b/drivers/gpu/drm/i915/display/intel_lspcon.h
index 47f9ae77b328..4c8ba3ddbac4 100644
--- a/drivers/gpu/drm/i915/display/intel_lspcon.h
+++ b/drivers/gpu/drm/i915/display/intel_lspcon.h
@@ -16,6 +16,7 @@ struct intel_encoder;
struct intel_lspcon;
bool lspcon_init(struct intel_digital_port *dig_port);
+bool intel_lspcon_active(struct intel_digital_port *dig_port);
void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon);
void lspcon_resume(struct intel_digital_port *dig_port);
void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
--
2.39.5
next prev parent reply other threads:[~2025-02-04 13:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 13:58 [PATCH v2 0/6] drm/i915/lspcon: interface cleanups Jani Nikula
2025-02-04 13:58 ` [PATCH v2 1/6] drm/i915/hdmi: move declarations for hsw_read/write_infoframe() to the right place Jani Nikula
2025-02-04 22:55 ` Rodrigo Vivi
2025-02-04 13:58 ` Jani Nikula [this message]
2025-02-04 22:55 ` [PATCH v2 2/6] drm/i915/lspcon: add intel_lspcon_active() and use it Rodrigo Vivi
2025-02-04 13:58 ` [PATCH v2 3/6] drm/i915/lspcon: change signature of lspcon_detect_hdr_capability() Jani Nikula
2025-02-04 22:57 ` Rodrigo Vivi
2025-02-04 13:58 ` [PATCH v2 4/6] drm/i915/lspcon: change signature of lspcon_wait_pcon_mode() Jani Nikula
2025-02-04 22:58 ` Rodrigo Vivi
2025-02-05 17:53 ` Jani Nikula
2025-02-04 13:58 ` [PATCH v2 5/6] drm/i915/lspcon: remove dp_to_lspcon(), hide enc_to_intel_lspcon() Jani Nikula
2025-02-04 22:59 ` Rodrigo Vivi
2025-02-04 13:58 ` [PATCH v2 6/6] drm/i915/lspcon: rename interfaces to intel_lspcon_* to unify Jani Nikula
2025-02-04 22:59 ` Rodrigo Vivi
2025-02-04 17:48 ` ✓ CI.Patch_applied: success for drm/i915/lspcon: interface cleanups Patchwork
2025-02-04 17:48 ` ✓ CI.checkpatch: " Patchwork
2025-02-04 17:49 ` ✓ CI.KUnit: " Patchwork
2025-02-04 18:06 ` ✓ CI.Build: " Patchwork
2025-02-04 18:08 ` ✓ CI.Hooks: " Patchwork
2025-02-04 18:09 ` ✗ CI.checksparse: warning " Patchwork
2025-02-04 18:31 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-04 21:55 ` ✗ Xe.CI.Full: 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=3eabe0cb07a84c63119ea893e149de410b4356b0.1738677489.git.jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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