diff options
author | Wyatt Wood <wyatt.wood@amd.com> | 2020-10-21 13:13:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-12-08 23:03:46 -0500 |
commit | 92f1fa0d67a88d5c3992f1ddd7bab30a42f43eb8 (patch) | |
tree | 31125b56cabd5570357fc48bf8f52b1de701efaf /drivers/gpu/drm/amd/display/dmub/src | |
parent | 42ddf36e6720fc26dafd9cbd41322706eacf87d5 (diff) | |
download | linux-92f1fa0d67a88d5c3992f1ddd7bab30a42f43eb8.tar.gz linux-92f1fa0d67a88d5c3992f1ddd7bab30a42f43eb8.tar.bz2 linux-92f1fa0d67a88d5c3992f1ddd7bab30a42f43eb8.zip |
drm/amd/display: Add support for runtime feature detection command
[Why]
Add support for new fw command for runtime feature detection.
[How]
Driver sends command through ring buffer, and fw returns data back
through this command.
Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Eryk Brol <eryk.brol@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dmub/src')
-rw-r--r-- | drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c index ba8494cf005f..f388d36af0b6 100644 --- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -648,3 +648,32 @@ enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub, return DMUB_STATUS_OK; } + +enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub, + union dmub_rb_cmd *cmd) +{ + enum dmub_status status = DMUB_STATUS_OK; + + // Queue command + status = dmub_srv_cmd_queue(dmub, cmd); + + if (status != DMUB_STATUS_OK) + return status; + + // Execute command + status = dmub_srv_cmd_execute(dmub); + + if (status != DMUB_STATUS_OK) + return status; + + // Wait for DMUB to process command + status = dmub_srv_wait_for_idle(dmub, 100000); + + if (status != DMUB_STATUS_OK) + return status; + + // Copy data back from ring buffer into command + dmub_rb_get_return_data(&dmub->inbox1_rb, cmd); + + return status; +} |