drm/i915/psr: vbt change for psr
Subsystems (2)
PATCH 1/1 drm/i915/psr: vbt change for psr
From: Vathsala Nagaraju <[email protected]>
For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on bdb->version check to change for all the platforms.
There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to kbl and version 209+ to unblock google.
Tested on skl(bdb version 203,without options) and kabylake(bdb version 209,212) having new options.
bspec 20131
v2: (Jani and Rodrigo)
move the 165 version check to intel_bios.c
v3: Jani
Move the abstraction to intel_bios.
v4: Jani
Rename tp*_wakeup_time to have "us" suffix.
For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us.
--- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++---- drivers/gpu/drm/i915/intel_bios.c | 45 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_psr.c | 38 ++++++++++++++++----------------- 4 files changed, 68 insertions(+), 27 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -1077,8 +1077,8 @@ struct intel_vbt_data {bool require_aux_wakeup;int idle_frames;enum psr_lines_to_wait lines_to_wait; -int tp1_wakeup_time; -int tp2_tp3_wakeup_time; +int tp1_wakeup_time_us; +int tp2_tp3_wakeup_time_us; } psr;struct {
drivers/gpu/drm/i915/i915_reg.h +4 -4
@@ -4084,10 +4084,10 @@ enum {#define EDP_Y_COORDINATE_ENABLE (1<<25)/* GLK and CNL+ */ #define EDP_MAX_SU_DISABLE_TIME (t) ((t)<<20)#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f<<20) -#define EDP_PSR2_TP2_TIME_500 (0<<8) -#define EDP_PSR2_TP2_TIME_100 (1<<8) -#define EDP_PSR2_TP2_TIME_2500 (2<<8) -#define EDP_PSR2_TP2_TIME_50 (3<<8) +#define EDP_PSR2_TP2_TIME_500us (0<<8) +#define EDP_PSR2_TP2_TIME_100us (1<<8) +#define EDP_PSR2_TP2_TIME_2500us (2<<8) +#define EDP_PSR2_TP2_TIME_50us (3<<8)#define EDP_PSR2_TP2_TIME_MASK (3<<8)#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf<<4)
drivers/gpu/drm/i915/intel_bios.c +43 -2
51 lines not on this page · raw message
drivers/gpu/drm/i915/intel_psr.c +19 -19
@@ -461,23 +461,23 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)if (dev_priv->psr.link_standby) val |=EDP_PSR_LINK_STANDBY ; -if (dev_priv->vbt.psr.tp1_wakeup_time >5 ) - val |= EDP_PSR_TP1_TIME_2500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >1 ) - val |= EDP_PSR_TP1_TIME_500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >0 ) +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 ) val |= EDP_PSR_TP1_TIME_100us; +else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=500 ) + val |= EDP_PSR_TP1_TIME_500us;else - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_2500us; -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |= EDP_PSR_TP2_TP3_TIME_2500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |= EDP_PSR_TP2_TP3_TIME_500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=0 ) + 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 ) + val |= EDP_PSR_TP2_TP3_TIME_500us;else - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_2500us;if (intel_dp_source_supports_hbr2 (intel_dp) &&drm_dp_tps3_supported (intel_dp->dpcd))
@@ -513,14 +513,14 @@ 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 >5 ) - val |=EDP_PSR2_TP2_TIME_2500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |=EDP_PSR2_TP2_TIME_500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) - val |=EDP_PSR2_TP2_TIME_100 ; +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) + val |= EDP_PSR2_TP2_TIME_50us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) + val |= EDP_PSR2_TP2_TIME_100us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) + val |= EDP_PSR2_TP2_TIME_500us;else - val |=EDP_PSR2_TP2_TIME_50 ; + val |= EDP_PSR2_TP2_TIME_2500us;I915_WRITE (EDP_PSR2_CTL , val); }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915/psr: vbt change for psr (rev4)
== Series Details ==
== Series Details ==
Series: drm/i915/psr: vbt change for psr (rev4)
URL : https://patchwork.freedesktop.org/series/41289/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
3650bcd5ccb9 drm/i915/psr: vbt change for psr
-:63: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#63: FILE: drivers/gpu/drm/i915/i915_reg.h:4087:
+#define EDP_PSR2_TP2_TIME_500us (0<<8)
^-:64: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #64: FILE: drivers/gpu/drm/i915/i915_reg.h:4088:
+#define EDP_PSR2_TP2_TIME_100us (1<<8)
^
-:65: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #65: FILE: drivers/gpu/drm/i915/i915_reg.h:4089:
+#define EDP_PSR2_TP2_TIME_2500us (2<<8)
^
-:66: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #66: FILE: drivers/gpu/drm/i915/i915_reg.h:4090:
+#define EDP_PSR2_TP2_TIME_50us (3<<8)
^
total: 0 errors, 0 warnings, 4 checks, 131 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/psr: vbt change for psr (rev4)
In reply to vathsala nagaraju== Series Details ==
== Series Details ==
Series: drm/i915/psr: vbt change for psr (rev4)
URL : https://patchwork.freedesktop.org/series/41289/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4121 -> Patchwork_8870 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8870 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8870, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41289/revisions/4/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8870:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_gttfill@basic:
fi-pnv-d510: PASS -> SKIP== Known issues ==
Here are the changes found in Patchwork_8870 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-glk-j4005: PASS -> FAIL (fdo#100368)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-cnl-y3: PASS -> DMESG-WARN (fdo#104951)
==== Possible fixes ====
igt@gem_mmap_gtt@basic-small-bo-tiledx:
fi-gdg-551: FAIL (fdo#102575) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
== Participating hosts (40 -> 37) ==
Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4121 -> Patchwork_8870
CI_DRM_4121: d4f7520d80ab83ea9053ee080df09a23463b6966 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4456: 43761534c6482dc67b9c3d8eeecd425ef40b3c4c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8870: 3650bcd5ccb9c37d1a01c6791448b0e169925e74 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4456: 30b992bdc047073e1fe99b1ac622f026618a8081 @ git://anongit.freedesktop.org/piglit
== Linux commits ==
3650bcd5ccb9 drm/i915/psr: vbt change for psr
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8870/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/psr: vbt change for psr (rev4)
In reply to vathsala nagaraju== Series Details ==
== Series Details ==
Series: drm/i915/psr: vbt change for psr (rev4)
URL : https://patchwork.freedesktop.org/series/41289/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4121_full -> Patchwork_8870_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8870_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8870_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41289/revisions/4/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8870_full:
=== IGT changes ===
==== Warnings ====
igt@pm_rc6_residency@rc6-accuracy:
shard-snb: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_8870_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_cursor_crc@cursor-128x128-suspend:
shard-apl: PASS -> FAIL (fdo#103375)
igt@kms_flip@2x-dpms-vs-vblank-race:
shard-hsw: PASS -> FAIL (fdo#103060)
igt@kms_flip@flip-vs-expired-vblank:
shard-glk: PASS -> FAIL (fdo#102887, fdo#105363)
igt@kms_rotation_crc@primary-rotation-270:
shard-apl: PASS -> DMESG-WARN (fdo#105127)
==== Possible fixes ====
igt@kms_flip@2x-plain-flip-ts-check:
shard-hsw: FAIL (fdo#100368) -> PASS +1
igt@kms_flip@modeset-vs-vblank-race:
shard-glk: FAIL (fdo#103060) -> PASS
igt@kms_flip@plain-flip-ts-check-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-cpu:
shard-apl: FAIL (fdo#103167) -> PASS
igt@perf@blocking:
shard-hsw: FAIL (fdo#102252) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#105127 https://bugs.freedesktop.org/show_bug.cgi?id=105127
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
== Participating hosts (7 -> 6) ==
Missing (1): shard-kbl
== Build changes ==
* Linux: CI_DRM_4121 -> Patchwork_8870
CI_DRM_4121: d4f7520d80ab83ea9053ee080df09a23463b6966 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4456: 43761534c6482dc67b9c3d8eeecd425ef40b3c4c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8870: 3650bcd5ccb9c37d1a01c6791448b0e169925e74 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4456: 30b992bdc047073e1fe99b1ac622f026618a8081 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8870/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi
maintainerQuoted 77 lines · vathsala nagaraju
From: Vathsala Nagaraju <[email protected]>
For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on
bdb->versioncheck to change for all the platforms.There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to kbl and version 209+ to unblock google.
Tested on
skl(bdb version 203,without options)andkabylake(bdb version 209,212)having new options.bspec 20131
v2: (Jani and Rodrigo)
move the 165 version check tointel_bios.c
v3: Jani
Move the abstraction tointel_bios.
v4: Jani
Rename tp*_wakeup_time to have "us" suffix.
For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us.Cc Rodrigo Vivi <[email protected]>CC Puthikorn Voravootivat <[email protected]>Signed-off-by Maulik V Vaghela <[email protected]>Signed-off-by Vathsala Nagaraju <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++---- drivers/gpu/drm/i915/intel_bios.c | 45 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_psr.c | 38 ++++++++++++++++----------------- 4 files changed, 68 insertions(+), 27 deletions(-)drivers/gpu/drm/i915/i915_drv.h +2
-2@@ -1077,8 +1077,8 @@ struct intel_vbt_data {bool require_aux_wakeup;int idle_frames;enum psr_lines_to_wait lines_to_wait; -int tp1_wakeup_time; -int tp2_tp3_wakeup_time; +int tp1_wakeup_time_us; +int tp2_tp3_wakeup_time_us; } psr;struct {drivers/gpu/drm/i915/i915_reg.h +4
-4@@ -4084,10 +4084,10 @@ enum {#define EDP_Y_COORDINATE_ENABLE (1<<25)/* GLK and CNL+ */ #define EDP_MAX_SU_DISABLE_TIME (t) ((t)<<20)#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f<<20) -#define EDP_PSR2_TP2_TIME_500 (0<<8) -#define EDP_PSR2_TP2_TIME_100 (1<<8) -#define EDP_PSR2_TP2_TIME_2500 (2<<8) -#define EDP_PSR2_TP2_TIME_50 (3<<8) +#define EDP_PSR2_TP2_TIME_500us (0<<8) +#define EDP_PSR2_TP2_TIME_100us (1<<8) +#define EDP_PSR2_TP2_TIME_2500us (2<<8) +#define EDP_PSR2_TP2_TIME_50us (3<<8)#define EDP_PSR2_TP2_TIME_MASK (3<<8)#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf<<4)drivers/gpu/drm/i915/intel_bios.c +0
-0
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 692
Quoted 8 lines
drivers/gpu/drm/i915/intel_bios.c +3
-2@@ -687,8 +687,49 @@ static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv,break ; } - dev_priv->vbt.psr.tp1_wakeup_time = psr_table->tp1_wakeup_time; - dev_priv->vbt.psr.tp2_tp3_wakeup_time = psr_table->tp2_tp3_wakeup_time; +/* new psr options 0=500us, 1=100us, 2=2500us, 3=0us +* Old decimal value is wake up time in multiples of 100 us. +*/
Please follow this style with first empty line:
/*
* Text here
*/
Start with capital N on New.
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 693
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+if (bdb->version >=209 &&IS_KABYLAKE (dev_priv)) {
Why are we filtering per platform?
What about Coffelake? And Geminilake? And Cannonlake? and on?
Btw, where is this spec? I just checked predator and it still only contains the old multiple of 100 one... :(
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 704
Quoted 11 lines
drivers/gpu/drm/i915/intel_bios.c +11
-0+switch (psr_table->tp1_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp1_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp1_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 :
this out of order case is not good imho...
confusing... but well... 0 -> 2500 -> 100 -> 500 is already confusing by itself honestly...
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 705
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+default :
why default is 2? higher?
I always thought this awkward order was to make the 0 the default with 500 or at least I was trying to make some sense on that order :/
Quoted 99 lines
drivers/gpu/drm/i915/intel_bios.c +27
-0+if (psr_table->tp1_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp1 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp1_wakeup_time_us =2500 ; +break ; + } + +switch (psr_table->tp2_tp3_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 : +default : +if (psr_table->tp2_tp3_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp2_tp3 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =2500 ; +break ; + } + }else { + 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 ; + } } static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_psr.c +19
-19@@ -461,23 +461,23 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)if (dev_priv->psr.link_standby) val |=EDP_PSR_LINK_STANDBY ; -if (dev_priv->vbt.psr.tp1_wakeup_time >5 ) - val |= EDP_PSR_TP1_TIME_2500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >1 ) - val |= EDP_PSR_TP1_TIME_500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >0 ) +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 ) val |= EDP_PSR_TP1_TIME_100us; +else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=500 ) + val |= EDP_PSR_TP1_TIME_500us;else - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_2500us; -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |= EDP_PSR_TP2_TP3_TIME_2500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |= EDP_PSR_TP2_TP3_TIME_500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=0 ) + 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 ) + val |= EDP_PSR_TP2_TP3_TIME_500us;else - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_2500us;if (intel_dp_source_supports_hbr2 (intel_dp) &&drm_dp_tps3_supported (intel_dp->dpcd))@@ -513,14 +513,14 @@ 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 >5 ) - val |=EDP_PSR2_TP2_TIME_2500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |=EDP_PSR2_TP2_TIME_500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) - val |=EDP_PSR2_TP2_TIME_100 ; +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) + val |= EDP_PSR2_TP2_TIME_50us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) + val |= EDP_PSR2_TP2_TIME_100us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) + val |= EDP_PSR2_TP2_TIME_500us;else - val |=EDP_PSR2_TP2_TIME_50 ; + val |= EDP_PSR2_TP2_TIME_2500us;I915_WRITE (EDP_PSR2_CTL , val); }Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 88 lines · Rodrigo Vivi
Quoted 77 lines · vathsala nagaraju
From: Vathsala Nagaraju <[email protected]>
For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on
bdb->versioncheck to change for all the platforms.There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to kbl and version 209+ to unblock google.
Tested on
skl(bdb version 203,without options)andkabylake(bdb version 209,212)having new options.bspec 20131
v2: (Jani and Rodrigo)
move the 165 version check tointel_bios.c
v3: Jani
Move the abstraction tointel_bios.
v4: Jani
Rename tp*_wakeup_time to have "us" suffix.
For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us.Cc Rodrigo Vivi <[email protected]>CC Puthikorn Voravootivat <[email protected]>Signed-off-by Maulik V Vaghela <[email protected]>Signed-off-by Vathsala Nagaraju <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++---- drivers/gpu/drm/i915/intel_bios.c | 45 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_psr.c | 38 ++++++++++++++++----------------- 4 files changed, 68 insertions(+), 27 deletions(-)drivers/gpu/drm/i915/i915_drv.h +2
-2@@ -1077,8 +1077,8 @@ struct intel_vbt_data {bool require_aux_wakeup;int idle_frames;enum psr_lines_to_wait lines_to_wait; -int tp1_wakeup_time; -int tp2_tp3_wakeup_time; +int tp1_wakeup_time_us; +int tp2_tp3_wakeup_time_us; } psr;struct {drivers/gpu/drm/i915/i915_reg.h +4
-4@@ -4084,10 +4084,10 @@ enum {#define EDP_Y_COORDINATE_ENABLE (1<<25)/* GLK and CNL+ */ #define EDP_MAX_SU_DISABLE_TIME (t) ((t)<<20)#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f<<20) -#define EDP_PSR2_TP2_TIME_500 (0<<8) -#define EDP_PSR2_TP2_TIME_100 (1<<8) -#define EDP_PSR2_TP2_TIME_2500 (2<<8) -#define EDP_PSR2_TP2_TIME_50 (3<<8) +#define EDP_PSR2_TP2_TIME_500us (0<<8) +#define EDP_PSR2_TP2_TIME_100us (1<<8) +#define EDP_PSR2_TP2_TIME_2500us (2<<8) +#define EDP_PSR2_TP2_TIME_50us (3<<8)#define EDP_PSR2_TP2_TIME_MASK (3<<8)#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf<<4)drivers/gpu/drm/i915/intel_bios.c +0
-0drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 692
Quoted 8 lines
drivers/gpu/drm/i915/intel_bios.c +3
-2@@ -687,8 +687,49 @@ static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv,break ; } - dev_priv->vbt.psr.tp1_wakeup_time = psr_table->tp1_wakeup_time; - dev_priv->vbt.psr.tp2_tp3_wakeup_time = psr_table->tp2_tp3_wakeup_time; +/* new psr options 0=500us, 1=100us, 2=2500us, 3=0us +* Old decimal value is wake up time in multiples of 100 us. +*/ Please follow this style with first empty line:
Quoted 5 lines
/*
* Text here
*/Start with capital N on New.
Thanks, will make the changes.
Quoted 3 lines
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 693
Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +1
-0+if (bdb->version >=209 &&IS_KABYLAKE (dev_priv)) {Why are we filtering per platform?
What about Coffelake? And Geminilake? And Cannonlake? and on?
Once GOP team confirms the exact versions for other platforms, we will add them. Please check my commit message.
Quoted 3 lines
Btw, where is this spec? I just checked predator and it still only contains the old multiple of 100 one... :(
please check bspec 20131
Quoted 16 lines
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 704
Quoted 12 lines
drivers/gpu/drm/i915/intel_bios.c +11
-0+switch (psr_table->tp1_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp1_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp1_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 :this out of order case is not good imho...
confusing... but well... 0 -> 2500 -> 100 -> 500 is already confusing by itself honestly...
Quoted 4 lines
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 705
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+default :why default is 2? higher?
I always thought this awkward order was to make the 0 the default with 500 or at least I was trying to make some sense on that order :/
Jani suggested for 2500 for anything out of range [0-3]. Please check the thread https://patchwork.freedesktop.org/patch/217851/ , last message from Jani. Since 2=2500 and outside range = 2500, I have ordered it that way in the code.
Quoted 96 lines
Quoted 96 lines
drivers/gpu/drm/i915/intel_bios.c +27
-0+if (psr_table->tp1_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp1 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp1_wakeup_time_us =2500 ; +break ; + } + +switch (psr_table->tp2_tp3_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 : +default : +if (psr_table->tp2_tp3_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp2_tp3 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =2500 ; +break ; + } + }else { + 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 ; + } } static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_psr.c +19
-19@@ -461,23 +461,23 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)if (dev_priv->psr.link_standby) val |=EDP_PSR_LINK_STANDBY ; -if (dev_priv->vbt.psr.tp1_wakeup_time >5 ) - val |= EDP_PSR_TP1_TIME_2500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >1 ) - val |= EDP_PSR_TP1_TIME_500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >0 ) +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 ) val |= EDP_PSR_TP1_TIME_100us; +else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=500 ) + val |= EDP_PSR_TP1_TIME_500us;else - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_2500us; -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |= EDP_PSR_TP2_TP3_TIME_2500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |= EDP_PSR_TP2_TP3_TIME_500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=0 ) + 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 ) + val |= EDP_PSR_TP2_TP3_TIME_500us;else - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_2500us;if (intel_dp_source_supports_hbr2 (intel_dp) &&drm_dp_tps3_supported (intel_dp->dpcd))@@ -513,14 +513,14 @@ 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 >5 ) - val |=EDP_PSR2_TP2_TIME_2500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |=EDP_PSR2_TP2_TIME_500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) - val |=EDP_PSR2_TP2_TIME_100 ; +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) + val |= EDP_PSR2_TP2_TIME_50us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) + val |= EDP_PSR2_TP2_TIME_100us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) + val |= EDP_PSR2_TP2_TIME_500us;else - val |=EDP_PSR2_TP2_TIME_50 ; + val |= EDP_PSR2_TP2_TIME_2500us;I915_WRITE (EDP_PSR2_CTL , val); }Signature · 1 line
1.9.1
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 93 lines · Rodrigo Vivi
Quoted 77 lines · vathsala nagaraju
From: Vathsala Nagaraju <[email protected]>
For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on
bdb->versioncheck to change for all the platforms.There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to kbl and version 209+ to unblock google.
Tested on
skl(bdb version 203,without options)andkabylake(bdb version 209,212)having new options.bspec 20131
v2: (Jani and Rodrigo)
move the 165 version check tointel_bios.c
v3: Jani
Move the abstraction tointel_bios.
v4: Jani
Rename tp*_wakeup_time to have "us" suffix.
For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us.Cc Rodrigo Vivi <[email protected]>CC Puthikorn Voravootivat <[email protected]>Signed-off-by Maulik V Vaghela <[email protected]>Signed-off-by Vathsala Nagaraju <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++---- drivers/gpu/drm/i915/intel_bios.c | 45 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_psr.c | 38 ++++++++++++++++----------------- 4 files changed, 68 insertions(+), 27 deletions(-)drivers/gpu/drm/i915/i915_drv.h +2
-2@@ -1077,8 +1077,8 @@ struct intel_vbt_data {bool require_aux_wakeup;int idle_frames;enum psr_lines_to_wait lines_to_wait; -int tp1_wakeup_time; -int tp2_tp3_wakeup_time; +int tp1_wakeup_time_us; +int tp2_tp3_wakeup_time_us; } psr;struct {drivers/gpu/drm/i915/i915_reg.h +4
-4@@ -4084,10 +4084,10 @@ enum {#define EDP_Y_COORDINATE_ENABLE (1<<25)/* GLK and CNL+ */ #define EDP_MAX_SU_DISABLE_TIME (t) ((t)<<20)#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f<<20) -#define EDP_PSR2_TP2_TIME_500 (0<<8) -#define EDP_PSR2_TP2_TIME_100 (1<<8) -#define EDP_PSR2_TP2_TIME_2500 (2<<8) -#define EDP_PSR2_TP2_TIME_50 (3<<8) +#define EDP_PSR2_TP2_TIME_500us (0<<8) +#define EDP_PSR2_TP2_TIME_100us (1<<8) +#define EDP_PSR2_TP2_TIME_2500us (2<<8) +#define EDP_PSR2_TP2_TIME_50us (3<<8)#define EDP_PSR2_TP2_TIME_MASK (3<<8)#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf<<4)drivers/gpu/drm/i915/intel_bios.c +0
-0drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 692
Quoted 8 lines
drivers/gpu/drm/i915/intel_bios.c +3
-2@@ -687,8 +687,49 @@ static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv,break ; } - dev_priv->vbt.psr.tp1_wakeup_time = psr_table->tp1_wakeup_time; - dev_priv->vbt.psr.tp2_tp3_wakeup_time = psr_table->tp2_tp3_wakeup_time; +/* new psr options 0=500us, 1=100us, 2=2500us, 3=0us +* Old decimal value is wake up time in multiples of 100 us. +*/ Please follow this style with first empty line:
/*
* Text here
*/
Quoted 6 lines
Start with capital N on New.
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 693
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+if (bdb->version >=209 &&IS_KABYLAKE (dev_priv)) {Why are we filtering per platform?
What about Coffelake? And Geminilake? And Cannonlake? and on?
It's a mess. I hate it, but I guess no can do.
Quoted 20 lines
Btw, where is this spec? I just checked predator and it still only contains the old multiple of 100 one... :(
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 704
Quoted 11 lines
drivers/gpu/drm/i915/intel_bios.c +11
-0+switch (psr_table->tp1_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp1_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp1_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 :this out of order case is not good imho...
confusing... but well... 0 -> 2500 -> 100 -> 500 is already confusing by itself honestly...
Quoted 5 lines
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 705
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+default :why default is 2? higher?
I always thought this awkward order was to make the 0 the default with 500 or at least I was trying to make some sense on that order :/
The spec is silly. IMO they should have stuck to using usecs directly. If the driver has to do a per platform mapping *anyway*, it's better to do it from usecs directly than from some platform specific index values.
Defaulting to longest when out of range is per my instruction. It should handle the cases where the VBT actually has the usecs/100 value but should have the new style. Did I mention this is a mess already?
BR,
Jani.
Quoted 100 lines
Quoted 100 lines
drivers/gpu/drm/i915/intel_bios.c +27
-0+if (psr_table->tp1_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp1 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp1_wakeup_time_us =2500 ; +break ; + } + +switch (psr_table->tp2_tp3_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 : +default : +if (psr_table->tp2_tp3_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp2_tp3 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =2500 ; +break ; + } + }else { + 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 ; + } } static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_psr.c +19
-19@@ -461,23 +461,23 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)if (dev_priv->psr.link_standby) val |=EDP_PSR_LINK_STANDBY ; -if (dev_priv->vbt.psr.tp1_wakeup_time >5 ) - val |= EDP_PSR_TP1_TIME_2500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >1 ) - val |= EDP_PSR_TP1_TIME_500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >0 ) +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 ) val |= EDP_PSR_TP1_TIME_100us; +else if (dev_priv->vbt.psr.tp1_wakeup_time_us <=500 ) + val |= EDP_PSR_TP1_TIME_500us;else - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_2500us; -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |= EDP_PSR_TP2_TP3_TIME_2500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |= EDP_PSR_TP2_TP3_TIME_500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=0 ) + 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 ) + val |= EDP_PSR_TP2_TP3_TIME_500us;else - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_2500us;if (intel_dp_source_supports_hbr2 (intel_dp) &&drm_dp_tps3_supported (intel_dp->dpcd))@@ -513,14 +513,14 @@ 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 >5 ) - val |=EDP_PSR2_TP2_TIME_2500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |=EDP_PSR2_TP2_TIME_500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) - val |=EDP_PSR2_TP2_TIME_100 ; +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) + val |= EDP_PSR2_TP2_TIME_50us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) + val |= EDP_PSR2_TP2_TIME_100us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) + val |= EDP_PSR2_TP2_TIME_500us;else - val |=EDP_PSR2_TP2_TIME_50 ; + val |= EDP_PSR2_TP2_TIME_2500us;I915_WRITE (EDP_PSR2_CTL , val); }Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 89 lines · vathsala nagaraju
From: Vathsala Nagaraju <[email protected]>
For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on
bdb->versioncheck to change for all the platforms.There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to kbl and version 209+ to unblock google.
Tested on
skl(bdb version 203,without options)andkabylake(bdb version 209,212)having new options.bspec 20131
v2: (Jani and Rodrigo)
move the 165 version check tointel_bios.c
v3: Jani
Move the abstraction tointel_bios.
v4: Jani
Rename tp*_wakeup_time to have "us" suffix.
For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us.Cc Rodrigo Vivi <[email protected]>CC Puthikorn Voravootivat <[email protected]>Signed-off-by Maulik V Vaghela <[email protected]>Signed-off-by Vathsala Nagaraju <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++---- drivers/gpu/drm/i915/intel_bios.c | 45 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_psr.c | 38 ++++++++++++++++----------------- 4 files changed, 68 insertions(+), 27 deletions(-)drivers/gpu/drm/i915/i915_drv.h +2
-2@@ -1077,8 +1077,8 @@ struct intel_vbt_data {bool require_aux_wakeup;int idle_frames;enum psr_lines_to_wait lines_to_wait; -int tp1_wakeup_time; -int tp2_tp3_wakeup_time; +int tp1_wakeup_time_us; +int tp2_tp3_wakeup_time_us; } psr;struct {drivers/gpu/drm/i915/i915_reg.h +4
-4@@ -4084,10 +4084,10 @@ enum {#define EDP_Y_COORDINATE_ENABLE (1<<25)/* GLK and CNL+ */ #define EDP_MAX_SU_DISABLE_TIME (t) ((t)<<20)#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f<<20) -#define EDP_PSR2_TP2_TIME_500 (0<<8) -#define EDP_PSR2_TP2_TIME_100 (1<<8) -#define EDP_PSR2_TP2_TIME_2500 (2<<8) -#define EDP_PSR2_TP2_TIME_50 (3<<8) +#define EDP_PSR2_TP2_TIME_500us (0<<8) +#define EDP_PSR2_TP2_TIME_100us (1<<8) +#define EDP_PSR2_TP2_TIME_2500us (2<<8) +#define EDP_PSR2_TP2_TIME_50us (3<<8)#define EDP_PSR2_TP2_TIME_MASK (3<<8)#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf<<4)drivers/gpu/drm/i915/intel_bios.c +7
-2@@ -687,8 +687,49 @@ static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv,break ; } - dev_priv->vbt.psr.tp1_wakeup_time = psr_table->tp1_wakeup_time; - dev_priv->vbt.psr.tp2_tp3_wakeup_time = psr_table->tp2_tp3_wakeup_time; +/* new psr options 0=500us, 1=100us, 2=2500us, 3=0us +* Old decimal value is wake up time in multiples of 100 us. +*/ +if (bdb->version >=209 &&IS_KABYLAKE (dev_priv)) { +switch (psr_table->tp1_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp1_wakeup_time_us =500 ;
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 706
Quoted 10 lines
drivers/gpu/drm/i915/intel_bios.c +10
-0+break ; +case 1 : + dev_priv->vbt.psr.tp1_wakeup_time_us =100 ; +break ; +case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 : +default : +if (psr_table->tp1_wakeup_time !=2 )
You already have the "!= 2" and "== 2" differentiation above. Use it. (Hint: fallthrough.)
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 707
Quoted 1 line
drivers/gpu/drm/i915/intel_bios.c +1
-0+DRM_DEBUG_KMS ("VBT tp1 wakeup time outside range, defaulting to max value 2500us\n" );
If you complain about out of range value, please log the value.
Quoted 11 lines
drivers/gpu/drm/i915/intel_bios.c +11
-0+ dev_priv->vbt.psr.tp1_wakeup_time_us =2500 ; +break ; + } + +switch (psr_table->tp2_tp3_wakeup_time) { +case 0 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =500 ; +break ; +case 1 : + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =100 ; +break ;
drivers/gpu/drm/i915/intel_bios.c static int intel_bios_ssc_frequency(struct drm_i915_private *dev_priv, · line 728
Quoted 10 lines
drivers/gpu/drm/i915/intel_bios.c +10
-0+case 3 : + dev_priv->vbt.psr.tp1_wakeup_time_us =0 ; +break ; +case 2 : +default : +if (psr_table->tp2_tp3_wakeup_time !=2 ) +DRM_DEBUG_KMS ("VBT tp2_tp3 wakeup time outside range, defaulting to max value 2500us\n" ); + dev_priv->vbt.psr.tp2_tp3_wakeup_time_us =2500 ; +break ; + }
That's the same thing copy-pasted twice. If you don't fix it now, I'm pretty sure the next person to stumble on this will send a patch to fix it.
Quoted 12 lines
drivers/gpu/drm/i915/intel_bios.c +4
-0+ }else { + 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 ; + } } static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_psr.c +0
-0
drivers/gpu/drm/i915/intel_psr.c static void hsw_activate_psr1(struct intel_dp *intel_dp) · line 464
Quoted 9 lines
drivers/gpu/drm/i915/intel_psr.c +1
-5@@ -461,23 +461,23 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)if (dev_priv->psr.link_standby) val |=EDP_PSR_LINK_STANDBY ; -if (dev_priv->vbt.psr.tp1_wakeup_time >5 ) - val |= EDP_PSR_TP1_TIME_2500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >1 ) - val |= EDP_PSR_TP1_TIME_500us; -else if (dev_priv->vbt.psr.tp1_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp1_wakeup_time_us <=0 )
== 0. It should never be < 0, and if it is, go for the longest delay.
Quoted 5 lines
drivers/gpu/drm/i915/intel_psr.c +4
-0+ 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) + val |= EDP_PSR_TP1_TIME_500us;
drivers/gpu/drm/i915/intel_psr.c static void hsw_activate_psr1(struct intel_dp *intel_dp) · line 473
Quoted 10 lines
drivers/gpu/drm/i915/intel_psr.c +2
-6else - val |= EDP_PSR_TP1_TIME_0us; + val |= EDP_PSR_TP1_TIME_2500us; -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |= EDP_PSR_TP2_TP3_TIME_2500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |= EDP_PSR_TP2_TP3_TIME_500us; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=0 )
Same here.
Quoted 13 lines
drivers/gpu/drm/i915/intel_psr.c +5
-1+ 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) + val |= EDP_PSR_TP2_TP3_TIME_500us; else - val |= EDP_PSR_TP2_TP3_TIME_0us; + val |= EDP_PSR_TP2_TP3_TIME_2500us;if (intel_dp_source_supports_hbr2 (intel_dp) &&drm_dp_tps3_supported (intel_dp->dpcd))@@ -513,14 +513,14 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
drivers/gpu/drm/i915/intel_psr.c static void hsw_activate_psr2(struct intel_dp *intel_dp) · line 517
Quoted 10 lines
drivers/gpu/drm/i915/intel_psr.c +2
-6val |=EDP_PSR2_FRAME_BEFORE_SU (dev_priv->psr.sink_sync_latency +1 ); -if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >5 ) - val |=EDP_PSR2_TP2_TIME_2500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >1 ) - val |=EDP_PSR2_TP2_TIME_500 ; -else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time >0 ) - val |=EDP_PSR2_TP2_TIME_100 ; +if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=50 ) + val |= EDP_PSR2_TP2_TIME_50us;
So I didn't actually look at bspec now. But the they've got to be kidding me. They first move away from specifying usecs in the bspec, because hardware only supports certain values. And this looks like they didn't take into account the 50 us delay? Really? Ugh.
BR,
Jani.
Quoted 10 lines
drivers/gpu/drm/i915/intel_psr.c +5
-1+else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=100 ) + val |= EDP_PSR2_TP2_TIME_100us; +else if (dev_priv->vbt.psr.tp2_tp3_wakeup_time_us <=500 ) + val |= EDP_PSR2_TP2_TIME_500us;else - val |=EDP_PSR2_TP2_TIME_50 ; + val |= EDP_PSR2_TP2_TIME_2500us;I915_WRITE (EDP_PSR2_CTL , val); }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx