Skip to contentSkip to conversation

drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier

PATCH Superseded Mika Kahola 4 participants 7 messages Nov 1, 2023

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier

Display driver shall read DPCD 00071h[3:1] during configuration to get PSR setup time. This register provides the setup time requirement on the VSC SDP entry packet. If setup time cannot be met with the current timings
(e.g., PSR setup time + other blanking requirements > blanking time), driver should enable sending VSC SDP one frame earlier before sending the capture frame.

BSpec: 69895 (PSR Entry Setup Frames 17:16)

v2: Write frames before su entry to correct register (Ville, Jouni)
Move frames before su entry calculation to it's own function (Ville, Jouni) Rename PSR Entry Setup Frames register to indicate Lunarlake specificity (Jouni)

---
 .../drm/i915/display/intel_display_types.h    |  1 +
 drivers/gpu/drm/i915/display/intel_psr.c      | 77 ++++++++++++++-----
 drivers/gpu/drm/i915/display/intel_psr_regs.h |  2 +
 3 files changed, 62 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 65ea37fe8cff..a0bcab6f2bec 100644
@@ -1710,6 +1710,7 @@ struct intel_psr {
 	u32 dc3co_exitline;
 	u32 dc3co_exit_delay;
 	struct delayed_work dc3co_work;
+	u8 entry_setup_frames;
 };
 
 struct intel_dp {
drivers/gpu/drm/i915/display/intel_psr.c +59 -18

136 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_psr_regs.h +2 -0
index d39951383c92..efe4306b37e0 100644
@@ -35,6 +35,8 @@
 #define   EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES	REG_FIELD_PREP(EDP_PSR_MIN_LINK_ENTRY_TIME_MASK, 3)
 #define   EDP_PSR_MAX_SLEEP_TIME_MASK		REG_GENMASK(24, 20)
 #define   EDP_PSR_MAX_SLEEP_TIME(x)		REG_FIELD_PREP(EDP_PSR_MAX_SLEEP_TIME_MASK, (x))
+#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK	REG_GENMASK(17, 16)
+#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x)	REG_FIELD_PREP(LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK, (x))
 #define   EDP_PSR_SKIP_AUX_EXIT			REG_BIT(12)
 #define   EDP_PSR_TP_MASK			REG_BIT(11)
 #define   EDP_PSR_TP_TP1_TP2			REG_FIELD_PREP(EDP_PSR_TP_MASK, 0)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 78 lines · Mika Kahola

Display driver shall read DPCD 00071h[3:1] during configuration to get PSR setup time. This register provides the setup time requirement on the VSC SDP entry packet. If setup time cannot be met with the current timings
(e.g., PSR setup time + other blanking requirements > blanking time), driver should enable sending VSC SDP one frame earlier before sending the capture frame.

BSpec: 69895 (PSR Entry Setup Frames 17:16)

v2: Write frames before su entry to correct register (Ville, Jouni) Move frames before su entry calculation to it's own function (Ville, Jouni)
    Rename PSR Entry Setup Frames register to indicate Lunarlake specificity (Jouni)

---
 .../drm/i915/display/intel_display_types.h    |  1 + drivers/gpu/drm/i915/display/intel_psr.c      | 77 ++++++++++++++--- --
 drivers/gpu/drm/i915/display/intel_psr_regs.h |  2 +

 3 files changed, 62 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 65ea37fe8cff..a0bcab6f2bec 100644
@@ -1710,6 +1710,7 @@ struct intel_psr {
         u32 dc3co_exitline;
         u32 dc3co_exit_delay;
         struct delayed_work dc3co_work;
+       u8 entry_setup_frames;
  };


 struct intel_dp {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
index ecd24a0b86cb..c9e6651fb3b2 100644
@@ -592,6 +592,9 @@ static void intel_psr_enable_sink(struct intel_dp
 *intel_dp)
         if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                 dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;


+       if (intel_dp->psr.entry_setup_frames > 0)
+               dpcd_val |= DP_PSR_FRAME_CAPTURE;
+
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -690,6 +693,9 @@ static void hsw_activate_psr1(struct intel_dp
 *intel_dp)
         if (DISPLAY_VER(dev_priv) >= 8)
                 val |= EDP_PSR_CRC_ENABLE;


+       if (DISPLAY_VER(dev_priv) >= 20)
+               val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        intel_de_rmw(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), ~EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK, val); }

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -727,11 +733,27 @@ static int psr2_block_count(struct intel_dp
 *intel_dp)
         return psr2_block_count_lines(intel_dp) / 4;
  }

drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+static u8 get_frames_before_su_entry(struct intel_dp *intel_dp)
+{
+       u8 frames_before_su_entry;
+
+       frames_before_su_entry = max_t(u8,
+                                      intel_dp-
Quoted 1 line

psr.sink_sync_latency + 1,

Quoted 7 lines

+                                      2);
+
+       /* Entry setup frames must be at least 1 less than frames before SU entry */
+       if (intel_dp->psr.entry_setup_frames >= frames_before_su_entry)
+               frames_before_su_entry += 1;

Comment above and the code are not matching. This would match:

frames_before_su_entry = intel_dp->psr.entry_setup_frames + 1;

Quoted 57 lines
drivers/gpu/drm/i915/display/intel_psr.c +4 -0
+
+       return frames_before_su_entry;
+}
+

 static void hsw_activate_psr2(struct intel_dp *intel_dp) {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); enum transcoder cpu_transcoder = intel_dp->psr.transcoder; u32 val = EDP_PSR2_ENABLE;
+       u32 psr_val = 0;

        val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -741,7 +763,8 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)

        if (DISPLAY_VER(dev_priv) >= 10 && DISPLAY_VER(dev_priv) <=
12)
                val |= EDP_Y_COORDINATE_ENABLE;

-       val |= EDP_PSR2_FRAME_BEFORE_SU(max_t(u8, intel_dp-

Quoted 1 line

psr.sink_sync_latency + 1, 2));

+       val |= EDP_PSR2_FRAME_BEFORE_SU(get_frames_before_su_entry(intel_dp)); +
        val |= intel_psr2_get_tp_time(intel_dp);

        if (DISPLAY_VER(dev_priv) >= 12) {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -785,6 +808,9 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
         if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                 val |= EDP_PSR2_SU_SDP_SCANLINE;


+       if (DISPLAY_VER(dev_priv) >= 20)
+               psr_val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        if (intel_dp->psr.psr2_sel_fetch_enabled) { u32 tmp;

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -798,7 +824,7 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
          * PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and BSpec

is
         * recommending keep this bit unset while PSR2 is enabled. */
-       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), 0);
+       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), psr_val);

        intel_de_write(dev_priv, EDP_PSR2_CTL(cpu_transcoder), val); }

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1066,6 +1092,36 @@ static bool _compute_psr2_wake_times(struct
 intel_dp *intel_dp,
         return true;
  }
Quoted 3 lines


+static void intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,

You need to convert this into

static bool intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,
const struct
drm_display_mode *adjusted_mode)

Quoted 12 lines

+                                            const struct drm_display_mode *adjusted_mode)
+{
+       struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); +       int psr_setup_time = drm_dp_psr_setup_time(intel_dp-

Quoted 1 line

psr_dpcd);

drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+
+       intel_dp->psr.entry_setup_frames = 0;
+
+       if (psr_setup_time < 0) {
+               drm_dbg_kms(&dev_priv->drm,
+                           "PSR condition failed: Invalid PSR setup
Quoted 3 lines

time (0x%02x)\n",
+                           intel_dp->psr_dpcd[1]); +               return;

and return false here.

Quoted 10 lines

+       }
+
+       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > +           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay
- 1) {
+               if (DISPLAY_VER(dev_priv) >= 20) {
+                       intel_dp->psr.entry_setup_frames = 1; +                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR setup entry frames: %d\n", +                                   intel_dp-

Quoted 7 lines
Quoted 1 line

psr.entry_setup_frames);

+               } else {
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR condition failed: PSR setup time (%d us) too long\n",
+                                   psr_setup_time);
+               }

and here as well.

Quoted 1 line

+       }

and return true here.

Quoted 31 lines
drivers/gpu/drm/i915/display/intel_psr.c +2 -0
+}
+

 static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state)
 {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1213,7 +1269,6 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
         struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);

        const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
-       int psr_setup_time;

        /*
         * Current PSR panels don't work reliably with VRR enabled

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1242,21 +1297,7 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
                 return;
         }


-       psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd); -       if (psr_setup_time < 0) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: Invalid PSR setup time (0x%02x)\n",
-                           intel_dp->psr_dpcd[1]);
-               return;
-       }
-
-       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > -           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay

Quoted 8 lines

- 1) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: PSR setup time (%d us) too long\n",
-                           psr_setup_time);
-               return;
-       }
+       intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode);

and have:

if (!intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode))

	return;

BR,

Jouni Högander

Quoted 26 lines


        crtc_state->has_psr = true; crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state);

drivers/gpu/drm/i915/display/intel_psr_regs.h +0 -0
index d39951383c92..efe4306b37e0 100644
@@ -35,6 +35,8 @@
  #define  

EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES  REG_FIELD_PREP(EDP_PSR_MIN_LINK_ ENTRY_TIME_MASK, 3)
 #define   EDP_PSR_MAX_SLEEP_TIME_MASK          REG_GENMASK(24, 20) #define
EDP_PSR_MAX_SLEEP_TIME(x)            REG_FIELD_PREP(EDP_PSR_MAX_SLEEP _TIME_MASK, (x))

drivers/gpu/drm/i915/display/intel_psr_regs.h +2 -0
+#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK  REG_GENMASK(17, 16)
+#define  

LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x)    REG_FIELD_PREP(LNL_EDP_PSR_ENTRY _SETUP_FRAMES_MASK, (x))
 #define   EDP_PSR_SKIP_AUX_EXIT                        REG_BIT(12) #define   EDP_PSR_TP_MASK                      REG_BIT(11) #define
EDP_PSR_TP_TP1_TP2                   REG_FIELD_PREP(EDP_PSR_TP_MASK,
0)

#2 lore raw
Quoted 154 lines · Jouni
Quoted 78 lines · Mika Kahola

Display driver shall read DPCD 00071h[3:1] during configuration to get PSR setup time. This register provides the setup time requirement on the VSC SDP entry packet. If setup time cannot be met with the current timings
(e.g., PSR setup time + other blanking requirements > blanking time), driver should enable sending VSC SDP one frame earlier before sending the capture frame.

BSpec: 69895 (PSR Entry Setup Frames 17:16)

v2: Write frames before su entry to correct register (Ville, Jouni) Move frames before su entry calculation to it's own function (Ville, Jouni)
    Rename PSR Entry Setup Frames register to indicate Lunarlake specificity (Jouni)

---
 .../drm/i915/display/intel_display_types.h    |  1 + drivers/gpu/drm/i915/display/intel_psr.c      | 77 ++++++++++++++--- --
 drivers/gpu/drm/i915/display/intel_psr_regs.h |  2 +

 3 files changed, 62 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 65ea37fe8cff..a0bcab6f2bec 100644
@@ -1710,6 +1710,7 @@ struct intel_psr {
         u32 dc3co_exitline;
         u32 dc3co_exit_delay;
         struct delayed_work dc3co_work;
+       u8 entry_setup_frames;
  };


 struct intel_dp {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
index ecd24a0b86cb..c9e6651fb3b2 100644
@@ -592,6 +592,9 @@ static void intel_psr_enable_sink(struct intel_dp
 *intel_dp)
         if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                 dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;


+       if (intel_dp->psr.entry_setup_frames > 0)
+               dpcd_val |= DP_PSR_FRAME_CAPTURE;
+
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -690,6 +693,9 @@ static void hsw_activate_psr1(struct intel_dp
 *intel_dp)
         if (DISPLAY_VER(dev_priv) >= 8)
                 val |= EDP_PSR_CRC_ENABLE;


+       if (DISPLAY_VER(dev_priv) >= 20)
+               val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        intel_de_rmw(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), ~EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK, val); }

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -727,11 +733,27 @@ static int psr2_block_count(struct intel_dp
 *intel_dp)
         return psr2_block_count_lines(intel_dp) / 4;
  }

drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+static u8 get_frames_before_su_entry(struct intel_dp *intel_dp)
+{
+       u8 frames_before_su_entry;
+
+       frames_before_su_entry = max_t(u8,
+                                      intel_dp-
Quoted 1 line

psr.sink_sync_latency + 1,

Quoted 7 lines

+                                      2);
+
+       /* Entry setup frames must be at least 1 less than frames before SU entry */
+       if (intel_dp->psr.entry_setup_frames >= frames_before_su_entry)
+               frames_before_su_entry += 1;

Comment above and the code are not matching. This would match:

frames_before_su_entry = intel_dp->psr.entry_setup_frames + 1;

Quoted 57 lines
drivers/gpu/drm/i915/display/intel_psr.c +4 -0
+
+       return frames_before_su_entry;
+}
+

 static void hsw_activate_psr2(struct intel_dp *intel_dp) {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); enum transcoder cpu_transcoder = intel_dp->psr.transcoder; u32 val = EDP_PSR2_ENABLE;
+       u32 psr_val = 0;

        val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -741,7 +763,8 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)

        if (DISPLAY_VER(dev_priv) >= 10 && DISPLAY_VER(dev_priv) <=
12)
                val |= EDP_Y_COORDINATE_ENABLE;

-       val |= EDP_PSR2_FRAME_BEFORE_SU(max_t(u8, intel_dp-

Quoted 1 line

psr.sink_sync_latency + 1, 2));

+       val |= EDP_PSR2_FRAME_BEFORE_SU(get_frames_before_su_entry(intel_dp)); +
        val |= intel_psr2_get_tp_time(intel_dp);

        if (DISPLAY_VER(dev_priv) >= 12) {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -785,6 +808,9 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
         if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                 val |= EDP_PSR2_SU_SDP_SCANLINE;


+       if (DISPLAY_VER(dev_priv) >= 20)
+               psr_val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        if (intel_dp->psr.psr2_sel_fetch_enabled) { u32 tmp;

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -798,7 +824,7 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
          * PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and BSpec

is
         * recommending keep this bit unset while PSR2 is enabled. */
-       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), 0);
+       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), psr_val);

        intel_de_write(dev_priv, EDP_PSR2_CTL(cpu_transcoder), val); }

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1066,6 +1092,36 @@ static bool _compute_psr2_wake_times(struct
 intel_dp *intel_dp,
         return true;
  }
Quoted 3 lines


+static void intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,

You need to convert this into

Quoted 3 lines

static bool intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,
const struct
drm_display_mode *adjusted_mode)

Just make a proper function that returns the number of frames we need.

Quoted 118 lines
Quoted 13 lines

+                                            const struct drm_display_mode *adjusted_mode)
+{
+       struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); +       int psr_setup_time = drm_dp_psr_setup_time(intel_dp-

Quoted 1 line

psr_dpcd);

drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+
+       intel_dp->psr.entry_setup_frames = 0;
+
+       if (psr_setup_time < 0) {
+               drm_dbg_kms(&dev_priv->drm,
+                           "PSR condition failed: Invalid PSR setup
Quoted 3 lines

time (0x%02x)\n",
+                           intel_dp->psr_dpcd[1]); +               return;

and return false here.

Quoted 10 lines

+       }
+
+       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > +           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay
- 1) {
+               if (DISPLAY_VER(dev_priv) >= 20) {
+                       intel_dp->psr.entry_setup_frames = 1; +                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR setup entry frames: %d\n", +                                   intel_dp-

Quoted 7 lines
Quoted 1 line

psr.entry_setup_frames);

+               } else {
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR condition failed: PSR setup time (%d us) too long\n",
+                                   psr_setup_time);
+               }

and here as well.

Quoted 1 line

+       }

and return true here.

Quoted 31 lines
drivers/gpu/drm/i915/display/intel_psr.c +2 -0
+}
+

 static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state)
 {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1213,7 +1269,6 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
         struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);

        const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
-       int psr_setup_time;

        /*
         * Current PSR panels don't work reliably with VRR enabled

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1242,21 +1297,7 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
                 return;
         }


-       psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd); -       if (psr_setup_time < 0) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: Invalid PSR setup time (0x%02x)\n",
-                           intel_dp->psr_dpcd[1]);
-               return;
-       }
-
-       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > -           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay

Quoted 8 lines

- 1) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: PSR setup time (%d us) too long\n",
-                           psr_setup_time);
-               return;
-       }
+       intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode);

and have:

if (!intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode))

	return;

BR,

Jouni Högander

Quoted 26 lines


        crtc_state->has_psr = true; crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state);

drivers/gpu/drm/i915/display/intel_psr_regs.h +0 -0
index d39951383c92..efe4306b37e0 100644
@@ -35,6 +35,8 @@
  #define  

EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES  REG_FIELD_PREP(EDP_PSR_MIN_LINK_ ENTRY_TIME_MASK, 3)
 #define   EDP_PSR_MAX_SLEEP_TIME_MASK          REG_GENMASK(24, 20) #define
EDP_PSR_MAX_SLEEP_TIME(x)            REG_FIELD_PREP(EDP_PSR_MAX_SLEEP _TIME_MASK, (x))

drivers/gpu/drm/i915/display/intel_psr_regs.h +2 -0
+#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK  REG_GENMASK(17, 16)
+#define  

LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x)    REG_FIELD_PREP(LNL_EDP_PSR_ENTRY _SETUP_FRAMES_MASK, (x))
 #define   EDP_PSR_SKIP_AUX_EXIT                        REG_BIT(12) #define   EDP_PSR_TP_MASK                      REG_BIT(11) #define
EDP_PSR_TP_TP1_TP2                   REG_FIELD_PREP(EDP_PSR_TP_MASK,
0)

Signature · 2 lines
Ville Syrjälä
Intel
#3 lore raw
Quoted 162 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Wednesday, November 1, 2023 11:38 AM
To: Hogander, Jouni <[email protected]>
Cc: Kahola, Mika <[email protected]>; [email protected]
Subject: Re: [PATCH v2] drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier

Quoted 154 lines · Jouni
Quoted 82 lines · Mika Kahola

Display driver shall read DPCD 00071h[3:1] during configuration to get PSR setup time. This register provides the setup time requirement on the VSC SDP entry packet. If setup time cannot be met with the current timings (e.g., PSR setup time + other blanking requirements > blanking time), driver should enable sending VSC SDP one frame earlier before sending the capture frame.

BSpec: 69895 (PSR Entry Setup Frames 17:16)

v2: Write frames before su entry to correct register (Ville, Jouni) Move frames before su entry calculation to it's own function (Ville, Jouni)
    Rename PSR Entry Setup Frames register to indicate Lunarlake specificity (Jouni)

---
 .../drm/i915/display/intel_display_types.h    |  1 + drivers/gpu/drm/i915/display/intel_psr.c      | 77
++++++++++++++---
-- drivers/gpu/drm/i915/display/intel_psr_regs.h |  2 +

 3 files changed, 62 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 65ea37fe8cff..a0bcab6f2bec 100644
@@ -1710,6 +1710,7 @@ struct intel_psr {
         u32 dc3co_exitline;
         u32 dc3co_exit_delay;
         struct delayed_work dc3co_work;
+       u8 entry_setup_frames;
  };
 
  struct intel_dp {
drivers/gpu/drm/i915/display/intel_psr.c +0 -0
index ecd24a0b86cb..c9e6651fb3b2 100644
@@ -592,6 +592,9 @@ static void intel_psr_enable_sink(struct

intel_dp
*intel_dp)
        if (intel_dp->psr.req_psr2_sdp_prior_scanline) dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;

+       if (intel_dp->psr.entry_setup_frames > 0)
+               dpcd_val |= DP_PSR_FRAME_CAPTURE;
+
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);

        drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0); @@ -690,6 +693,9 @@ static void hsw_activate_psr1(struct intel_dp
*intel_dp)
        if (DISPLAY_VER(dev_priv) >= 8)
                val |= EDP_PSR_CRC_ENABLE;

+       if (DISPLAY_VER(dev_priv) >= 20)
+               val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        intel_de_rmw(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder),
                     ~EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK, val); }

drivers/gpu/drm/i915/display/intel_psr.c +8 -0
@@ -727,11 +733,27 @@ static int psr2_block_count(struct intel_dp
 *intel_dp)
         return psr2_block_count_lines(intel_dp) / 4;
  }
 
+static u8 get_frames_before_su_entry(struct intel_dp *intel_dp) {
+       u8 frames_before_su_entry;
+
+       frames_before_su_entry = max_t(u8,
+                                      intel_dp-
 >psr.sink_sync_latency + 1,
+                                      2);
+
+       /* Entry setup frames must be at least 1 less than frames
Quoted 4 lines

before SU entry */
+       if (intel_dp->psr.entry_setup_frames >=
frames_before_su_entry)
+               frames_before_su_entry += 1;

Comment above and the code are not matching. This would match:

frames_before_su_entry = intel_dp->psr.entry_setup_frames + 1;

Quoted 53 lines
drivers/gpu/drm/i915/display/intel_psr.c +3 -0
+
+       return frames_before_su_entry; }
+

 static void hsw_activate_psr2(struct intel_dp *intel_dp) {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); enum transcoder cpu_transcoder = intel_dp->psr.transcoder; u32 val = EDP_PSR2_ENABLE;
+       u32 psr_val = 0;

        val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -741,7 +763,8 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)

        if (DISPLAY_VER(dev_priv) >= 10 && DISPLAY_VER(dev_priv) <=
12)
                val |= EDP_Y_COORDINATE_ENABLE;

-       val |= EDP_PSR2_FRAME_BEFORE_SU(max_t(u8, intel_dp-

Quoted 1 line

psr.sink_sync_latency + 1, 2));

+       val |= EDP_PSR2_FRAME_BEFORE_SU(get_frames_before_su_entry(intel_dp)); +
        val |= intel_psr2_get_tp_time(intel_dp);

        if (DISPLAY_VER(dev_priv) >= 12) { @@ -785,6 +808,9 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
        if (intel_dp->psr.req_psr2_sdp_prior_scanline) val |= EDP_PSR2_SU_SDP_SCANLINE;

+       if (DISPLAY_VER(dev_priv) >= 20)
+               psr_val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        if (intel_dp->psr.psr2_sel_fetch_enabled) { u32 tmp;

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -798,7 +824,7 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
          * PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and

BSpec is
         * recommending keep this bit unset while PSR2 is enabled. */
-       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), 0);
+       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), psr_val);

        intel_de_write(dev_priv, EDP_PSR2_CTL(cpu_transcoder), val); }

drivers/gpu/drm/i915/display/intel_psr.c static bool _compute_psr2_wake_times(struct · line 1097

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_psr.c +1 -0
@@ -1066,6 +1092,36 @@ static bool _compute_psr2_wake_times(struct
 intel_dp *intel_dp,
         return true;
  }
 
+static void intel_psr_set_entry_setup_frames(struct intel_dp
 *intel_dp,

You need to convert this into

Quoted 5 lines
Quoted 3 lines

static bool intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,
const struct
drm_display_mode *adjusted_mode)

Just make a proper function that returns the number of frames we need.

Yes, there is another issue with this as well as in case of psr_setup_time fails we only return from this function instead of the calling function like it should.

I'll fix this.

Thanks for a review!

-Mika-

Quoted 128 lines
Quoted 115 lines
Quoted 14 lines
drivers/gpu/drm/i915/display/intel_psr.c +4 -0
+                                            const struct
 drm_display_mode *adjusted_mode)
+{
+       struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
+       int psr_setup_time = drm_dp_psr_setup_time(intel_dp-
Quoted 1 line

psr_dpcd);

drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+
+       intel_dp->psr.entry_setup_frames = 0;
+
+       if (psr_setup_time < 0) {
+               drm_dbg_kms(&dev_priv->drm,
+                           "PSR condition failed: Invalid PSR setup
Quoted 3 lines

time (0x%02x)\n",
+                           intel_dp->psr_dpcd[1]); +               return;

and return false here.

Quoted 13 lines

+       }

drivers/gpu/drm/i915/display/intel_psr.c +10 -1
+
+       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time)
+>
+           adjusted_mode->crtc_vtotal -
+adjusted_mode->crtc_vdisplay
- 1) {
+               if (DISPLAY_VER(dev_priv) >= 20) {
+                       intel_dp->psr.entry_setup_frames = 1;
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR setup entry frames: %d\n",
+                                   intel_dp-
Quoted 1 line

psr.entry_setup_frames);

Quoted 6 lines

+               } else {
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR condition failed: PSR setup time (%d us) too long\n",
+                                   psr_setup_time);
+               }

and here as well.

Quoted 1 line

+       }

and return true here.

Quoted 31 lines
drivers/gpu/drm/i915/display/intel_psr.c +2 -0
+}
+

 static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state)
 {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1213,7 +1269,6 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
         struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);

        const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; -       int psr_setup_time;

        /*
         * Current PSR panels don't work reliably with VRR enabled

drivers/gpu/drm/i915/display/intel_psr.c +0 -9
@@ -1242,21 +1297,7 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
                 return;
         }
 
-       psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd);
-       if (psr_setup_time < 0) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: Invalid PSR setup
 time (0x%02x)\n",
-                           intel_dp->psr_dpcd[1]);
-               return;
-       }
-
-       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time)
Quoted 1 line
Quoted 11 lines

-           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay
- 1) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: PSR setup time (%d
us) too long\n",
-                           psr_setup_time);
-               return;
-       }
+       intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode);

and have:

if (!intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode))

	return;

BR,

Jouni Högander

Quoted 18 lines

        crtc_state->has_psr = true; crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state); diff --git a/drivers/gpu/drm/i915/display/intel_psr_regs.h b/drivers/gpu/drm/i915/display/intel_psr_regs.h
index d39951383c92..efe4306b37e0 100644

drivers/gpu/drm/i915/display/intel_psr_regs.h +0 -0
@@ -35,6 +35,8 @@
  #define

EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES REG_FIELD_PREP(EDP_PSR_MIN_LINK_ ENTRY_TIME_MASK, 3) #define   EDP_PSR_MAX_SLEEP_TIME_MASK          REG_GENMASK(24, 20) #define
EDP_PSR_MAX_SLEEP_TIME(x) REG_FIELD_PREP(EDP_PSR_MAX_SLEEP _TIME_MASK, (x)) +#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK  REG_GENMASK(17, 16)

Quoted 9 lines
Quoted 8 lines

+#define
LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x) REG_FIELD_PREP(LNL_EDP_PSR_ENTRY _SETUP_FRAMES_MASK, (x)) #define   EDP_PSR_SKIP_AUX_EXIT                        REG_BIT(12) #define   EDP_PSR_TP_MASK                      REG_BIT(11) #define
EDP_PSR_TP_TP1_TP2                   REG_FIELD_PREP(EDP_PSR_TP_MASK,
0)

--
Ville Syrjälä
Intel

#4 lore raw
In reply to Hogander, Jouni
Quoted 92 lines

-----Original Message-----
From: Hogander, Jouni <[email protected]>
Sent: Wednesday, November 1, 2023 11:29 AM
To: Kahola, Mika <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v2] drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier

Quoted 79 lines · Mika Kahola

Display driver shall read DPCD 00071h[3:1] during configuration to get PSR setup time. This register provides the setup time requirement on the VSC SDP entry packet. If setup time cannot be met with the current timings (e.g., PSR setup time + other blanking requirements > blanking time), driver should enable sending VSC SDP one frame earlier before sending the capture frame.

BSpec: 69895 (PSR Entry Setup Frames 17:16)

v2: Write frames before su entry to correct register (Ville, Jouni) Move frames before su entry calculation to it's own function (Ville, Jouni)
    Rename PSR Entry Setup Frames register to indicate Lunarlake specificity (Jouni)

---
 .../drm/i915/display/intel_display_types.h    |  1 + drivers/gpu/drm/i915/display/intel_psr.c      | 77 ++++++++++++++--- --
 drivers/gpu/drm/i915/display/intel_psr_regs.h |  2 +

 3 files changed, 62 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 65ea37fe8cff..a0bcab6f2bec 100644
@@ -1710,6 +1710,7 @@ struct intel_psr {
         u32 dc3co_exitline;
         u32 dc3co_exit_delay;
         struct delayed_work dc3co_work;
+       u8 entry_setup_frames;
  };
 
  struct intel_dp {
drivers/gpu/drm/i915/display/intel_psr.c +3 -0
index ecd24a0b86cb..c9e6651fb3b2 100644
@@ -592,6 +592,9 @@ static void intel_psr_enable_sink(struct intel_dp
 *intel_dp)
         if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                 dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;
 
+       if (intel_dp->psr.entry_setup_frames > 0)
+               dpcd_val |= DP_PSR_FRAME_CAPTURE;
+
         drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);
 

        drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0); @@ -690,6 +693,9 @@ static void hsw_activate_psr1(struct intel_dp
*intel_dp)
        if (DISPLAY_VER(dev_priv) >= 8)
                val |= EDP_PSR_CRC_ENABLE;

+       if (DISPLAY_VER(dev_priv) >= 20)
+               val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        intel_de_rmw(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), ~EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK, val); }

drivers/gpu/drm/i915/display/intel_psr.c +8 -0
@@ -727,11 +733,27 @@ static int psr2_block_count(struct intel_dp
 *intel_dp)
         return psr2_block_count_lines(intel_dp) / 4;
  }
 
+static u8 get_frames_before_su_entry(struct intel_dp *intel_dp) {
+       u8 frames_before_su_entry;
+
+       frames_before_su_entry = max_t(u8,
+                                      intel_dp-
 >psr.sink_sync_latency + 1,
+                                      2);
+
+       /* Entry setup frames must be at least 1 less than frames
Quoted 4 lines

before SU entry */
+       if (intel_dp->psr.entry_setup_frames >=
frames_before_su_entry)
+               frames_before_su_entry += 1;

Quoted 3 lines

Comment above and the code are not matching. This would match:

frames_before_su_entry = intel_dp->psr.entry_setup_frames + 1;

Right, I will reword the comment.

Quoted 73 lines
Quoted 54 lines
drivers/gpu/drm/i915/display/intel_psr.c +3 -0
+
+       return frames_before_su_entry; }
+

 static void hsw_activate_psr2(struct intel_dp *intel_dp) {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); enum transcoder cpu_transcoder = intel_dp->psr.transcoder; u32 val = EDP_PSR2_ENABLE;
+       u32 psr_val = 0;

        val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -741,7 +763,8 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)

        if (DISPLAY_VER(dev_priv) >= 10 && DISPLAY_VER(dev_priv) <=
12)
                val |= EDP_Y_COORDINATE_ENABLE;

-       val |= EDP_PSR2_FRAME_BEFORE_SU(max_t(u8, intel_dp-

Quoted 1 line

psr.sink_sync_latency + 1, 2));

+       val |= EDP_PSR2_FRAME_BEFORE_SU(get_frames_before_su_entry(intel_dp)); +
        val |= intel_psr2_get_tp_time(intel_dp);

        if (DISPLAY_VER(dev_priv) >= 12) { @@ -785,6 +808,9 @@ static void hsw_activate_psr2(struct intel_dp
*intel_dp)
        if (intel_dp->psr.req_psr2_sdp_prior_scanline)
                val |= EDP_PSR2_SU_SDP_SCANLINE;

+       if (DISPLAY_VER(dev_priv) >= 20)
+               psr_val |= LNL_EDP_PSR_ENTRY_SETUP_FRAMES(intel_dp-

Quoted 1 line

psr.entry_setup_frames);

+
        if (intel_dp->psr.psr2_sel_fetch_enabled) { u32 tmp;

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -798,7 +824,7 @@ static void hsw_activate_psr2(struct intel_dp
 *intel_dp)
          * PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and BSpec

is
         * recommending keep this bit unset while PSR2 is enabled. */
-       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), 0);
+       intel_de_write(dev_priv, psr_ctl_reg(dev_priv, cpu_transcoder), psr_val);

        intel_de_write(dev_priv, EDP_PSR2_CTL(cpu_transcoder), val); }

drivers/gpu/drm/i915/display/intel_psr.c static bool _compute_psr2_wake_times(struct · line 1097

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_psr.c +1 -0
@@ -1066,6 +1092,36 @@ static bool _compute_psr2_wake_times(struct
 intel_dp *intel_dp,
         return true;
  }
 
+static void intel_psr_set_entry_setup_frames(struct intel_dp
 *intel_dp,

You need to convert this into

static bool intel_psr_set_entry_setup_frames(struct intel_dp *intel_dp,
const struct
drm_display_mode *adjusted_mode)

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_psr.c +4 -0
+                                            const struct
 drm_display_mode *adjusted_mode)
+{
+       struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
+       int psr_setup_time = drm_dp_psr_setup_time(intel_dp-
Quoted 1 line

psr_dpcd);

Quoted 11 lines
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_psr.c +6 -0
+
+       intel_dp->psr.entry_setup_frames = 0;
+
+       if (psr_setup_time < 0) {
+               drm_dbg_kms(&dev_priv->drm,
+                           "PSR condition failed: Invalid PSR setup

time (0x%02x)\n",
+                           intel_dp->psr_dpcd[1]); +               return;

and return false here.

I will rewrite this whole function a bit differently as such is not really feasible.

Thanks for a review!

-Mika-

Quoted 99 lines
Quoted 11 lines

+       }
+
+       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > +           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay
- 1) {
+               if (DISPLAY_VER(dev_priv) >= 20) {
+                       intel_dp->psr.entry_setup_frames = 1; +                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR setup entry frames: %d\n", +                                   intel_dp-

Quoted 7 lines
Quoted 1 line

psr.entry_setup_frames);

+               } else {
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "PSR condition failed: PSR setup time (%d us) too long\n",
+                                   psr_setup_time);
+               }

and here as well.

Quoted 1 line

+       }

and return true here.

Quoted 31 lines
drivers/gpu/drm/i915/display/intel_psr.c +2 -0
+}
+

 static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state)
 {

drivers/gpu/drm/i915/display/intel_psr.c +0 -0
@@ -1213,7 +1269,6 @@ void intel_psr_compute_config(struct intel_dp
 *intel_dp,
         struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);

        const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; -       int psr_setup_time;

        /*
         * Current PSR panels don't work reliably with VRR enabled @@ -1242,21 +1297,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
                return;
        }

-       psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd); -       if (psr_setup_time < 0) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: Invalid PSR setup time (0x%02x)\n",
-                           intel_dp->psr_dpcd[1]);
-               return;
-       }
-
-       if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > -           adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay

Quoted 8 lines

- 1) {
-               drm_dbg_kms(&dev_priv->drm,
-                           "PSR condition failed: PSR setup time (%d us) too long\n",
-                           psr_setup_time);
-               return;
-       }
+       intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode);

and have:

if (!intel_psr_set_entry_setup_frames(intel_dp, adjusted_mode))

	return;

BR,

Jouni Högander

Quoted 26 lines

        crtc_state->has_psr = true; crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state); diff --git a/drivers/gpu/drm/i915/display/intel_psr_regs.h b/drivers/gpu/drm/i915/display/intel_psr_regs.h
index d39951383c92..efe4306b37e0 100644

drivers/gpu/drm/i915/display/intel_psr_regs.h +0 -0
@@ -35,6 +35,8 @@
  #define

EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES  REG_FIELD_PREP(EDP_PSR_MIN_LINK_ ENTRY_TIME_MASK, 3)
 #define   EDP_PSR_MAX_SLEEP_TIME_MASK          REG_GENMASK(24, 20) #define
EDP_PSR_MAX_SLEEP_TIME(x)            REG_FIELD_PREP(EDP_PSR_MAX_SLEEP _TIME_MASK, (x))

drivers/gpu/drm/i915/display/intel_psr_regs.h +2 -0
+#define   LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK  REG_GENMASK(17, 16)
+#define

LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x)    REG_FIELD_PREP(LNL_EDP_PSR_ENTRY _SETUP_FRAMES_MASK, (x))
 #define   EDP_PSR_SKIP_AUX_EXIT                        REG_BIT(12) #define   EDP_PSR_TP_MASK                      REG_BIT(11) #define
EDP_PSR_TP_TP1_TP2                   REG_FIELD_PREP(EDP_PSR_TP_MASK,
0)

#5 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier (rev2)

In reply to Mika Kahola
== Series Details ==

== Series Details ==

Series: drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier (rev2)
URL : https://patchwork.freedesktop.org/series/125558/
State : warning

== Summary ==

Error: dim checkpatch failed
0f3481222a42 drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier -:18: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?) #18:
Move frames before su entry calculation to it's own function (Ville, Jouni)

-:193: WARNING:LONG_LINE: line length of 104 exceeds 100 columns #193: FILE: drivers/gpu/drm/i915/display/intel_psr_regs.h:39:
+#define LNL_EDP_PSR_ENTRY_SETUP_FRAMES(x) REG_FIELD_PREP(LNL_EDP_PSR_ENTRY_SETUP_FRAMES_MASK, (x))

total: 0 errors, 2 warnings, 0 checks, 151 lines checked

#6 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier (rev2)

In reply to Mika Kahola
== Series Details ==

== Series Details ==

Series: drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier (rev2)
URL : https://patchwork.freedesktop.org/series/125558/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13824 -> Patchwork_125558v2
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_125558v2 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in Patchwork_125558v2, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/index.html

Participating hosts (37 -> 35)
------------------------------

Additional (1): bat-mtlp-8
Missing (3): bat-kbl-2 bat-atsm-1 fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_125558v2:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-hsw-4770/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in Patchwork_125558v2 that come from known issues:

### CI changes ###

#### Possible fixes ####

* boot:
- fi-hsw-4770: [FAIL][2] ([i915#8293]) -> [PASS][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/fi-hsw-4770/boot.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-hsw-4770/boot.html

### IGT changes ###

#### Issues hit ####

* igt@debugfs_test@basic-hwmon:
- bat-mtlp-8: NOTRUN -> [SKIP][4] ([i915#9318])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@gem_exec_suspend@basic-s0@smem:
- bat-jsl-3: [PASS][5] -> [INCOMPLETE][6] ([i915#9275])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-jsl-3/igt@gem_exec_suspend@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-jsl-3/igt@gem_exec_suspend@[email protected]
- bat-dg2-9: [PASS][7] -> [INCOMPLETE][8] ([i915#9275])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-dg2-9/igt@gem_exec_suspend@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-dg2-9/igt@gem_exec_suspend@[email protected]

* igt@gem_lmem_swapping@verify-random:
- bat-mtlp-8: NOTRUN -> [SKIP][9] ([i915#4613]) +3 other tests skip
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@gem_mmap@basic:
- bat-mtlp-8: NOTRUN -> [SKIP][10] ([i915#4083])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@gem_mmap_gtt@basic:
- bat-mtlp-8: NOTRUN -> [SKIP][11] ([i915#4077]) +3 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@gem_render_tiled_blits@basic:
- bat-mtlp-8: NOTRUN -> [SKIP][12] ([i915#4079]) +1 other test skip
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-mtlp-8: NOTRUN -> [SKIP][13] ([i915#6621])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-jsl-3: [PASS][14] -> [FAIL][15] ([fdo#103375])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-jsl-3/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-jsl-3/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][16] ([i915#6645])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- fi-hsw-4770: NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#5190])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-hsw-4770/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][18] ([i915#5190])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][19] ([i915#4212]) +8 other tests skip
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][20] ([i915#4213]) +1 other test skip
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_dsc@dsc-basic:
- bat-mtlp-8: NOTRUN -> [SKIP][21] ([i915#3555] / [i915#3840] / [i915#9159])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- bat-mtlp-8: NOTRUN -> [SKIP][22] ([fdo#109285])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- bat-mtlp-8: NOTRUN -> [SKIP][23] ([i915#5274])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-a-vga-1:
- fi-hsw-4770: NOTRUN -> [SKIP][24] ([fdo#109271]) +12 other tests skip
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-hsw-4770/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-5:
- bat-adlp-11: [PASS][25] -> [DMESG-FAIL][26] ([i915#6868])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- fi-hsw-4770: NOTRUN -> [SKIP][27] ([fdo#109271] / [i915#1072]) +3 other tests skip
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_setmode@basic-clone-single-crtc:
- bat-mtlp-8: NOTRUN -> [SKIP][28] ([i915#3555] / [i915#8809])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@prime_vgem@basic-fence-mmap:
- bat-mtlp-8: NOTRUN -> [SKIP][29] ([i915#3708] / [i915#4077]) +1 other test skip
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

* igt@prime_vgem@basic-fence-read:
- bat-mtlp-8: NOTRUN -> [SKIP][30] ([i915#3708]) +2 other tests skip
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-mtlp-8/igt@[email protected]

#### Possible fixes ####

* igt@kms_flip@basic-flip-vs-wf_vblank@d-dp5:
- bat-adlp-11: [DMESG-WARN][31] ([i915#6868]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-adlp-11/igt@kms_flip@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-adlp-11/igt@kms_flip@[email protected]

* igt@kms_hdmi_inject@inject-audio:
- fi-kbl-guc: [FAIL][33] ([IGT#3]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/fi-kbl-guc/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/fi-kbl-guc/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc@pipe-c-dp-5:
- bat-adlp-11: [DMESG-FAIL][35] ([i915#6868]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc@pipe-d-dp-5:
- bat-adlp-11: [FAIL][37] ([i915#9047]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13824/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
[i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293
[i915#8809]: https://gitlab.freedesktop.org/drm/intel/issues/8809
[i915#9047]: https://gitlab.freedesktop.org/drm/intel/issues/9047
[i915#9159]: https://gitlab.freedesktop.org/drm/intel/issues/9159
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275
[i915#9318]: https://gitlab.freedesktop.org/drm/intel/issues/9318

Build changes
-------------

* Linux: CI_DRM_13824 -> Patchwork_125558v2

CI-20190529: 20190529
CI_DRM_13824: 4e566d1e4ccb2f7caeb51f5d6cdaa647e641fb45 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7568: 9e3c3791e7e0297f277211b19a3388a1ee87f3d0 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_125558v2: 4e566d1e4ccb2f7caeb51f5d6cdaa647e641fb45 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

79337219e79d drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_125558v2/index.html