Skip to contentSkip to conversation

Revert "drm/amd/display: Enable Replay for static screen use cases"

PATCH Applied [email protected] 5 participants 9 messages Oct 2, 2023 – Oct 3, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Revert "drm/amd/display: Enable Replay for static screen use cases"

From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
 drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
 3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -23
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
 #include "amdgpu_dm_debugfs.h"
 #endif
 #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
 #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 	enum dc_connection_type new_connection_type = dc_connection_none;
 	const struct dc_plane_cap *plane;
 	bool psr_feature_enabled = false;
-	bool replay_feature_enabled = false;
 	int max_overlay = dm->dc->caps.max_slave_planes;
 
 	dm->display_indexes_num = dm->dc->caps.max_streams;
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 		}
 	}
 
-	if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-		switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-		case IP_VERSION(3, 1, 4):
-		case IP_VERSION(3, 1, 5):
-		case IP_VERSION(3, 1, 6):
-		case IP_VERSION(3, 2, 0):
-		case IP_VERSION(3, 2, 1):
-		case IP_VERSION(3, 5, 0):
-			replay_feature_enabled = true;
-			break;
-		default:
-			replay_feature_enabled = amdgpu_dc_feature_mask & DC_REPLAY_MASK;
-			break;
-		}
-	}
 	/* loops over all connectors on the board */
 	for (i = 0; i < link_cnt; i++) {
 		struct dc_link *link = NULL;
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 				amdgpu_dm_update_connector_after_detect(aconnector);
 				setup_backlight_device(dm, aconnector);
 
-				/*
-				 * Disable psr if replay can be enabled
-				 */
-				if (replay_feature_enabled && amdgpu_dm_setup_replay(link, aconnector))
-					psr_feature_enabled = false;
-
 				if (psr_feature_enabled)
 					amdgpu_dm_set_psr_caps(link);
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -8
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
 #include "dc.h"
 #include "amdgpu.h"
 #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 #include "amdgpu_dm_crtc.h"
 #include "amdgpu_dm_plane.h"
 #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct work_struct *work)
 	 * fill_dc_dirty_rects().
 	 */
 	if (vblank_work->stream && vblank_work->stream->link) {
-		/*
-		 * Prioritize replay, instead of psr
-		 */
-		if (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-			amdgpu_dm_replay_enable(vblank_work->stream, false);
-		else if (vblank_work->enable) {
+		if (vblank_work->enable) {
 			if (vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&
 			    vblank_work->stream->link->psr_settings.psr_allow_active)
 				amdgpu_dm_psr_disable(vblank_work->stream);
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct *work)
 #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 			   !amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
 #endif
-			   vblank_work->stream->link->panel_config.psr.disallow_replay &&
 			   vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
 			amdgpu_dm_psr_enable(vblank_work->stream);
 		}
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
 	DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
 	DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
 	DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default
-	DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4
 };
 
 enum DC_DEBUG_MASK {
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_PSR = 0x10,
 	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
 	DC_DISABLE_MPO = 0x40,
-	DC_DISABLE_REPLAY = 0x50,
 	DC_ENABLE_DPIA_TRACE = 0x80,
 };
 
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

Bhawan
________________________________
From: LIPSKI, IVAN <[email protected]>
Sent: October 2, 2023 1:47 PM
To: [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]>
Subject: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
 drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
 3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -23
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
 #include "amdgpu_dm_debugfs.h"
 #endif
 #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
 #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
         enum dc_connection_type new_connection_type = dc_connection_none;
         const struct dc_plane_cap *plane;
         bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
         int max_overlay = dm->dc->caps.max_slave_planes;
 
         dm->display_indexes_num = dm->dc->caps.max_streams;
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
                 }
         }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask & DC_REPLAY_MASK;
-                       break;
-               }
-       }
         /* loops over all connectors on the board */
         for (i = 0; i < link_cnt; i++) {
                 struct dc_link *link = NULL;
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
                                 amdgpu_dm_update_connector_after_detect(aconnector);
                                 setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled && amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-
                                 if (psr_feature_enabled)
                                         amdgpu_dm_set_psr_caps(link);
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -8
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
 #include "dc.h"
 #include "amdgpu.h"
 #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 #include "amdgpu_dm_crtc.h"
 #include "amdgpu_dm_plane.h"
 #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct work_struct *work)
          * fill_dc_dirty_rects().
          */
         if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                         if (vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&
                             vblank_work->stream->link->psr_settings.psr_allow_active)
                                 amdgpu_dm_psr_disable(vblank_work->stream);
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct *work)
 #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
                            !amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
 #endif
-                          vblank_work->stream->link->panel_config.psr.disallow_replay &&
                            vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                         amdgpu_dm_psr_enable(vblank_work->stream);
                 }
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
         DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
         DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
         DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default
-       DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4
 };
 
 enum DC_DEBUG_MASK {
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
         DC_DISABLE_PSR = 0x10,
         DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
         DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
         DC_ENABLE_DPIA_TRACE = 0x80,
 };
 

--
2.34.1

maintainer Acked-by
#2 lore raw
Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 158 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
          enum dc_connection_type new_connection_type = dc_connection_none;
          const struct dc_plane_cap *plane;
          bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
          int max_overlay = dm->dc->caps.max_slave_planes;
 

         dm->display_indexes_num = dm->dc->caps.max_streams;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
                  }
          }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask 
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
          /* loops over all connectors on the board */

         for (i = 0; i < link_cnt; i++) {
                 struct dc_link *link = NULL;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                  setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled && 
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-

                                 if (psr_feature_enabled) amdgpu_dm_set_psr_caps(link);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct 
 work_struct *work)
           * fill_dc_dirty_rects().
           */
          if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if 
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                          if 

(vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct 
 *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
 #endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                         amdgpu_dm_psr_enable(vblank_work->stream); }

drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
          DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
          DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
          DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by 

default
-       DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4
 };

 enum DC_DEBUG_MASK {

drivers/gpu/drm/amd/include/amd_shared.h +0 -1
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
          DC_DISABLE_PSR = 0x10,
          DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
          DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
          DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
Signature · 1 line
2.34.1
Acked-by Leo Li
#3 lore raw

[AMD Official Use Only - General]

Why not just set replay_feature_enabled = true; to false?
________________________________
From: Li, Sun peng (Leo) <[email protected]>
Sent: October 3, 2023 11:20 AM
To: Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 6 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 168 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]> *Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
          enum dc_connection_type new_connection_type = dc_connection_none;
          const struct dc_plane_cap *plane;
          bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
          int max_overlay = dm->dc->caps.max_slave_planes;
 
          dm->display_indexes_num = dm->dc->caps.max_streams;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
                  }
          }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
          /* loops over all connectors on the board */
          for (i = 0; i < link_cnt; i++) {
                  struct dc_link *link = NULL;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                  setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled &&
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-
                                  if (psr_feature_enabled)
                                          amdgpu_dm_set_psr_caps(link);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct
 work_struct *work)
           * fill_dc_dirty_rects().
           */
          if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                          if

(vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct
 *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
#endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                          amdgpu_dm_psr_enable(vblank_work->stream);
                  }
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
          DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
          DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
          DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by

default
- DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn
< 3.1.4
};

  enum DC_DEBUG_MASK {
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
          DC_DISABLE_PSR = 0x10,
          DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
          DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
          DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
--

2.34.1

maintainer
#4 lore raw
Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Why not just set replay_feature_enabled = true; to false?

Would that be the right fix? If so, we can send out a patch with that instead.

- Leo

Quoted 178 lines

------------------------------------------------------------------------
*From:* Li, Sun peng (Leo) <[email protected]>
*Sent:* October 3, 2023 11:20 AM
*To:* Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]> *Subject:* Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 156 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 ------------------- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +------- drivers/gpu/drm/amd/include/amd_shared.h      |  2 --

   3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
    #include "amdgpu_dm_debugfs.h"
    #endif
    #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
    #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
            enum dc_connection_type new_connection_type = dc_connection_none;
            const struct dc_plane_cap *plane;
            bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
            int max_overlay = dm->dc->caps.max_slave_planes;
 

           dm->display_indexes_num = dm->dc->caps.max_streams;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
                    }
            }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask 
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
            /* loops over all connectors on the board */

           for (i = 0; i < link_cnt; i++) {
                   struct dc_link *link = NULL;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                    setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled && 
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-

                                   if (psr_feature_enabled) amdgpu_dm_set_psr_caps(link);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
    #include "dc.h"
    #include "amdgpu.h"
    #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
    #include "amdgpu_dm_crtc.h"
    #include "amdgpu_dm_plane.h"
    #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct 
 work_struct *work)
             * fill_dc_dirty_rects().
             */
            if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if 
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {

                           if (vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct 
 *work)
    #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) && #endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) { amdgpu_dm_psr_enable(vblank_work->stream); }

drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {

           DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default -       DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4
   };

   enum DC_DEBUG_MASK {

drivers/gpu/drm/amd/include/amd_shared.h +0 -1
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
            DC_DISABLE_PSR = 0x10,
            DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
            DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
            DC_ENABLE_DPIA_TRACE = 0x80,
    };
 
Signature · 1 line
2.34.1
#5 lore raw

[AMD Official Use Only - General]

yes, it will disable replay.
________________________________
From: Li, Sun peng (Leo) <[email protected]>
Sent: October 3, 2023 11:40 AM
To: Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Why not just set replay_feature_enabled = true; to false?

Would that be the right fix? If so, we can send out a patch with that instead.

- Leo

Quoted 198 lines

------------------------------------------------------------------------
*From:* Li, Sun peng (Leo) <[email protected]>
*Sent:* October 3, 2023 11:20 AM
*To:* Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
*Subject:* Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 6 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 168 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]> *Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
          enum dc_connection_type new_connection_type = dc_connection_none;
          const struct dc_plane_cap *plane;
          bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
          int max_overlay = dm->dc->caps.max_slave_planes;
 
          dm->display_indexes_num = dm->dc->caps.max_streams;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
                  }
          }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
          /* loops over all connectors on the board */
          for (i = 0; i < link_cnt; i++) {
                  struct dc_link *link = NULL;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                  setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled &&
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-
                                  if (psr_feature_enabled)
                                          amdgpu_dm_set_psr_caps(link);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct
 work_struct *work)
           * fill_dc_dirty_rects().
           */
          if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                          if

(vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct
 *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
#endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                          amdgpu_dm_psr_enable(vblank_work->stream);
                  }
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
          DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
          DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
          DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by

default
- DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn
< 3.1.4
};

  enum DC_DEBUG_MASK {
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
          DC_DISABLE_PSR = 0x10,
          DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
          DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
          DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
--

2.34.1

#6 lore raw

[AMD Official Use Only - General]

Setting 'replay_feature_enabled' to false did not fix the issue, and PSR could not be enabled on an eDP without Replay support (Sink support 0x03 in my case).

Thank you,

Ivan Lipski

________________________________
From: Lakha, Bhawanpreet <[email protected]>
Sent: October 3, 2023 1:03 PM
To: Li, Sun peng (Leo) <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

[AMD Official Use Only - General]

yes, it will disable replay.
________________________________
From: Li, Sun peng (Leo) <[email protected]>
Sent: October 3, 2023 11:40 AM
To: Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Why not just set replay_feature_enabled = true; to false?

Would that be the right fix? If so, we can send out a patch with that instead.

- Leo

Quoted 198 lines

------------------------------------------------------------------------
*From:* Li, Sun peng (Leo) <[email protected]>
*Sent:* October 3, 2023 11:20 AM
*To:* Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
*Subject:* Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 6 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 168 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]> *Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
          enum dc_connection_type new_connection_type = dc_connection_none;
          const struct dc_plane_cap *plane;
          bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
          int max_overlay = dm->dc->caps.max_slave_planes;
 
          dm->display_indexes_num = dm->dc->caps.max_streams;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
                  }
          }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
          /* loops over all connectors on the board */
          for (i = 0; i < link_cnt; i++) {
                  struct dc_link *link = NULL;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                  setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled &&
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-
                                  if (psr_feature_enabled)
                                          amdgpu_dm_set_psr_caps(link);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct
 work_struct *work)
           * fill_dc_dirty_rects().
           */
          if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                          if

(vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct
 *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
#endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                          amdgpu_dm_psr_enable(vblank_work->stream);
                  }
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
          DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
          DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
          DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by

default
- DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn
< 3.1.4
};

  enum DC_DEBUG_MASK {
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
          DC_DISABLE_PSR = 0x10,
          DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
          DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
          DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
--

2.34.1

#7 lore raw

[AMD Official Use Only - General]

You can revert it for now, but that is a bug as replay_feature_enabled should stop all replay related calls.
________________________________
From: LIPSKI, IVAN <[email protected]>
Sent: October 3, 2023 4:11 PM
To: Lakha, Bhawanpreet <[email protected]>; Li, Sun peng (Leo) <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

[AMD Official Use Only - General]

Setting 'replay_feature_enabled' to false did not fix the issue, and PSR could not be enabled on an eDP without Replay support (Sink support 0x03 in my case).

Thank you,

Ivan Lipski

________________________________
From: Lakha, Bhawanpreet <[email protected]>
Sent: October 3, 2023 1:03 PM
To: Li, Sun peng (Leo) <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

[AMD Official Use Only - General]

yes, it will disable replay.
________________________________
From: Li, Sun peng (Leo) <[email protected]>
Sent: October 3, 2023 11:40 AM
To: Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
Cc: Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
Subject: Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 4 lines · Bhawanpreet

[AMD Official Use Only - General]

Why not just set replay_feature_enabled = true; to false?

Would that be the right fix? If so, we can send out a patch with that instead.

- Leo

Quoted 198 lines

------------------------------------------------------------------------
*From:* Li, Sun peng (Leo) <[email protected]>
*Sent:* October 3, 2023 11:20 AM
*To:* Lakha, Bhawanpreet <[email protected]>; LIPSKI, IVAN <[email protected]>; [email protected] <[email protected]>
*Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>
*Subject:* Re: [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

Quoted 6 lines · Bhawanpreet

[AMD Official Use Only - General]

Any reason for reverting this instead of looking into "amdgpu_dm_setup_replay()" and "replay_feature_enabled" to see why reply is being enabled?

It causes a regression in amd_psr. Unless there's a quick fix, we should revert for now. It sounds like this can break existing support for PSR/PSR SU.

- Leo

Quoted 168 lines

Bhawan
------------------------------------------------------------------------
*From:* LIPSKI, IVAN <[email protected]>
*Sent:* October 2, 2023 1:47 PM
*To:* [email protected] <[email protected]> *Cc:* Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; LIPSKI, IVAN <[email protected]>; LIPSKI, IVAN <[email protected]> *Subject:* [PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"
From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

[HOW]
Reverted the patch.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
          enum dc_connection_type new_connection_type = dc_connection_none;
          const struct dc_plane_cap *plane;
          bool psr_feature_enabled = false;
-       bool replay_feature_enabled = false;
          int max_overlay = dm->dc->caps.max_slave_planes;
 
          dm->display_indexes_num = dm->dc->caps.max_streams;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -15
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
                  }
          }
 
-       if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-               switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-               case IP_VERSION(3, 1, 4):
-               case IP_VERSION(3, 1, 5):
-               case IP_VERSION(3, 1, 6):
-               case IP_VERSION(3, 2, 0):
-               case IP_VERSION(3, 2, 1):
-               case IP_VERSION(3, 5, 0):
-                       replay_feature_enabled = true;
-                       break;
-               default:
-                       replay_feature_enabled = amdgpu_dc_feature_mask
 & DC_REPLAY_MASK;
-                       break;
-               }
-       }
          /* loops over all connectors on the board */
          for (i = 0; i < link_cnt; i++) {
                  struct dc_link *link = NULL;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct
 amdgpu_device *adev)
 
 amdgpu_dm_update_connector_after_detect(aconnector);
                                  setup_backlight_device(dm, aconnector);
 
-                               /*
-                                * Disable psr if replay can be enabled
-                                */
-                               if (replay_feature_enabled &&
 amdgpu_dm_setup_replay(link, aconnector))
-                                       psr_feature_enabled = false;
-
                                  if (psr_feature_enabled)
                                          amdgpu_dm_set_psr_caps(link);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -7
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct
 work_struct *work)
           * fill_dc_dirty_rects().
           */
          if (vblank_work->stream && vblank_work->stream->link) {
-               /*
-                * Prioritize replay, instead of psr
-                */
-               if
 (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-                       amdgpu_dm_replay_enable(vblank_work->stream, false);
-               else if (vblank_work->enable) {
+               if (vblank_work->enable) {
                          if

(vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&

vblank_work->stream->link->psr_settings.psr_allow_active)

amdgpu_dm_psr_disable(vblank_work->stream);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct
 *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 

!amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
#endif
- vblank_work->stream->link->panel_config.psr.disallow_replay &&

vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
                          amdgpu_dm_psr_enable(vblank_work->stream);
                  }
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
          DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
          DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
          DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by

default
- DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn
< 3.1.4
};

  enum DC_DEBUG_MASK {
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
          DC_DISABLE_PSR = 0x10,
          DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
          DC_DISABLE_MPO = 0x40,
-       DC_DISABLE_REPLAY = 0x50,
          DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
--

2.34.1

#8 lore raw
In reply to [email protected]
Quoted 11 lines · On 10/2/23 13:47, [email protected] wrote:

From: Ivan Lipski <[email protected]>

This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d.

V2: Reword commit message

[WHY]
This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests.

Quoted 4 lines

[HOW]
Reverted the patch.

Applied, thanks!

Quoted 115 lines
---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |  9 +-------
  drivers/gpu/drm/amd/include/amd_shared.h      |  2 --
  3 files changed, 1 insertion(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -23
index 32156609fbcf..f69b2e9ecd98 100644
@@ -66,7 +66,6 @@
  #include "amdgpu_dm_debugfs.h"
  #endif
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
 
  #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -4423,7 +4422,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
  	enum dc_connection_type new_connection_type = dc_connection_none;
  	const struct dc_plane_cap *plane;
  	bool psr_feature_enabled = false;
-	bool replay_feature_enabled = false;
  	int max_overlay = dm->dc->caps.max_slave_planes;
 
  	dm->display_indexes_num = dm->dc->caps.max_streams;
@@ -4535,21 +4533,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
  		}
  	}
 
-	if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
-		switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-		case IP_VERSION(3, 1, 4):
-		case IP_VERSION(3, 1, 5):
-		case IP_VERSION(3, 1, 6):
-		case IP_VERSION(3, 2, 0):
-		case IP_VERSION(3, 2, 1):
-		case IP_VERSION(3, 5, 0):
-			replay_feature_enabled = true;
-			break;
-		default:
-			replay_feature_enabled = amdgpu_dc_feature_mask & DC_REPLAY_MASK;
-			break;
-		}
-	}
  	/* loops over all connectors on the board */
  	for (i = 0; i < link_cnt; i++) {
  		struct dc_link *link = NULL;
@@ -4618,12 +4601,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
  				amdgpu_dm_update_connector_after_detect(aconnector);
  				setup_backlight_device(dm, aconnector);
 
-				/*
-				 * Disable psr if replay can be enabled
-				 */
-				if (replay_feature_enabled && amdgpu_dm_setup_replay(link, aconnector))
-					psr_feature_enabled = false;
-
  				if (psr_feature_enabled)
  					amdgpu_dm_set_psr_caps(link);
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -8
index fb51ec4f8d31..440fc0869a34 100644
@@ -29,7 +29,6 @@
  #include "dc.h"
  #include "amdgpu.h"
  #include "amdgpu_dm_psr.h"
-#include "amdgpu_dm_replay.h"
  #include "amdgpu_dm_crtc.h"
  #include "amdgpu_dm_plane.h"
  #include "amdgpu_dm_trace.h"
@@ -124,12 +123,7 @@ static void vblank_control_worker(struct work_struct *work)
  	 * fill_dc_dirty_rects().
  	 */
  	if (vblank_work->stream && vblank_work->stream->link) {
-		/*
-		 * Prioritize replay, instead of psr
-		 */
-		if (vblank_work->stream->link->replay_settings.replay_feature_enabled)
-			amdgpu_dm_replay_enable(vblank_work->stream, false);
-		else if (vblank_work->enable) {
+		if (vblank_work->enable) {
  			if (vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&
  			    vblank_work->stream->link->psr_settings.psr_allow_active)
  				amdgpu_dm_psr_disable(vblank_work->stream);
@@ -138,7 +132,6 @@ static void vblank_control_worker(struct work_struct *work)
  #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
  			   !amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
  #endif
-			   vblank_work->stream->link->panel_config.psr.disallow_replay &&
  			   vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
  			amdgpu_dm_psr_enable(vblank_work->stream);
  		}
drivers/gpu/drm/amd/include/amd_shared.h +0 -2
index 314fd44ec018..ce75351204bb 100644
@@ -244,7 +244,6 @@ enum DC_FEATURE_MASK {
  	DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
  	DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
  	DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default
-	DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4
  };
 
  enum DC_DEBUG_MASK {
@@ -255,7 +254,6 @@ enum DC_DEBUG_MASK {
  	DC_DISABLE_PSR = 0x10,
  	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
  	DC_DISABLE_MPO = 0x40,
-	DC_DISABLE_REPLAY = 0x50,
  	DC_ENABLE_DPIA_TRACE = 0x80,
  };
 
Signature · 1 line
Hamza