drm/i915/vbt: Parse and use the new field with PSR2 TP2/3 wakeup time
Subsystems (2)
PATCH v2 1/3 drm/i915/vbt: Parse and use the new field with PSR2 TP2/3 wakeup time
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.
v2: replacing enum to numerical usec time (Jani)
BSpec: 20131
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_bios.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_psr.c | 8 ++++---- drivers/gpu/drm/i915/intel_vbt_defs.h | 3 +++ 4 files changed, 33 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -1006,6 +1006,7 @@ struct intel_vbt_data {enum psr_lines_to_wait lines_to_wait;int tp1_wakeup_time_us;int tp2_tp3_wakeup_time_us; +int psr2_tp2_tp3_wakeup_time_us; } psr;struct {
drivers/gpu/drm/i915/intel_bios.c +25 -0
@@ -760,6 +760,31 @@ parse_psr(struct drm_i915_private *dev_priv, const struct bdb_header *bdb) dev_priv->vbt.psr.tp1_wakeup_time_us = psr_table->tp1_wakeup_time *100 ; dev_priv->vbt.psr.tp2_tp3_wakeup_time_us = psr_table->tp2_tp3_wakeup_time *100 ; } + +if (bdb->version >=226 ) { +u32 wakeup_time = psr_table->psr2_tp2_tp3_wakeup_time; + + wakeup_time = (wakeup_time >> (2 * panel_type)) &0x3 ; +switch (wakeup_time) { +case 0 : + wakeup_time =500 ; +break ; +case 1 : + wakeup_time =100 ; +break ; +case 3 : + wakeup_time =50 ; +break ; +default : +case 2 : + wakeup_time =2500 ; +break ; + } + dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us = wakeup_time; + }else { +/* Reusing PSR1 wakeup time for PSR2 in older VBTs */ + dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us = dev_priv->vbt.psr.tp2_tp3_wakeup_time_us; + } } static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_psr.c +4 -4
@@ -511,12 +511,12 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp) val |=EDP_PSR2_FRAME_BEFORE_SU (dev_priv->psr.sink_sync_latency +1 ); -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us >=0 && - dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) +if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us >=0 && + dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <=50 ) val |= EDP_PSR2_TP2_TIME_50us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) +else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <=100 ) val |= EDP_PSR2_TP2_TIME_100us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) +else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <=500 ) val |= EDP_PSR2_TP2_TIME_500us;else val |= EDP_PSR2_TP2_TIME_2500us;
drivers/gpu/drm/i915/intel_vbt_defs.h +3 -0
@@ -772,6 +772,9 @@ struct psr_table {/* TP wake up time in multiple of 100 */ u16 tp1_wakeup_time;u16 tp2_tp3_wakeup_time; + +/* PSR2 TP2/TP3 wakeup time for 16 panels */ +u32 psr2_tp2_tp3_wakeup_time; } __packed;struct bdb_psr {
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/3 drm/i915/psr: Move logic to get TPS registers values to another function
This will make hsw_activate_psr1() more easy to read and will make future modification to TPS registers more easy to review and read.
--- drivers/gpu/drm/i915/intel_psr.c | 56 +++++++++++++++++++------------- 1 file changed, 33 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/intel_psr.c +33 -23
@@ -437,32 +437,13 @@ static void intel_psr_enable_sink(struct intel_dp *intel_dp)drm_dp_dpcd_writeb (&intel_dp->aux,DP_SET_POWER ,DP_SET_POWER_D0 ); } -static void hsw_activate_psr1 (struct intel_dp *intel_dp) +static u32 psr1_tps_regs_val_get (struct intel_dp *intel_dp) {struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp); -u32 max_sleep_time =0x1f ; -u32 val =EDP_PSR_ENABLE ; - -/* Let's use 6 as the minimum to cover all known cases including the -* off-by-one issue that HW has in some cases. -*/ -int idle_frames =max (6 , dev_priv->vbt.psr.idle_frames); - -/* sink_sync_latency of 8 means source has to wait for more than 8 -* frames, we'll go with 9 frames for now -*/ - idle_frames =max (idle_frames, dev_priv->psr.sink_sync_latency +1 ); - val |= idle_frames <<EDP_PSR_IDLE_FRAME_SHIFT ; - - val |= max_sleep_time <<EDP_PSR_MAX_SLEEP_TIME_SHIFT ; -if (IS_HASWELL (dev_priv)) - val |=EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES ; - -if (dev_priv->psr.link_standby) - val |=EDP_PSR_LINK_STANDBY ; +u32 val =0 ;if (dev_priv->vbt.psr.tp1_wakeup_time_us ==0 ) - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_0us;else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=100 ) val |= EDP_PSR_TP1_TIME_100us;else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=500 )
@@ -471,7 +452,7 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp) val |= EDP_PSR_TP1_TIME_2500us;if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us ==0 ) - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_0us;else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) val |= EDP_PSR_TP2_TP3_TIME_100us;else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 )
@@ -485,6 +466,35 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)else val |=EDP_PSR_TP1_TP2_SEL ; +return val; +} + +static void hsw_activate_psr1 (struct intel_dp *intel_dp) +{ +struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp); +u32 max_sleep_time =0x1f ; +u32 val =EDP_PSR_ENABLE ; + +/* Let's use 6 as the minimum to cover all known cases including the +* off-by-one issue that HW has in some cases. +*/ +int idle_frames =max (6 , dev_priv->vbt.psr.idle_frames); + +/* sink_sync_latency of 8 means source has to wait for more than 8 +* frames, we'll go with 9 frames for now +*/ + idle_frames =max (idle_frames, dev_priv->psr.sink_sync_latency +1 ); + val |= idle_frames <<EDP_PSR_IDLE_FRAME_SHIFT ; + + val |= max_sleep_time <<EDP_PSR_MAX_SLEEP_TIME_SHIFT ; +if (IS_HASWELL (dev_priv)) + val |=EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES ; + +if (dev_priv->psr.link_standby) + val |=EDP_PSR_LINK_STANDBY ; + + val |=psr1_tps_regs_val_get (intel_dp); +if (INTEL_GEN (dev_priv) >=8 ) val |=EDP_PSR_CRC_ENABLE ;
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 3/3 drm/i915/icl+: Always use TPS2 or TPS3 when exiting PSR
In reply to José Roberto de SouzaTPS4 support was added to PSR because HBR3/PSR spec was not closed when ICL was freezed so if HBR3 was supported by PSR, ICL would already be ready but it was not added to spec so lets always disable TPS4.
BSpec: 17524
--- drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/intel_psr.c | 3 +++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -4205,6 +4205,8 @@ enum {#define EDP_PSR_TP2_TP3_TIME_100us (1 << 8)#define EDP_PSR_TP2_TP3_TIME_2500us (2 << 8)#define EDP_PSR_TP2_TP3_TIME_0us (3 << 8) +#define EDP_PSR_TP4_TIME_SHIFT (6)/* ICL+ */ +#define EDP_PSR_TP4_TIME_0US (3 << EDP_PSR_TP4_TIME_SHIFT)/* ICL+ */ #define EDP_PSR_TP1_TIME_500us (0 << 4)#define EDP_PSR_TP1_TIME_100us (1 << 4)#define EDP_PSR_TP1_TIME_2500us (2 << 4)
drivers/gpu/drm/i915/intel_psr.c +3 -0
@@ -442,6 +442,9 @@ static u32 psr1_tps_regs_val_get(struct intel_dp *intel_dp)struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp);u32 val =0 ; +if (INTEL_GEN (dev_priv) >=11 ) + val |= EDP_PSR_TP4_TIME_0US +if (dev_priv->vbt.psr.tp1_wakeup_time_us ==0 ) val |= EDP_PSR_TP1_TIME_0us;else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=100 )
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kbuild test robot
build botRe: [PATCH v2 3/3] drm/i915/icl+: Always use TPS2 or TPS3 when exiting PSR
Thank you for the patch! Yet something to improve:
Hi José,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.0 next-20190305]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jos-Roberto-de-Souza/drm-i915-vbt-Parse-and-use-the-new-field-with-PSR2-TP2-3-wakeup-time/20190306-140524 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: i386-randconfig-x006-201909 (attached as .config) compiler: gcc-8 (Debian 8.3.0-2) 8.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_psr.c: In function 'psr1_tps_regs_val_get':
>> drivers/gpu/drm/i915/intel_psr.c:446:2: error: expected ';' before 'if'
if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0)
^~vim +446 drivers/gpu/drm/i915/intel_psr.c
0bc12bcb1 Rodrigo Vivi 2014-11-14 437a5f924097 José Roberto de Souza 2019-03-05 438 static u32 psr1_tps_regs_val_get(struct intel_dp *intel_dp)
0bc12bcb1 Rodrigo Vivi 2014-11-14 439 {
1895759ee Rodrigo Vivi 2018-08-27 440 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
a5f924097 José Roberto de Souza 2019-03-05 441 u32 val = 0;
60e5ffe32 Rodrigo Vivi 2016-02-01 442
715dd286b José Roberto de Souza 2019-03-05 443 if (INTEL_GEN(dev_priv) >= 11)
715dd286b José Roberto de Souza 2019-03-05 444 val |= EDP_PSR_TP4_TIME_0US
715dd286b José Roberto de Souza 2019-03-05 445
77312ae8f Vathsala Nagaraju 2018-05-22 @446 if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0)
77312ae8f Vathsala Nagaraju 2018-05-22 447 val |= EDP_PSR_TP1_TIME_0us;
77312ae8f Vathsala Nagaraju 2018-05-22 448 else if (dev_priv->vbt.psr.tp1_wakeup_time_us <= 100)
50db13901 Daniel Vetter 2016-05-18 449 val |= EDP_PSR_TP1_TIME_100us;
77312ae8f Vathsala Nagaraju 2018-05-22 450 else if (dev_priv->vbt.psr.tp1_wakeup_time_us <= 500)
77312ae8f Vathsala Nagaraju 2018-05-22 451 val |= EDP_PSR_TP1_TIME_500us;
50db13901 Daniel Vetter 2016-05-18 452 else
77312ae8f Vathsala Nagaraju 2018-05-22 453 val |= EDP_PSR_TP1_TIME_2500us;
50db13901 Daniel Vetter 2016-05-18 454
77312ae8f Vathsala Nagaraju 2018-05-22 455 if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us == 0)
77312ae8f Vathsala Nagaraju 2018-05-22 456 val |= EDP_PSR_TP2_TP3_TIME_0us;
77312ae8f Vathsala Nagaraju 2018-05-22 457 else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <= 100)
50db13901 Daniel Vetter 2016-05-18 458 val |= EDP_PSR_TP2_TP3_TIME_100us;
77312ae8f Vathsala Nagaraju 2018-05-22 459 else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <= 500)
77312ae8f Vathsala Nagaraju 2018-05-22 460 val |= EDP_PSR_TP2_TP3_TIME_500us;
50db13901 Daniel Vetter 2016-05-18 461 else
77312ae8f Vathsala Nagaraju 2018-05-22 462 val |= EDP_PSR_TP2_TP3_TIME_2500us;
50db13901 Daniel Vetter 2016-05-18 463
50db13901 Daniel Vetter 2016-05-18 464 if (intel_dp_source_supports_hbr2(intel_dp) &&
50db13901 Daniel Vetter 2016-05-18 465 drm_dp_tps3_supported(intel_dp->dpcd))
50db13901 Daniel Vetter 2016-05-18 466 val |= EDP_PSR_TP1_TP3_SEL;
50db13901 Daniel Vetter 2016-05-18 467 else
50db13901 Daniel Vetter 2016-05-18 468 val |= EDP_PSR_TP1_TP2_SEL;
50db13901 Daniel Vetter 2016-05-18 469
a5f924097 José Roberto de Souza 2019-03-05 470 return val;
a5f924097 José Roberto de Souza 2019-03-05 471 }
a5f924097 José Roberto de Souza 2019-03-05 472 :::::: The code at line 446 was first introduced by commit
:::::: 77312ae8f071fb389d9982ce743b72975990c4d9 drm/i915/psr: vbt change for psr
:::::: TO: Vathsala Nagaraju <[email protected]> :::::: CC: Jani Nikula <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kbuild test robot
build botRe: [PATCH v2 3/3] drm/i915/icl+: Always use TPS2 or TPS3 when exiting PSR
In reply to José Roberto de SouzaThank you for the patch! Yet something to improve:
Hi José,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.0 next-20190305]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jos-Roberto-de-Souza/drm-i915-vbt-Parse-and-use-the-new-field-with-PSR2-TP2-3-wakeup-time/20190306-140524 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-randconfig-x019-201909 (attached as .config) compiler: gcc-8 (Debian 8.3.0-2) 8.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/async.h:16,
from drivers/gpu/drm/i915/intel_drv.h:28,
from drivers/gpu/drm/i915/intel_psr.c:55:
drivers/gpu/drm/i915/intel_psr.c: In function 'psr1_tps_regs_val_get':
>> include/linux/compiler.h:58:2: error: expected ';' before 'if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
drivers/gpu/drm/i915/intel_psr.c:446:2: note: in expansion of macro 'if'
if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0)
^~
--
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/async.h:16,
from drivers/gpu//drm/i915/intel_drv.h:28,
from drivers/gpu//drm/i915/intel_psr.c:55:
drivers/gpu//drm/i915/intel_psr.c: In function 'psr1_tps_regs_val_get':
>> include/linux/compiler.h:58:2: error: expected ';' before 'if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
drivers/gpu//drm/i915/intel_psr.c:446:2: note: in expansion of macro 'if'
if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0)
^~vim +58 include/linux/compiler.h
2bcd521a Steven Rostedt 2008-11-21 50
2bcd521a Steven Rostedt 2008-11-21 51 #ifdef CONFIG_PROFILE_ALL_BRANCHES
2bcd521a Steven Rostedt 2008-11-21 52 /*
2bcd521a Steven Rostedt 2008-11-21 53 * "Define 'is'", Bill Clinton
2bcd521a Steven Rostedt 2008-11-21 54 * "Define 'if'", Steven Rostedt
2bcd521a Steven Rostedt 2008-11-21 55 */
ab3c9c68 Linus Torvalds 2009-04-07 56 #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
ab3c9c68 Linus Torvalds 2009-04-07 57 #define __trace_if(cond) \
b33c8ff4 Arnd Bergmann 2016-02-12 @58 if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
2bcd521a Steven Rostedt 2008-11-21 59 ({ \
2bcd521a Steven Rostedt 2008-11-21 60 int ______r; \
2bcd521a Steven Rostedt 2008-11-21 61 static struct ftrace_branch_data \
e04462fb Miguel Ojeda 2018-09-03 62 __aligned(4) \
e04462fb Miguel Ojeda 2018-09-03 63 __section("_ftrace_branch") \
2bcd521a Steven Rostedt 2008-11-21 64 ______f = { \
2bcd521a Steven Rostedt 2008-11-21 65 .func = __func__, \
2bcd521a Steven Rostedt 2008-11-21 66 .file = __FILE__, \
2bcd521a Steven Rostedt 2008-11-21 67 .line = __LINE__, \
2bcd521a Steven Rostedt 2008-11-21 68 }; \
2bcd521a Steven Rostedt 2008-11-21 69 ______r = !!(cond); \
97e7e4f3 Witold Baryluk 2009-03-17 70 ______f.miss_hit[______r]++; \
2bcd521a Steven Rostedt 2008-11-21 71 ______r; \
2bcd521a Steven Rostedt 2008-11-21 72 }))
2bcd521a Steven Rostedt 2008-11-21 73 #endif /* CONFIG_PROFILE_ALL_BRANCHES */2bcd521a Steven Rostedt 2008-11-21 74
:::::: The code at line 58 was first introduced by commit
:::::: b33c8ff4431a343561e2319f17c14286f2aa52e2 tracing: Fix freak link error caused by branch tracer
:::::: TO: Arnd Bergmann <[email protected]>
:::::: CC: Steven Rostedt <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [v2,1/3] drm/i915/vbt: Parse and use the new field with PSR2 TP2/3 wakeup time
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [v2,1/3] drm/i915/vbt: Parse and use the new field with PSR2 TP2/3 wakeup time
URL : https://patchwork.freedesktop.org/series/57614/
State : failure
== Summary ==
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/intel_psr.odrivers/gpu/drm/i915/intel_psr.c: In function ‘psr1_tps_regs_val_get’:drivers/gpu/drm/i915/intel_psr.c:448:2: error: expected ‘;’ before ‘if’
if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0)
^~scripts/Makefile.build:276: recipe for target 'drivers/gpu/drm/i915/intel_psr.o' failed make[4]: *** [drivers/gpu/drm/i915/intel_psr.o] Error 1 scripts/Makefile.build:492: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2scripts/Makefile.build:492: recipe for target 'drivers/gpu/drm' failed make[2]: *** [drivers/gpu/drm] Error 2scripts/Makefile.build:492: recipe for target 'drivers/gpu' failed make[1]: *** [drivers/gpu] Error 2
Makefile:1043: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx