All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Allow control of PSR at runtime through debugfs, v4.
Date: Wed, 1 Aug 2018 11:41:32 +0200	[thread overview]
Message-ID: <1c66dcb9-2440-aab4-fc4b-630db61576a4@linux.intel.com> (raw)
In-Reply-To: <20180731133559.6892-1-maarten.lankhorst@linux.intel.com>

Op 31-07-18 om 15:35 schreef Maarten Lankhorst:
> Currently tests modify i915.enable_psr and then do a modeset cycle
> to change PSR. We can write a value to i915_edp_psr_debug to force
> a certain PSR mode without a modeset.
>
> To retain compatibility with older userspace, we also still allow
> the override through the module parameter, and add some tracking
> to check whether a debugfs mode is specified.
>
> Changes since v1:
> - Rename dev_priv->psr.enabled to .dp, and .hw_configured to .enabled.
> - Fix i915_psr_debugfs_mode to match the writes to debugfs.
> - Rename __i915_edp_psr_write to intel_psr_set_debugfs_mode, simplify
>   it and move it to intel_psr.c. This keeps all internals in intel_psr.c
> - Perform an interruptible wait for hw completion outside of the psr
>   lock, instead of being forced to trywait and return -EBUSY.
> Changes since v2:
> - Rebase on top of intel_psr changes.
> Changes since v3:
> - Assign psr.dp during init. (dhnkrn)
> - Add prepared bool, which should be used instead of relying on psr.dp. (dhnkrn)
> - Fix -EDEADLK handling in debugfs. (dhnkrn)
> - Clean up waiting for idle in intel_psr_set_debugfs_mode.
> - Print PSR mode when trying to enable PSR. (dhnkrn)
> - Move changing psr debug setting to i915_edp_psr_debug_set. (dhnkrn)
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c |  21 ++++-
>  drivers/gpu/drm/i915/i915_drv.h     |  12 ++-
>  drivers/gpu/drm/i915/i915_irq.c     |   2 +-
>  drivers/gpu/drm/i915/intel_drv.h    |   5 +-
>  drivers/gpu/drm/i915/intel_psr.c    | 136 +++++++++++++++++++++++-----
>  5 files changed, 144 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 59dc0610ea44..a7e927413e8e 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2705,7 +2705,7 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
>  	intel_runtime_pm_get(dev_priv);
>  
>  	mutex_lock(&dev_priv->psr.lock);
> -	seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv->psr.enabled));
> +	seq_printf(m, "Enabled: %s\n", yesno(dev_priv->psr.enabled));
>  	seq_printf(m, "Busy frontbuffer bits: 0x%03x\n",
>  		   dev_priv->psr.busy_frontbuffer_bits);
>  
> @@ -2747,14 +2747,29 @@ static int
>  i915_edp_psr_debug_set(void *data, u64 val)
>  {
>  	struct drm_i915_private *dev_priv = data;
> +	struct drm_modeset_acquire_ctx ctx;
> +	int ret;
>  
>  	if (!CAN_PSR(dev_priv))
>  		return -ENODEV;
>  
> -	DRM_DEBUG_KMS("PSR debug %s\n", enableddisabled(val));
> +	DRM_DEBUG_KMS("Setting PSR debug to %llx\n", val);
>  
>  	intel_runtime_pm_get(dev_priv);
> -	intel_psr_irq_control(dev_priv, !!val);
> +
> +	drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
> +
> +retry:
> +	ret = intel_psr_set_debugfs_mode(dev_priv, &ctx, val);
> +	if (ret == -EDEADLK) {
> +		ret = drm_modeset_backoff(&ctx);
> +		if (!ret)
> +			goto retry;
> +	}
> +
> +	drm_modeset_drop_locks(&ctx);
> +	drm_modeset_acquire_fini(&ctx);
> +
>  	intel_runtime_pm_put(dev_priv);
>  
>  	return 0;
^Oops, needs to be changed to return ret;

~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-08-01  9:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 11:46 [PATCH] drm/i915: Control PSR at runtime through debugfs only Maarten Lankhorst
2018-03-14 12:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-03-14 15:58 ` [PATCH] drm/i915: Allow control of PSR at runtime through debugfs Maarten Lankhorst
2018-03-14 16:07   ` Chris Wilson
2018-03-14 16:11     ` Maarten Lankhorst
2018-03-14 16:27 ` ✓ Fi.CI.BAT: success for drm/i915: Control PSR at runtime through debugfs only (rev2) Patchwork
2018-03-14 21:53 ` [PATCH] drm/i915: Control PSR at runtime through debugfs only Rodrigo Vivi
2018-03-15 10:28   ` [PATCH] drm/i915: Allow control of PSR at runtime through debugfs Maarten Lankhorst
2018-03-22  1:45     ` Pandiyan, Dhinakaran
2018-03-22  9:41       ` Maarten Lankhorst
2018-07-26  6:32         ` Dhinakaran Pandiyan
2018-07-26  9:06           ` [PATCH] drm/i915: Allow control of PSR at runtime through debugfs, v3 Maarten Lankhorst
2018-07-27  3:27             ` Dhinakaran Pandiyan
2018-07-27  8:41               ` Maarten Lankhorst
2018-07-28  5:23                 ` Dhinakaran Pandiyan
2018-07-30  9:40                   ` Maarten Lankhorst
2018-07-31 13:35                   ` [PATCH 1/2] drm/i915: Allow control of PSR at runtime through debugfs, v4 Maarten Lankhorst
2018-07-31 13:35                     ` [PATCH 2/2] drm/i915/psr: Add debugfs support to force toggling PSR1/2 mode Maarten Lankhorst
2018-08-08  1:35                       ` Dhinakaran Pandiyan
2018-08-08  9:01                         ` Maarten Lankhorst
2018-08-01  9:41                     ` Maarten Lankhorst [this message]
2018-08-08  0:07                     ` [PATCH 1/2] drm/i915: Allow control of PSR at runtime through debugfs, v4 Dhinakaran Pandiyan
2018-08-08  9:00                       ` Maarten Lankhorst
2018-07-26 12:54           ` [PATCH] drm/i915: Allow control of PSR at runtime through debugfs Maarten Lankhorst
2018-03-15  0:58 ` ✓ Fi.CI.IGT: success for drm/i915: Control PSR at runtime through debugfs only (rev2) Patchwork
2018-03-15 11:01 ` ✓ Fi.CI.BAT: success for drm/i915: Control PSR at runtime through debugfs only (rev3) Patchwork
2018-03-15 12:17 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-26 10:10 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Control PSR at runtime through debugfs only (rev4) Patchwork
2018-07-26 10:11 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-26 10:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-26 11:57 ` ✓ Fi.CI.IGT: " 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=1c66dcb9-2440-aab4-fc4b-630db61576a4@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.