drm/amd/display: Add debugfs to disallow eDP Replay entry

[Why & How]
Test applications need to read CRC from eDP sink side, but sink
replay feature prevents proper CRC reading and causing timeout.

Add disallow_edp_enter_replay debugfs interface to allow test apps
to temporarily disable Replay for CRC operations.

Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Signed-off-by: Chuanyu Tseng <chuanyu.tseng@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Ray Wu
2026-03-02 10:26:51 +08:00
committed by Alex Deucher
parent 25bb1d54ba
commit f7168d1a8d

View File

@@ -3305,6 +3305,52 @@ static int disallow_edp_enter_psr_set(void *data, u64 val)
return 0;
}
/* check if kernel disallow eDP enter replay state
* cat /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_replay
* 0: allow edp enter replay; 1: disallow
*/
static int disallow_edp_enter_replay_get(void *data, u64 *val)
{
struct amdgpu_dm_connector *aconnector = data;
*val = (u64) aconnector->disallow_edp_enter_replay;
return 0;
}
/* set kernel disallow eDP enter replay state
* echo 0x0 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_replay
* 0: allow edp enter replay; 1: disallow
*
* usage: test app read crc from PSR eDP rx.
*
* during kernel boot up, kernel write dpcd 0x37b to
* notify eDP rx replay enable.
* rx fw will start checking crc for rx internal logic.
* crc read count within dpcd 0x246 is not updated and
* value is 0. when eDP tx driver wants to read rx crc
* from dpcd 0x246, 0x270, read count 0 lead tx driver
* timeout.
*
* to avoid this, we add this debugfs to let test app to disbable
* rx replay. then test app can read non-zero crc read count.
*
* expected app sequence is as below:
* 1. disable eDP PHY and notify eDP rx with dpcd 0x600 = 2.
* 2. echo 0x1 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_replay
* 3. enable eDP PHY and notify eDP rx with dpcd 0x600 = 1 but
* without programming dpcd 0x37b.
* 4. read crc from rx dpcd 0x270, 0x246, etc.
* 5. echo 0x0 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_replay.
* this will let eDP back to normal with replay setup dpcd 0x37b.
*/
static int disallow_edp_enter_replay_set(void *data, u64 val)
{
struct amdgpu_dm_connector *aconnector = data;
aconnector->disallow_edp_enter_replay = val ? true : false;
return 0;
}
static int dmub_trace_mask_set(void *data, u64 val)
{
struct amdgpu_device *adev = data;
@@ -3433,6 +3479,10 @@ DEFINE_DEBUGFS_ATTRIBUTE(disallow_edp_enter_psr_fops,
disallow_edp_enter_psr_get,
disallow_edp_enter_psr_set, "%llu\n");
DEFINE_DEBUGFS_ATTRIBUTE(disallow_edp_enter_replay_fops,
disallow_edp_enter_replay_get,
disallow_edp_enter_replay_set, "%llu\n");
DEFINE_DEBUGFS_ATTRIBUTE(ips_residency_cntl_fops, ips_residency_cntl_get,
ips_residency_cntl_set, "%llu\n");
DEFINE_SHOW_ATTRIBUTE(current_backlight);
@@ -3635,6 +3685,8 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector)
&allow_edp_hotplug_detection_fops);
debugfs_create_file("disallow_edp_enter_psr", 0644, dir, connector,
&disallow_edp_enter_psr_fops);
debugfs_create_file("disallow_edp_enter_replay", 0644, dir, connector,
&disallow_edp_enter_replay_fops);
}
for (i = 0; i < ARRAY_SIZE(connector_debugfs_entries); i++) {