Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 24/29] drm/i915/dp_mst: Enable MST DSC decompression for all streams
Date: Mon, 30 Oct 2023 09:29:30 +0200	[thread overview]
Message-ID: <ZT9bWpagTsvvSGRF@intel.com> (raw)
In-Reply-To: <ZTvO3VK+sMksD69l@ideak-desk.fi.intel.com>

On Fri, Oct 27, 2023 at 05:53:17PM +0300, Imre Deak wrote:
> On Fri, Oct 27, 2023 at 05:45:30PM +0300, Lisovskiy, Stanislav wrote:
> > On Tue, Oct 24, 2023 at 04:09:20AM +0300, Imre Deak wrote:
> > > Enable DSC decompression for all streams. In particular atm if a sink is
> > > connected to a last branch device that is downstream of the first branch
> > > device connected to the source, decompression is not enabled for it.
> > > Similarly it's not enabled if the sink supports this with the last
> > > branch device passing through the compressed stream to it.
> > > 
> > > Enable DSC in the above cases as well. Since last branch devices may
> > > handle the decompression for multiple ports, toggling DSC needs to be
> > > refcounted, add this using the DSC AUX device as a reference.
> > > 
> > > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > > ---
> > >  .../drm/i915/display/intel_display_types.h    |  1 +
> > >  drivers/gpu/drm/i915/display/intel_dp.c       |  3 +
> > >  drivers/gpu/drm/i915/display/intel_dp_mst.c   | 57 ++++++++++++-------
> > >  3 files changed, 42 insertions(+), 19 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > index 409dbf8a2a1cd..b2744a9b4678c 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > @@ -626,6 +626,7 @@ struct intel_connector {
> > >  		u8 fec_capability;
> > >  
> > >  		u8 dsc_hblank_expansion_quirk:1;
> > > +		u8 dsc_decompression_enabled:1;
> > >  	} dp;
> > >  
> > >  	/* Work struct to schedule a uevent on link train failure */
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index bb8951f89f61f..c89e1a4393d0f 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -1403,6 +1403,7 @@ static bool intel_dp_supports_dsc(const struct intel_connector *connector,
> > >  		return false;
> > >  
> > >  	return intel_dsc_source_support(crtc_state) &&
> > > +		connector->dp.dsc_decompression_aux &&
> > >  		drm_dp_sink_supports_dsc(connector->dp.dsc_dpcd);
> > >  }
> > >  
> > > @@ -2948,6 +2949,8 @@ intel_dp_sink_set_dsc_decompression(struct intel_connector *connector,
> > >  		drm_dbg_kms(&i915->drm,
> > >  			    "Failed to %s sink decompression state\n",
> > >  			    str_enable_disable(enable));
> > > +
> > > +	connector->dp.dsc_decompression_enabled = enable;
> > >  }
> > >  
> > >  static void
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > > index 8ef3a2611207c..9f4894c2e7860 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > > @@ -660,6 +660,39 @@ intel_dp_mst_atomic_topology_check(struct intel_connector *connector,
> > >  	return ret;
> > >  }
> > >  
> > > +static int intel_dp_mst_dsc_aux_use_count(struct intel_atomic_state *state,
> > > +					  const struct intel_connector *connector)
> > > +{
> > > +	struct intel_connector *connector_iter;
> > > +	struct intel_digital_connector_state *conn_state;
> > > +	int use_count = 0;
> > > +	int i;
> > > +
> > > +	for_each_new_intel_connector_in_state(state, connector_iter, conn_state, i) {
> > > +		if (connector_iter->mst_port != connector->mst_port ||
> > > +		    !conn_state->base.crtc)
> > > +			continue;
> > > +
> > > +		if (!connector_iter->dp.dsc_decompression_enabled)
> > > +			continue;
> > > +
> > > +		if (connector_iter->dp.dsc_decompression_aux ==
> > > +		    connector->dp.dsc_decompression_aux)
> > > +			use_count++;
> > > +	}
> > > +
> > > +	return use_count;
> > > +}
> > > +
> > > +static void intel_dp_mst_sink_set_decompression_state(struct intel_atomic_state *state,
> > > +						      struct intel_connector *connector,
> > > +						      const struct intel_crtc_state *crtc_state,
> > > +						      bool enable)
> > > +{
> > > +	if (!intel_dp_mst_dsc_aux_use_count(state, connector))
> > > +		intel_dp_sink_set_decompression_state(connector, crtc_state, enable);
> > 
> > But where the use count is decremented?
> > As I understand we will be able to set this with enable==false also when use_count is 0.
> 
> use_count is recalculated for the current state, based on
> each connector's dsc_decompression_enabled flag and whether the
> given connector's AUX device matches what this function wants to use to
> enable/disable the decompression. So use_count will be the number of
> connectors at the moment which have decompression enabled through the
> AUX device in question.
> 
> > For that we need to have intel_connector->dp.dsc_decompression_aux NULLed somewhere?
> 
> No, it stays set, but dsc_decompression_enabled does get set/cleared.

Got it,

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

> 
> > Stan
> > > +}
> > > +
> > >  static int
> > >  intel_dp_mst_atomic_check(struct drm_connector *connector,
> > >  			  struct drm_atomic_state *_state)
> > > @@ -730,12 +763,7 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
> > >  
> > >  	intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
> > >  
> > > -	if (intel_dp->active_mst_links == 1) /* last stream ? */
> > > -		/*
> > > -		 * TODO: disable decompression for all streams/in any MST ports, not
> > > -		 * only in the first downstream branch device.
> > > -		 */
> > > -		intel_dp_sink_set_decompression_state(connector, old_crtc_state, false);
> > > +	intel_dp_mst_sink_set_decompression_state(state, connector, old_crtc_state, false);
> > >  }
> > >  
> > >  static void intel_mst_post_disable_dp(struct intel_atomic_state *state,
> > > @@ -890,15 +918,11 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
> > >  
> > >  	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
> > >  
> > > -	if (first_mst_stream) {
> > > -		/*
> > > -		 * TODO: enable decompression for all streams/in any MST ports, not
> > > -		 * only in the first downstream branch device.
> > > -		 */
> > > -		intel_dp_sink_set_decompression_state(connector, pipe_config, true);
> > > +	intel_dp_mst_sink_set_decompression_state(state, connector, pipe_config, true);
> > > +
> > > +	if (first_mst_stream)
> > >  		dig_port->base.pre_enable(state, &dig_port->base,
> > >  						pipe_config, NULL);
> > > -	}
> > >  
> > >  	intel_dp->active_mst_links++;
> > >  
> > > @@ -1350,12 +1374,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
> > >  
> > >  	drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs);
> > >  
> > > -	/*
> > > -	 * TODO: set the AUX for the actual MST port decompressing the stream.
> > > -	 * At the moment the driver only supports enabling this globally in the
> > > -	 * first downstream MST branch, via intel_dp's (root port) AUX.
> > > -	 */
> > > -	intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;
> > > +	intel_connector->dp.dsc_decompression_aux = drm_dp_mst_dsc_aux_for_port(port);
> > >  	intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
> > >  	intel_connector->dp.dsc_hblank_expansion_quirk =
> > >  		detect_dsc_hblank_expansion_quirk(intel_connector);
> > > -- 
> > > 2.39.2
> > > 

  parent reply	other threads:[~2023-10-30  7:29 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  1:08 [Intel-gfx] [PATCH 00/29] drm/i915: Improve BW management on MST links Imre Deak
2023-10-24  1:08 ` [Intel-gfx] [PATCH 01/29] drm/dp_mst: Fix fractional DSC bpp handling Imre Deak
2023-10-24  1:08 ` [Intel-gfx] [PATCH 02/29] drm/dp_mst: Add helper to determine if an MST port is downstream of another port Imre Deak
2023-10-24  1:08 ` [Intel-gfx] [PATCH 03/29] drm/dp_mst: Factor out a helper to check the atomic state of a topology manager Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 04/29] drm/dp_mst: Swap the order of checking root vs. non-root port BW limitations Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 05/29] drm/dp_mst: Allow DSC in any Synaptics last branch device Imre Deak
2023-10-27  9:21   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 06/29] drm/dp: Add DP_HBLANK_EXPANSION_CAPABLE and DSC_PASSTHROUGH_EN DPCD flags Imre Deak
2023-10-27  9:22   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 07/29] drm/dp_mst: Add HBLANK expansion quirk for Synaptics MST hubs Imre Deak
2023-10-24 10:22   ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-10-27  9:23   ` [Intel-gfx] [PATCH " Lisovskiy, Stanislav
2023-10-27 12:22   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 08/29] drm/dp: Add helpers to calculate the link BW overhead Imre Deak
2023-10-24  2:47   ` kernel test robot
2023-10-24 10:22   ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-10-27 12:21     ` Lisovskiy, Stanislav
2023-10-24 12:34   ` [Intel-gfx] [PATCH " kernel test robot
2023-10-25 15:47   ` kernel test robot
2023-10-24  1:09 ` [Intel-gfx] [PATCH 09/29] drm/i915/dp_mst: Enable FEC early once it's known DSC is needed Imre Deak
2023-10-24 17:27   ` Lisovskiy, Stanislav
2023-10-30  8:38   ` Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 10/29] drm/i915/dp: Specify the FEC overhead as an increment vs. a remainder Imre Deak
2023-10-25 15:27   ` Ville Syrjälä
2023-10-25 15:37     ` Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 11/29] drm/i915/dp: Pass actual BW overhead to m_n calculation Imre Deak
2023-10-24 17:28   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 12/29] drm/i915/dp_mst: Account for FEC and DSC overhead during BW allocation Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 13/29] drm/i915/dp_mst: Add atomic state for all streams on pre-tgl platforms Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 14/29] drm/i915/dp_mst: Program the DSC PPS SDP for each stream Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 15/29] drm/i915/dp: Make sure the DSC PPS SDP is disabled whenever DSC is disabled Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 16/29] drm/i915/dp_mst: Add missing DSC compression disabling Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 17/29] drm/i915/dp: Rename intel_ddi_disable_fec_state() to intel_ddi_disable_fec() Imre Deak
2023-10-25  7:58   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 18/29] drm/i915/dp: Wait for FEC detected status in the sink Imre Deak
2023-10-24 17:25   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 19/29] drm/i915/dp: Disable FEC ready flag " Imre Deak
2023-10-25  8:01   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 20/29] drm/i915/dp_mst: Handle the Synaptics HBlank expansion quirk Imre Deak
2023-10-27  7:59   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 21/29] drm/i915/dp_mst: Enable decompression in the sink from the MST encoder hooks Imre Deak
2023-10-27 12:24   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 22/29] drm/i915/dp: Enable DSC via the connector decompression AUX Imre Deak
2023-10-24 10:22   ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-10-27 12:27     ` Lisovskiy, Stanislav
2023-10-25  8:30   ` [Intel-gfx] [PATCH " Lisovskiy, Stanislav
2023-10-27 12:25   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 23/29] drm/i915/dp_mst: Enable DSC passthrough Imre Deak
2023-10-24 10:22   ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-10-27 12:26     ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 24/29] drm/i915/dp_mst: Enable MST DSC decompression for all streams Imre Deak
     [not found]   ` <ZTvNCgO9NF/rl1t+@intel.com>
     [not found]     ` <ZTvO3VK+sMksD69l@ideak-desk.fi.intel.com>
2023-10-30  7:29       ` Lisovskiy, Stanislav [this message]
2023-10-30  8:09         ` Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 25/29] drm/i915: Factor out function to clear pipe update flags Imre Deak
     [not found]   ` <ZTvaXNT3C3VZGOel@intel.com>
2023-10-27 16:39     ` Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 26/29] drm/i915/dp_mst: Force modeset CRTC if DSC toggling requires it Imre Deak
2023-10-27  9:08   ` Lisovskiy, Stanislav
2023-10-24  1:09 ` [Intel-gfx] [PATCH 27/29] drm/i915/dp_mst: Improve BW sharing between MST streams Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 28/29] drm/i915/dp_mst: Check BW limitations only after all streams are computed Imre Deak
2023-10-24  1:09 ` [Intel-gfx] [PATCH 29/29] drm/i915: Query compressed bpp properly using correct DPCD and DP Spec info Imre Deak
2023-10-30  4:17   ` Nautiyal, Ankit K
2023-10-30  5:29   ` Murthy, Arun R
2023-10-24 22:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improve BW management on MST links (rev5) Patchwork
2023-10-24 22:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-24 22:32 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-25  7:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-26 12:18 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-27 22:53 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improve BW management on MST links (rev7) Patchwork
2023-10-27 22:53 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-27 23:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-30 21:19 ` [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=ZT9bWpagTsvvSGRF@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=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