summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
diff options
context:
space:
mode:
authorMeenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>2021-04-30 19:02:33 -0400
committerAlex Deucher <alexander.deucher@amd.com>2021-10-06 15:52:11 -0400
commit71af9d465bedb3f757056beb3f6985201cef0a5d (patch)
treed1486abb594eeadb646843808e5454f99bd639e6 /drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
parent80789bcffec34b5c6b65f33e3c46bf859dc25888 (diff)
downloadlinux-71af9d465bedb3f757056beb3f6985201cef0a5d.tar.bz2
drm/amd/display: Support for SET_CONFIG processing with DMUB
[Why] To process SET_CONFIG transactions with DMUB using inbox1 and outbox1 mail boxes. [How] 1) Added inbox1 DPIA command subtype DMUB_CMD__DPIA_SET_CONFIG_ACCESS to issue SET_CONFIG command to DMUB in dc_process_dmub_set_config_async(). DMUB processes the command with DPIA sends reply back immediately or in an outbox1 message triggering an outbox1 interrupt to driver. 2) DMUB posts SET_CONFIG reply as an Outbox1 message of type DMUB_OUT_CMD__SET_CONFIG_REPLY. 3) The dmub async to sync mechanism for AUX is modified to accommodate SET_CONFIG commands for both command issue and reply code paths. Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Wayne Lin <Wayne.Lin@amd.com> Acked-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
index 15dbea3518cf..6d0ddc82e6c8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
@@ -32,6 +32,8 @@
#include "dpcd_defs.h"
#include "link_hwss.h"
#include "inc/link_dpcd.h"
+#include "dm_helpers.h"
+#include "dmub/inc/dmub_cmd.h"
#define DC_LOGGER \
link->ctx->logger
@@ -92,10 +94,18 @@ static enum link_training_result dpia_configure_link(struct dc_link *link,
}
static enum dc_status core_link_send_set_config(struct dc_link *link,
- uint8_t msg_type, uint8_t msg_data)
+ uint8_t msg_type,
+ uint8_t msg_data)
{
- /** @todo Implement */
- return DC_OK;
+ struct set_config_cmd_payload payload;
+ enum set_config_status set_config_result = SET_CONFIG_PENDING;
+
+ /* prepare set_config payload */
+ payload.msg_type = msg_type;
+ payload.msg_data = msg_data;
+
+ /* set_config should return ACK if successful */
+ return (set_config_result == SET_CONFIG_ACK_RECEIVED) ? DC_OK : DC_ERROR_UNEXPECTED;
}
/* Build SET_CONFIG message data payload for specified message type. */