Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/dp: Track pm_qos per connector
Date: Wed, 30 Dec 2020 18:59:33 +0200	[thread overview]
Message-ID: <20201230165933.GA4171774@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20201230104834.31236-2-chris@chris-wilson.co.uk>

On Wed, Dec 30, 2020 at 10:48:34AM +0000, Chris Wilson wrote:
> Since multiple connectors may run intel_dp_aux_xfer conncurrently, a
> single global pm_qos does not suffice. (One connector may disable the
> dma-latency boost prematurely while the second is still depending on
> it.) Instead of a single global pm_qos, track the pm_qos request for
> each intel_dp.
> 
> Fixes: 9ee32fea5fe8 ("drm/i915: irq-drive the dp aux communication")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>

Could intel_dp_aux_init/fini() be used?

> ---
>  .../gpu/drm/i915/display/intel_display_types.h   |  3 +++
>  drivers/gpu/drm/i915/display/intel_dp.c          | 16 +++++++++++++---
>  drivers/gpu/drm/i915/i915_drv.c                  |  5 -----
>  drivers/gpu/drm/i915/i915_drv.h                  |  3 ---
>  4 files changed, 16 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index b86ba1bdbaa3..1067bd073c95 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1463,6 +1463,9 @@ struct intel_dp {
>  		bool rgb_to_ycbcr;
>  	} dfp;
>  
> +	/* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
> +	struct pm_qos_request pm_qos;
> +
>  	/* Display stream compression testing */
>  	bool force_dsc_en;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 357f7921e070..f08e5f1f463d 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1512,7 +1512,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>  	 * lowest possible wakeup latency and so prevent the cpu from going into
>  	 * deep sleep states.
>  	 */
> -	cpu_latency_qos_update_request(&i915->pm_qos, 0);
> +	cpu_latency_qos_update_request(&intel_dp->pm_qos, 0);
>  
>  	intel_dp_check_edp(intel_dp);
>  
> @@ -1643,7 +1643,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>  
>  	ret = recv_bytes;
>  out:
> -	cpu_latency_qos_update_request(&i915->pm_qos, PM_QOS_DEFAULT_VALUE);
> +	cpu_latency_qos_update_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
>  
>  	if (vdd)
>  		edp_panel_vdd_off(intel_dp, false);
> @@ -7527,6 +7527,14 @@ static int intel_dp_connector_atomic_check(struct drm_connector *conn,
>  
>  	return intel_modeset_synced_crtcs(state, conn);
>  }
> +static void intel_dp_connector_destroy(struct drm_connector *connector)
> +{
> +	struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector));
> +
> +	cpu_latency_qos_remove_request(&intel_dp->pm_qos);
> +
> +	intel_connector_destroy(connector);
> +}
>  
>  static const struct drm_connector_funcs intel_dp_connector_funcs = {
>  	.force = intel_dp_force,
> @@ -7535,7 +7543,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = {
>  	.atomic_set_property = intel_digital_connector_atomic_set_property,
>  	.late_register = intel_dp_connector_register,
>  	.early_unregister = intel_dp_connector_unregister,
> -	.destroy = intel_connector_destroy,
> +	.destroy = intel_dp_connector_destroy,
>  	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
>  	.atomic_duplicate_state = intel_digital_connector_duplicate_state,
>  };
> @@ -8621,6 +8629,8 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
>  	intel_dp->frl.is_trained = false;
>  	intel_dp->frl.trained_rate_gbps = 0;
>  
> +	cpu_latency_qos_add_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
> +
>  	return true;
>  
>  fail:
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5708e11d917b..249f765993f7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -578,8 +578,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>  
>  	pci_set_master(pdev);
>  
> -	cpu_latency_qos_add_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE);
> -
>  	intel_gt_init_workarounds(dev_priv);
>  
>  	/* On the 945G/GM, the chipset reports the MSI capability on the
> @@ -626,7 +624,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>  err_msi:
>  	if (pdev->msi_enabled)
>  		pci_disable_msi(pdev);
> -	cpu_latency_qos_remove_request(&dev_priv->pm_qos);
>  err_mem_regions:
>  	intel_memory_regions_driver_release(dev_priv);
>  err_ggtt:
> @@ -648,8 +645,6 @@ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
>  
>  	if (pdev->msi_enabled)
>  		pci_disable_msi(pdev);
> -
> -	cpu_latency_qos_remove_request(&dev_priv->pm_qos);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index e38a10d5c128..5e5bcef20e33 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -891,9 +891,6 @@ struct drm_i915_private {
>  
>  	bool display_irqs_enabled;
>  
> -	/* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
> -	struct pm_qos_request pm_qos;
> -
>  	/* Sideband mailbox protection */
>  	struct mutex sb_lock;
>  	struct pm_qos_request sb_qos;
> -- 
> 2.20.1
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-12-30 16:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 10:48 [Intel-gfx] [PATCH 1/2] drm/i915/dp: Remove aux xfer timeout debug message Chris Wilson
2020-12-30 10:48 ` [Intel-gfx] [PATCH 2/2] drm/i915/dp: Track pm_qos per connector Chris Wilson
2020-12-30 16:59   ` Imre Deak [this message]
2020-12-30 17:07     ` [Intel-gfx] [PATCH v2] " Chris Wilson
2020-12-30 17:18       ` Imre Deak
2020-12-30 12:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/dp: Remove aux xfer timeout debug message Patchwork
2020-12-30 13:15 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-12-30 20:14 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/dp: Remove aux xfer timeout debug message (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-12-30 10:46 [Intel-gfx] [PATCH 1/2] pm-qos Chris Wilson
2020-12-30 10:46 ` [Intel-gfx] [PATCH 2/2] drm/i915/dp: Track pm_qos per connector Chris Wilson

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=20201230165933.GA4171774@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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