All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: vathsala nagaraju <vathsala.nagaraju@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Patil Deepti <deepti.patil@intel.com>,
	Jim Bride <jim.bride@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 09/10] drm/i915/psr: report live PSR2 State
Date: Thu, 5 Jan 2017 09:47:50 -0800	[thread overview]
Message-ID: <20170105174750.GB13837@intel.com> (raw)
In-Reply-To: <1483356663-32668-10-git-send-email-vathsala.nagaraju@intel.com>


I like this live status!

On Mon, Jan 02, 2017 at 05:01:02PM +0530, vathsala nagaraju wrote:
> Reports  live state of PSR2 form PSR2_STATUS register.
> bit field 31:28 gives the live state of PSR2.
> It can be used to check if system is in deep sleep,
> selective update or selective update standby.
> During video play back, we can use this to check
> if system is entering SU mode or not.
> when system is in idle state, DEEP_SLEEP(8) must be entered.
> When video playback is happening, system must be in
> SLEEP(3 / selective update) or SU_STANDBY( 6 / selective update standby)
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Jim Bride <jim.bride@linux.intel.com>
> Signed-off-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> Signed-off-by: Patil Deepti <deepti.patil@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 24 ++++++++++++++++++++++++
>  drivers/gpu/drm/i915/i915_reg.h     |  2 ++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 9d7b5a8..8b0e3f9 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2606,6 +2606,30 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
>  
>  		seq_printf(m, "Performance_Counter: %u\n", psrperf);
>  	}
> +	if (dev_priv->psr.psr2_support) {
> +		static const char * const live_status[] = {
> +							"IDLE",
> +							"CAPTURE",
> +							"CAPTURE_Fs",

Fs? all others are fully capital

> +							"SLEEP",
> +							"BUFON_FW",
> +							"ML_UP",
> +							"SU_STANDBY",
> +							"FAST_SLEEP",
> +							"DEEP_SLEEP",
> +							"BUF_ON",
> +							"TG_ON" };
> +		u8 pos = (I915_READ(EDP_PSR2_STATUS_CTL) &
> +			EDP_PSR2_STATUS_STATE_MASK) >>
> +			EDP_PSR2_STATUS_STATE_SHIFT;
> +
> +		seq_printf(m, "PSR2_STATUS_EDP: %x\n",
> +			I915_READ(EDP_PSR2_STATUS_CTL));
> +
> +		if (pos <= EDP_PSR2_STATUS_TG_ON)

I like this protection...

> +		seq_printf(m, "PSR2 live state %s\n",
> +			live_status[pos]);
> +	}
>  	mutex_unlock(&dev_priv->psr.lock);
>  
>  	intel_runtime_pm_put(dev_priv);
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 0cbe564..03a14d9 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3624,6 +3624,8 @@ enum {
>  
>  #define EDP_PSR2_STATUS_CTL            _MMIO(0x6f940)
>  #define EDP_PSR2_STATUS_STATE_MASK     (0xf<<28)
> +#define EDP_PSR2_STATUS_STATE_SHIFT    28
> +#define EDP_PSR2_STATUS_TG_ON          0xa

... but I don't like how this TG_ON is defined,
because following the general style
EDP_PSR2_STATUS_TG_ON should be (0xa<<28)
so it might confuse people...

maybe just remove this and use the protection with size of live_status?


>  
>  /* VGA port control */
>  #define ADPA			_MMIO(0x61100)
> -- 
> 1.9.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-01-05 17:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 11:30 [PATCH 00/10] enable psr2 for idle_screen on y-cordinate panel vathsala nagaraju
2017-01-02 11:30 ` [PATCH 01/10] drm : adds Y-coordinate and Colorimetry Format vathsala nagaraju
2017-01-10 23:43   ` [Intel-gfx] " Rodrigo Vivi
2017-01-11  7:41     ` Daniel Vetter
2017-01-02 11:30 ` [PATCH 02/10] drm/i915/psr: program vsc header for psr2 vathsala nagaraju
2017-01-04 23:46   ` Jim Bride
2017-01-10 23:44     ` [Intel-gfx] " Rodrigo Vivi
2017-01-02 11:30 ` [PATCH 03/10] drm/i915/psr: fix blank screen issue " vathsala nagaraju
2017-01-05 18:05   ` Rodrigo Vivi
2017-01-02 11:30 ` [PATCH 04/10] drm/i915/psr: disable aux_frame_sync on psr2 exit vathsala nagaraju
2017-01-05 18:00   ` Rodrigo Vivi
2017-01-02 11:30 ` [PATCH 05/10] drm/i915/psr: enable ALPM for psr2 vathsala nagaraju
2017-01-05 20:38   ` Jim Bride
2017-01-13  0:45     ` [Intel-gfx] " Rodrigo Vivi
2017-01-02 11:30 ` [PATCH 06/10] drm/i915/psr: set CHICKEN_TRANS " vathsala nagaraju
2017-01-05 17:57   ` Rodrigo Vivi
2017-01-02 11:31 ` [PATCH 07/10] drm/i915/psr: set PSR_MASK bits for deep sleep vathsala nagaraju
2017-01-03 16:31   ` Ilia Mirkin
2017-01-02 11:31 ` [PATCH 08/10] drm/i915/psr: enable psr2 for y cordinate panels vathsala nagaraju
2017-01-05 17:49   ` Rodrigo Vivi
2017-01-02 11:31 ` [PATCH 09/10] drm/i915/psr: report live PSR2 State vathsala nagaraju
2017-01-05 17:47   ` Rodrigo Vivi [this message]
2017-01-02 11:31 ` [PATCH 10/10] drm/i915/psr: EDP_PSR_PERF_CNT not valid for psr2 vathsala nagaraju
2017-01-05 17:40   ` Rodrigo Vivi
2017-01-02 12:17 ` ✓ Fi.CI.BAT: success for enable psr2 for idle_screen on y-cordinate panel (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-01-06 16:32 [PATCH 09/10] drm/i915/psr: report live PSR2 State vathsala nagaraju
2017-01-06 17:21 ` Vivi, Rodrigo
2016-12-30  5:25 [PATCH 00/10] enable psr2 for idle_screen on y-cordinate panel vathsala nagaraju
2016-12-30  5:25 ` [PATCH 09/10] drm/i915/psr: report live PSR2 State vathsala nagaraju

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=20170105174750.GB13837@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=deepti.patil@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jim.bride@linux.intel.com \
    --cc=vathsala.nagaraju@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.