[igt-dev] [PATCH i-g-t 1/2] tools/vbt_decode: Update PSR1 training pattern decode

Jani Nikula jani.nikula at linux.intel.com
Wed Jul 31 13:10:22 UTC 2019


On Fri, 19 Jul 2019, Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> wrote:
> The bit field corresponding to PSR1 training patterns used to be
> platform agnostic. But, for VBT versions above 205 on gen9+, the values
> map to hardware supported duration. The only exception being BXT, which
> follows the legacy mapping.
>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
>  tools/intel_vbt_decode.c | 37 ++++++++++++++++++++++++++++++-------
>  1 file changed, 30 insertions(+), 7 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 3b9006f5..ea64eee2 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -945,14 +945,20 @@ static void dump_psr(struct context *context,
>  	const struct bdb_psr *psr_block = block->data;
>  	int i;
>  	uint32_t psr2_tp_time;
> +	const char *bxt_str = "$VBT_BROXTON";

I don't think you can trust that. IS_BROXTON(context->devid) might be
more reliable. *shrug*.

BR,
Jani.


> +	bool is_bxt;
>  
>  	/* The same block ID was used for something else before? */
>  	if (context->bdb->version < 165)
>  		return;
>  
> +	is_bxt = !strncmp((char *)context->vbt->signature, bxt_str,
> +			  strlen(bxt_str));
>  	psr2_tp_time = psr_block->psr2_tp2_tp3_wakeup_time;
> +
>  	for (i = 0; i < 16; i++) {
>  		const struct psr_table *psr = &psr_block->psr_table[i];
> +		static const uint16_t psr1_tp_times[] = {500, 100, 2500, 0};
>  
>  		if (i != context->panel_type && !context->dump_all_panel_types)
>  			continue;
> @@ -979,16 +985,33 @@ static void dump_psr(struct context *context,
>  			break;
>  		}
>  
> -		printf("\t\tIdle frames to for PSR enable: %d\n",
> +		printf("\t\tIdle frames to wait for PSR enable: %d\n",
>  		       psr->idle_frames);
>  
> -		printf("\t\tTP1 wakeup time: %d usec (0x%x)\n",
> -		       psr->tp1_wakeup_time * 100,
> -		       psr->tp1_wakeup_time);
>  
> -		printf("\t\tTP2/TP3 wakeup time: %d usec (0x%x)\n",
> -		       psr->tp2_tp3_wakeup_time * 100,
> -		       psr->tp2_tp3_wakeup_time);
> +		if (is_bxt || context->bdb->version < 205)
> +			printf("\t\tTP1 wakeup time: %d usec (0x%x)\n",
> +			       psr->tp1_wakeup_time * 100,
> +			       psr->tp1_wakeup_time);
> +		else if (psr->tp1_wakeup_time <= 2)
> +			printf("\t\tTP1 wakeup time: %d usec (0x%x)\n",
> +			       psr1_tp_times[psr->tp1_wakeup_time],
> +			       psr->tp1_wakeup_time);
> +		else
> +			printf("\t\tTP1 wakeup time invalid (0x%x)",
> +			       psr->tp1_wakeup_time);
> +
> +		if (is_bxt || context->bdb->version < 205)
> +			printf("\t\tTP2/TP3 wakeup time: %d usec (0x%x)\n",
> +			       psr->tp2_tp3_wakeup_time * 100,
> +			       psr->tp2_tp3_wakeup_time);
> +		else if (psr->tp2_tp3_wakeup_time <= 2)
> +			printf("\t\tTP2/TP3 wakeup time: %d usec (0x%x)\n",
> +			       psr1_tp_times[psr->tp2_tp3_wakeup_time],
> +			       psr->tp2_tp3_wakeup_time);
> +		else
> +			printf("\t\tTP2/3 wakeup time invalid (0x%x)",
> +			       psr->tp2_tp3_wakeup_time);
>  
>  		if (context->bdb->version >= 226) {
>  			int index;

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the igt-dev mailing list