]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Add pwait status to DMCUB diagnostics
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 14 May 2025 20:28:06 +0000 (16:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jun 2025 16:19:20 +0000 (12:19 -0400)
[Why]
To know if the firmware is idle when logging.

[How]
Add the pwait status to the DMCUB diagnostics.

Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c

index 211486724e8486bf01594fc92e451124e117860e..479db84fcdc2e161f2f159764e2212f343ef74f0 100644 (file)
@@ -356,6 +356,7 @@ struct dmub_diagnostic_data {
        uint8_t is_traceport_en : 1;
        uint8_t is_cw0_enabled : 1;
        uint8_t is_cw6_enabled : 1;
+       uint8_t is_pwait : 1;
 };
 
 struct dmub_srv_inbox {
index a308bd6046778368d0f12e2887bf95ddb10f44d9..3f38db752b84462c8319b90e581aa6b6be8f5606 100644 (file)
@@ -416,7 +416,7 @@ uint32_t dmub_dcn31_get_current_time(struct dmub_srv *dmub)
 
 void dmub_dcn31_get_diagnostic_data(struct dmub_srv *dmub)
 {
-       uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset;
+       uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset, is_pwait;
        uint32_t is_traceport_enabled, is_cw0_enabled, is_cw6_enabled;
        struct dmub_timeout_info timeout = {0};
 
@@ -466,6 +466,9 @@ void dmub_dcn31_get_diagnostic_data(struct dmub_srv *dmub)
        REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
        dmub->debug.is_dmcub_enabled = is_dmub_enabled;
 
+       REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
+       dmub->debug.is_pwait = is_pwait;
+
        REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
        dmub->debug.is_dmcub_soft_reset = is_soft_reset;
 
index 2884977a3dd2f03f82a71e16ce6ff728b1b1979a..2228d62adc7e465c9c317bd1c0fb6024644a13f7 100644 (file)
@@ -454,7 +454,7 @@ uint32_t dmub_dcn35_get_current_time(struct dmub_srv *dmub)
 
 void dmub_dcn35_get_diagnostic_data(struct dmub_srv *dmub)
 {
-       uint32_t is_dmub_enabled, is_soft_reset;
+       uint32_t is_dmub_enabled, is_soft_reset, is_pwait;
        uint32_t is_traceport_enabled, is_cw6_enabled;
        struct dmub_timeout_info timeout = {0};
 
@@ -505,6 +505,9 @@ void dmub_dcn35_get_diagnostic_data(struct dmub_srv *dmub)
        REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
        dmub->debug.is_dmcub_enabled = is_dmub_enabled;
 
+       REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
+       dmub->debug.is_pwait = is_pwait;
+
        REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
        dmub->debug.is_dmcub_soft_reset = is_soft_reset;
 
index 2575dbc448f70953f449afbceba401f8d86b6487..b31adbd0d685f16e4c9a4117ded9165b84c9536b 100644 (file)
@@ -413,7 +413,7 @@ uint32_t dmub_dcn401_get_current_time(struct dmub_srv *dmub)
 
 void dmub_dcn401_get_diagnostic_data(struct dmub_srv *dmub)
 {
-       uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset;
+       uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset, is_pwait;
        uint32_t is_traceport_enabled, is_cw0_enabled, is_cw6_enabled;
        struct dmub_timeout_info timeout = {0};
 
@@ -464,6 +464,9 @@ void dmub_dcn401_get_diagnostic_data(struct dmub_srv *dmub)
        REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
        dmub->debug.is_dmcub_enabled = is_dmub_enabled;
 
+       REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
+       dmub->debug.is_pwait = is_pwait;
+
        REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
        dmub->debug.is_dmcub_soft_reset = is_soft_reset;