Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Add psr_safest_params

This parameter is meant to be used when PSR issues are found as some
issues in the past was due wrong values set in VBT so this would be
a quick and easy way to ask users or for us to check if the issue is
due VBT values.

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200520212756.354623-1-jose.souza@intel.com

+35 -10
+29 -10
drivers/gpu/drm/i915/display/intel_psr.c
··· 426 426 if (INTEL_GEN(dev_priv) >= 11) 427 427 val |= EDP_PSR_TP4_TIME_0US; 428 428 429 + if (i915_modparams.psr_safest_params) { 430 + val |= EDP_PSR_TP1_TIME_2500us; 431 + val |= EDP_PSR_TP2_TP3_TIME_2500us; 432 + goto check_tp3_sel; 433 + } 434 + 429 435 if (dev_priv->vbt.psr.tp1_wakeup_time_us == 0) 430 436 val |= EDP_PSR_TP1_TIME_0us; 431 437 else if (dev_priv->vbt.psr.tp1_wakeup_time_us <= 100) ··· 450 444 else 451 445 val |= EDP_PSR_TP2_TP3_TIME_2500us; 452 446 447 + check_tp3_sel: 453 448 if (intel_dp_source_supports_hbr2(intel_dp) && 454 449 drm_dp_tps3_supported(intel_dp->dpcd)) 455 450 val |= EDP_PSR_TP1_TP3_SEL; ··· 502 495 intel_de_write(dev_priv, EDP_PSR_CTL(dev_priv->psr.transcoder), val); 503 496 } 504 497 498 + static u32 intel_psr2_get_tp_time(struct intel_dp *intel_dp) 499 + { 500 + struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); 501 + u32 val = 0; 502 + 503 + if (i915_modparams.psr_safest_params) 504 + return EDP_PSR2_TP2_TIME_2500us; 505 + 506 + if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us >= 0 && 507 + dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 50) 508 + val |= EDP_PSR2_TP2_TIME_50us; 509 + else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 100) 510 + val |= EDP_PSR2_TP2_TIME_100us; 511 + else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 500) 512 + val |= EDP_PSR2_TP2_TIME_500us; 513 + else 514 + val |= EDP_PSR2_TP2_TIME_2500us; 515 + 516 + return val; 517 + } 518 + 505 519 static void hsw_activate_psr2(struct intel_dp *intel_dp) 506 520 { 507 521 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); ··· 535 507 val |= EDP_Y_COORDINATE_ENABLE; 536 508 537 509 val |= EDP_PSR2_FRAME_BEFORE_SU(dev_priv->psr.sink_sync_latency + 1); 538 - 539 - if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us >= 0 && 540 - dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 50) 541 - val |= EDP_PSR2_TP2_TIME_50us; 542 - else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 100) 543 - val |= EDP_PSR2_TP2_TIME_100us; 544 - else if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us <= 500) 545 - val |= EDP_PSR2_TP2_TIME_500us; 546 - else 547 - val |= EDP_PSR2_TP2_TIME_2500us; 510 + val |= intel_psr2_get_tp_time(intel_dp); 548 511 549 512 /* 550 513 * PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and BSpec is
+5
drivers/gpu/drm/i915/i915_params.c
··· 97 97 "(0=disabled, 1=enabled) " 98 98 "Default: -1 (use per-chip default)"); 99 99 100 + i915_param_named(psr_safest_params, bool, 0400, 101 + "Replace PSR VBT parameters by the safest and not optimal ones. This " 102 + "is helpfull to detect if PSR issues are related to bad values set in " 103 + " VBT. (0=use VBT paramters, 1=use safest parameters)"); 104 + 100 105 i915_param_named_unsafe(force_probe, charp, 0400, 101 106 "Force probe the driver for specified devices. " 102 107 "See CONFIG_DRM_I915_FORCE_PROBE for details.");
+1
drivers/gpu/drm/i915/i915_params.h
··· 53 53 param(int, enable_dc, -1, 0400) \ 54 54 param(int, enable_fbc, -1, 0600) \ 55 55 param(int, enable_psr, -1, 0600) \ 56 + param(bool, psr_safest_params, false, 0600) \ 56 57 param(int, disable_power_well, -1, 0400) \ 57 58 param(int, enable_ips, 1, 0600) \ 58 59 param(int, invert_brightness, 0, 0600) \