drm/i915/pps: Stash away original BIOS programmed PPS delays
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 10 May 2022 10:42:33 +0000 (13:42 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 May 2022 17:25:43 +0000 (20:25 +0300)
In order to do the panel VBT parsing after the EDID read
(needed to determine panel_type from PNPID) we need to stash
away the original BIOS programmed PPS delays so that we
can consult them again when we reinit the PPS delays after
the VBT parsing has been done.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220510104242.6099-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_pps.c

index cfd042117b109fc4364abcaa06a0686f74a829b4..2e9fe2b93d181047709f16a94d1c6763a88e312f 100644 (file)
@@ -1496,6 +1496,7 @@ struct intel_pps {
         */
        bool pps_reset;
        struct edp_power_seq pps_delays;
+       struct edp_power_seq bios_pps_delays;
 };
 
 struct intel_psr {
index 80f8edb0d36d3eae5e20d746b5b75b3d7d0f011e..f85dbd47eb609a33dd9efc28b3697c7a4c77bbf1 100644 (file)
@@ -1165,16 +1165,19 @@ static bool pps_delays_valid(struct edp_power_seq *delays)
                delays->t10 || delays->t11_t12;
 }
 
-static void pps_init_delays_cur(struct intel_dp *intel_dp,
-                               struct edp_power_seq *cur)
+static void pps_init_delays_bios(struct intel_dp *intel_dp,
+                                struct edp_power_seq *bios)
 {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
 
        lockdep_assert_held(&dev_priv->pps_mutex);
 
-       intel_pps_readout_hw_state(intel_dp, cur);
+       if (!pps_delays_valid(&intel_dp->pps.bios_pps_delays))
+               intel_pps_readout_hw_state(intel_dp, &intel_dp->pps.bios_pps_delays);
 
-       intel_pps_dump_state(intel_dp, "cur", cur);
+       *bios = intel_dp->pps.bios_pps_delays;
+
+       intel_pps_dump_state(intel_dp, "bios", bios);
 }
 
 static void pps_init_delays_vbt(struct intel_dp *intel_dp,
@@ -1242,7 +1245,7 @@ static void pps_init_delays(struct intel_dp *intel_dp)
        if (pps_delays_valid(final))
                return;
 
-       pps_init_delays_cur(intel_dp, &cur);
+       pps_init_delays_bios(intel_dp, &cur);
        pps_init_delays_vbt(intel_dp, &vbt);
        pps_init_delays_spec(intel_dp, &spec);