drm/amd/display: add addition dc type to translate to dmub fw type
[Why] For a type like PSR version, it makes sense for most of the code to include a dc type, instead of having this a fw type define since this is a capability and type exposed by dc. Especially if it doesn't even need to communicate with the fw. The code that is packing the firmware command message should be the one who needs to translate the psr version into a command that the firmware understands. [How] Add a dc_psr_version enum. Signed-off-by: Anthony Koo <Anthony.Koo@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
492548dcb0
commit
1cfbbddead
@ -94,12 +94,20 @@ static bool dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state *
|
||||
union dmub_rb_cmd cmd;
|
||||
struct dc_context *dc = dmub->ctx;
|
||||
|
||||
if (stream->link->psr_settings.psr_version == PSR_VERSION_UNSUPPORTED)
|
||||
if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED)
|
||||
return false;
|
||||
|
||||
cmd.psr_set_version.header.type = DMUB_CMD__PSR;
|
||||
cmd.psr_set_version.header.sub_type = DMUB_CMD__PSR_SET_VERSION;
|
||||
cmd.psr_set_version.psr_set_version_data.version = stream->link->psr_settings.psr_version;
|
||||
switch (stream->link->psr_settings.psr_version) {
|
||||
case DC_PSR_VERSION_1:
|
||||
cmd.psr_set_version.psr_set_version_data.version = PSR_VERSION_1;
|
||||
break;
|
||||
case DC_PSR_VERSION_UNSUPPORTED:
|
||||
default:
|
||||
cmd.psr_set_version.psr_set_version_data.version = PSR_VERSION_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
cmd.psr_set_version.header.payload_bytes = sizeof(struct dmub_cmd_psr_set_version_data);
|
||||
|
||||
dc_dmub_srv_cmd_queue(dc->dmub_srv, &cmd);
|
||||
|
Reference in New Issue
Block a user