All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 3/4] drm/i915/vbt: Parse and use the new field with PSR2 TP2/3/4 wakeup time
Date: Tue, 22 Jan 2019 14:10:56 +0200	[thread overview]
Message-ID: <87va2g3nan.fsf@intel.com> (raw)
In-Reply-To: <20190116234320.20984-3-jose.souza@intel.com>

On Wed, 16 Jan 2019, José Roberto de Souza <jose.souza@intel.com> wrote:
> A new field with the training pattern(TP) wakeup time for PSR2 was
> added to VBT, so lets use it when available otherwise it will
> fallback to PSR1 wakeup time.

Same problems as with the two previous patches:

- The new field name is too long.

- The abstraction between VBT and hardware is lost.

BR,
Jani.


>
> BSpec: 20131
>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       |  8 ++++++++
>  drivers/gpu/drm/i915/intel_bios.c     | 10 ++++++++++
>  drivers/gpu/drm/i915/intel_psr.c      |  2 +-
>  drivers/gpu/drm/i915/intel_vbt_defs.h |  3 +++
>  4 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index d9893d35f0e2..e739ed9ce60c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -967,6 +967,13 @@ enum psr_tp_wakeup_time {
>  	PSR_TP_WAKEUP_TIME_LAST
>  };
>  
> +enum psr2_tp_wakeup_time {
> +	PSR2_TP_WAKEUP_TIME_500USEC = 0,
> +	PSR2_TP_WAKEUP_TIME_100USEC,
> +	PSR2_TP_WAKEUP_TIME_2500USEC,
> +	PSR2_TP_WAKEUP_TIME_50USEC
> +};
> +
>  struct intel_vbt_data {
>  	struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */
>  	struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */
> @@ -1005,6 +1012,7 @@ struct intel_vbt_data {
>  		enum psr_lines_to_wait lines_to_wait;
>  		enum psr_tp_wakeup_time tp1_wakeup_time;
>  		enum psr_tp_wakeup_time tp2_tp3_tp4_wakeup_time;
> +		enum psr2_tp_wakeup_time psr2_tp2_tp3_tp4_wakeup_time;
>  	} psr;
>  
>  	struct {
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 6de6f6f1deec..23130e0d5e6c 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -757,6 +757,16 @@ parse_psr(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  
>  		dev_priv->vbt.psr.tp2_tp3_tp4_wakeup_time = wakeup_time;
>  	}
> +
> +	if (bdb->version >= 226) {
> +		u32 wakeup_time = psr_table->psr2_tp2_tp3_tp4_wakeup_time;
> +
> +		wakeup_time = (wakeup_time >> (2 * panel_type)) & 0x3;
> +		dev_priv->vbt.psr.psr2_tp2_tp3_tp4_wakeup_time = wakeup_time;
> +	} else {
> +		/* Reusing PSR1 wakeup time for PSR2 in older VBTs */
> +		dev_priv->vbt.psr.psr2_tp2_tp3_tp4_wakeup_time = dev_priv->vbt.psr.tp2_tp3_tp4_wakeup_time;
> +	}
>  }
>  
>  static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 5daf0b9e2b42..2fc537fb6e78 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -494,7 +494,7 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
>  
>  	val |= EDP_PSR2_FRAME_BEFORE_SU(dev_priv->psr.sink_sync_latency + 1);
>  
> -	val |= dev_priv->vbt.psr.tp2_tp3_tp4_wakeup_time << EDP_PSR2_TP2_TP3_TIME_SHIFT;
> +	val |= dev_priv->vbt.psr.psr2_tp2_tp3_tp4_wakeup_time << EDP_PSR2_TP2_TP3_TIME_SHIFT;
>  
>  	I915_WRITE(EDP_PSR2_CTL, val);
>  }
> diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
> index 4ed66efde49f..dc0a14977953 100644
> --- a/drivers/gpu/drm/i915/intel_vbt_defs.h
> +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
> @@ -772,6 +772,9 @@ struct psr_table {
>  	/* TP wake up time in multiple of 100 */
>  	u16 tp1_wakeup_time;
>  	u16 tp2_tp3_tp4_wakeup_time;
> +
> +	/* PSR2 TP2/TP3/TP4 wakeup time for 16 panels */
> +	u32 psr2_tp2_tp3_tp4_wakeup_time;
>  } __packed;
>  
>  struct bdb_psr {

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-01-22 12:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 23:43 [PATCH 1/4] drm/i915/vbt: Add 'tp4' to varibles holding TP2/3/4 PSR wakeup time José Roberto de Souza
2019-01-16 23:43 ` [PATCH 2/4] drm/i915/psr: Store VBT TP wakeup times into a enum José Roberto de Souza
2019-01-22 12:09   ` Jani Nikula
2019-01-16 23:43 ` [PATCH 3/4] drm/i915/vbt: Parse and use the new field with PSR2 TP2/3/4 wakeup time José Roberto de Souza
2019-01-22 12:10   ` Jani Nikula [this message]
2019-01-22 22:49   ` Dhinakaran Pandiyan
2019-01-16 23:43 ` [PATCH 4/4] drm/i915/psr: Add HBR3 support José Roberto de Souza
2019-01-17 18:18   ` Manasi Navare
2019-01-22 22:42   ` Dhinakaran Pandiyan
2019-01-25  1:12     ` Souza, Jose
2019-01-17  9:56 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915/vbt: Add 'tp4' to varibles holding TP2/3/4 PSR wakeup time Patchwork
2019-01-17  9:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-17 10:13 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-17 16:16 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-01-22 11:52 ` [PATCH 1/4] " Jani Nikula

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=87va2g3nan.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@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.