[Intel-gfx] [PATCH 24/29] drm/i915/tc: Don't connect the PHY in intel_tc_port_connected()
Kahola, Mika
mika.kahola at intel.com
Mon Mar 27 12:48:39 UTC 2023
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Imre
> Deak
> Sent: Thursday, March 23, 2023 4:21 PM
> To: intel-gfx at lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 24/29] drm/i915/tc: Don't connect the PHY in
> intel_tc_port_connected()
>
> Connecting the PHY for connector probing - also blocking TC-cold - isn't required
> and has some overhead. Taking only the mutex is sufficient, so do that.
>
Reviewed-by: Mika Kahola <mika.kahola at intel.com>
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_tc.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> b/drivers/gpu/drm/i915/display/intel_tc.c
> index 08a23ab081d74..f202ba324fd0a 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -1235,20 +1235,25 @@ bool intel_tc_port_connected_locked(struct
> intel_encoder *encoder)
> struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
> struct intel_tc_port *tc = to_tc_port(dig_port);
> + u32 mask = ~0;
>
> drm_WARN_ON(&i915->drm, !intel_tc_port_ref_held(dig_port));
>
> - return tc_phy_hpd_live_status(tc) & BIT(tc->mode);
> + if (tc->mode != TC_PORT_DISCONNECTED)
> + mask = BIT(tc->mode);
> +
> + return tc_phy_hpd_live_status(tc) & mask;
> }
>
> bool intel_tc_port_connected(struct intel_encoder *encoder) {
> struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> + struct intel_tc_port *tc = to_tc_port(dig_port);
> bool is_connected;
>
> - intel_tc_port_lock(dig_port);
> + mutex_lock(&tc->lock);
> is_connected = intel_tc_port_connected_locked(encoder);
> - intel_tc_port_unlock(dig_port);
> + mutex_unlock(&tc->lock);
>
> return is_connected;
> }
> --
> 2.37.1
More information about the Intel-gfx
mailing list