drm/i915/pps: Decouple pps delays from VBT struct definition
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 6 Nov 2024 21:58:53 +0000 (23:58 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 Nov 2024 16:00:48 +0000 (18:00 +0200)
We currently lack a proper struct definition for the VBT power
squencing delays, and instead we use the same struct definition
(in intel_bios.h) for both the VBT layout and our driver side
state. Decouple those two things by moving the current struct
into intel_vbt_defs.h and adding a new one for the driver's use.

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

index a4cdd82c4a7541fcbcbf303047d34cc534e4b6bf..31398de08e7ff7bee596e79b95cbf0c43475a097 100644 (file)
@@ -1402,12 +1402,21 @@ parse_power_conservation_features(struct intel_display *display,
                                            panel_type);
 }
 
+static void vbt_edp_to_pps_delays(struct intel_pps_delays *pps,
+                                 const struct edp_power_seq *edp_pps)
+{
+       pps->t1_t3 = edp_pps->t1_t3;
+       pps->t8 = edp_pps->t8;
+       pps->t9 = edp_pps->t9;
+       pps->t10 = edp_pps->t10;
+       pps->t11_t12 = edp_pps->t11_t12;
+}
+
 static void
 parse_edp(struct intel_display *display,
          struct intel_panel *panel)
 {
        const struct bdb_edp *edp;
-       const struct edp_power_seq *edp_pps;
        const struct edp_fast_link_params *edp_link_params;
        int panel_type = panel->vbt.panel_type;
 
@@ -1428,10 +1437,10 @@ parse_edp(struct intel_display *display,
        }
 
        /* Get the eDP sequencing and link info */
-       edp_pps = &edp->power_seqs[panel_type];
        edp_link_params = &edp->fast_link_params[panel_type];
 
-       panel->vbt.edp.pps = *edp_pps;
+       vbt_edp_to_pps_delays(&panel->vbt.edp.pps,
+                             &edp->power_seqs[panel_type]);
 
        if (display->vbt.version >= 224) {
                panel->vbt.edp.rate =
index 8b703f6cfe17e28073d69118949f3fc8984762a8..f9841f0498c63421fb2537c53f2e2000366aef73 100644 (file)
@@ -50,14 +50,6 @@ enum intel_backlight_type {
        INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE,
 };
 
-struct edp_power_seq {
-       u16 t1_t3;
-       u16 t8;
-       u16 t9;
-       u16 t10;
-       u16 t11_t12;
-} __packed;
-
 /*
  * MIPI Sequence Block definitions
  *
index d7ce8f01645b5195809312a97c160fbfc7fb8b46..31c30ad90900d716ac9c7bb500cff994cfb6df66 100644 (file)
@@ -301,6 +301,15 @@ struct intel_panel_bl_funcs {
        u32 (*hz_to_pwm)(struct intel_connector *connector, u32 hz);
 };
 
+/* in 100us units */
+struct intel_pps_delays {
+       u16 t1_t3;
+       u16 t8;
+       u16 t9;
+       u16 t10;
+       u16 t11_t12;
+};
+
 enum drrs_type {
        DRRS_TYPE_NONE,
        DRRS_TYPE_STATIC,
@@ -328,7 +337,7 @@ struct intel_vbt_panel_data {
                int preemphasis;
                int vswing;
                int bpp;
-               struct edp_power_seq pps;
+               struct intel_pps_delays pps;
                u8 drrs_msa_timing_delay;
                bool low_vswing;
                bool hobl;
@@ -1570,8 +1579,8 @@ struct intel_pps {
         * requiring a reinitialization. Only relevant on BXT+.
         */
        bool bxt_pps_reset;
-       struct edp_power_seq pps_delays;
-       struct edp_power_seq bios_pps_delays;
+       struct intel_pps_delays pps_delays;
+       struct intel_pps_delays bios_pps_delays;
 };
 
 struct intel_psr {
index 04a7acd7f73ccab635edf8bca2f419e404957f5d..7daa8a95dc704eb9d93cab122fed28c57eebfe7b 100644 (file)
@@ -6,7 +6,6 @@
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "i915_trace.h"
-#include "intel_bios.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
 #include "intel_dp.h"
index 83d65105f32b5d60bac308120316b730e255e810..c57b9aca5a31ba44389a0fb36d551b985eaeb5cd 100644 (file)
@@ -1387,7 +1387,7 @@ static void pps_init_timestamps(struct intel_dp *intel_dp)
 }
 
 static void
-intel_pps_readout_hw_state(struct intel_dp *intel_dp, struct edp_power_seq *seq)
+intel_pps_readout_hw_state(struct intel_dp *intel_dp, struct intel_pps_delays *seq)
 {
        struct intel_display *display = to_intel_display(intel_dp);
        u32 pp_on, pp_off, pp_ctl, power_cycle_delay;
@@ -1426,7 +1426,7 @@ intel_pps_readout_hw_state(struct intel_dp *intel_dp, struct edp_power_seq *seq)
 
 static void
 intel_pps_dump_state(struct intel_dp *intel_dp, const char *state_name,
-                    const struct edp_power_seq *seq)
+                    const struct intel_pps_delays *seq)
 {
        struct intel_display *display = to_intel_display(intel_dp);
 
@@ -1440,8 +1440,8 @@ static void
 intel_pps_verify_state(struct intel_dp *intel_dp)
 {
        struct intel_display *display = to_intel_display(intel_dp);
-       struct edp_power_seq hw;
-       struct edp_power_seq *sw = &intel_dp->pps.pps_delays;
+       struct intel_pps_delays hw;
+       struct intel_pps_delays *sw = &intel_dp->pps.pps_delays;
 
        intel_pps_readout_hw_state(intel_dp, &hw);
 
@@ -1453,14 +1453,14 @@ intel_pps_verify_state(struct intel_dp *intel_dp)
        }
 }
 
-static bool pps_delays_valid(struct edp_power_seq *delays)
+static bool pps_delays_valid(struct intel_pps_delays *delays)
 {
        return delays->t1_t3 || delays->t8 || delays->t9 ||
                delays->t10 || delays->t11_t12;
 }
 
 static void pps_init_delays_bios(struct intel_dp *intel_dp,
-                                struct edp_power_seq *bios)
+                                struct intel_pps_delays *bios)
 {
        struct intel_display *display = to_intel_display(intel_dp);
 
@@ -1475,7 +1475,7 @@ static void pps_init_delays_bios(struct intel_dp *intel_dp,
 }
 
 static void pps_init_delays_vbt(struct intel_dp *intel_dp,
-                               struct edp_power_seq *vbt)
+                               struct intel_pps_delays *vbt)
 {
        struct intel_display *display = to_intel_display(intel_dp);
        struct intel_connector *connector = intel_dp->attached_connector;
@@ -1501,7 +1501,7 @@ static void pps_init_delays_vbt(struct intel_dp *intel_dp,
 }
 
 static void pps_init_delays_spec(struct intel_dp *intel_dp,
-                                struct edp_power_seq *spec)
+                                struct intel_pps_delays *spec)
 {
        struct intel_display *display = to_intel_display(intel_dp);
 
@@ -1521,7 +1521,7 @@ static void pps_init_delays_spec(struct intel_dp *intel_dp,
 static void pps_init_delays(struct intel_dp *intel_dp)
 {
        struct intel_display *display = to_intel_display(intel_dp);
-       struct edp_power_seq cur, vbt, spec,
+       struct intel_pps_delays cur, vbt, spec,
                *final = &intel_dp->pps.pps_delays;
 
        lockdep_assert_held(&display->pps.mutex);
@@ -1589,7 +1589,7 @@ static void pps_init_registers(struct intel_dp *intel_dp, bool force_disable_vdd
        int div = DISPLAY_RUNTIME_INFO(display)->rawclk_freq / 1000;
        struct pps_registers regs;
        enum port port = dp_to_dig_port(intel_dp)->base.port;
-       const struct edp_power_seq *seq = &intel_dp->pps.pps_delays;
+       const struct intel_pps_delays *seq = &intel_dp->pps.pps_delays;
 
        lockdep_assert_held(&display->pps.mutex);
 
index 42022756bbd59e2db58ea360f4b173ced2ecaee0..e9b809568cd42a36ab24f8fbea8aa915e3139dac 100644 (file)
@@ -1014,6 +1014,14 @@ struct bdb_tv_options {
  * Block 27 - eDP VBT Block
  */
 
+struct edp_power_seq {
+       u16 t1_t3;
+       u16 t8;
+       u16 t9;
+       u16 t10;
+       u16 t11_t12;
+} __packed;
+
 #define EDP_18BPP      0
 #define EDP_24BPP      1
 #define EDP_30BPP      2