drm/amd/display: Pass panel inst to a PSR command
authorMikita Lipski <mikita.lipski@amd.com>
Thu, 4 Nov 2021 20:51:55 +0000 (16:51 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Nov 2021 21:58:05 +0000 (16:58 -0500)
[why]
PSR set power command wasn't setting panel instance
and command version which caused both streams
to overwrite the same PSR state.
[how]
Pass panel instance to the set power command function
and to DMUB and set command version enum

Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.h

index 01c1f518eab0a6a12dce9d51d82e8e02d0563cde..d856f08491de2d1fd221bec6524fe3d600fcc09a 100644 (file)
@@ -2997,7 +2997,7 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active
                link->psr_settings.psr_power_opt = *power_opts;
 
                if (psr != NULL && link->psr_settings.psr_feature_enabled && psr->funcs->psr_set_power_opt)
-                       psr->funcs->psr_set_power_opt(psr, link->psr_settings.psr_power_opt);
+                       psr->funcs->psr_set_power_opt(psr, link->psr_settings.psr_power_opt, panel_inst);
        }
 
        /* Enable or Disable PSR */
index 90eb8eedacf2a7dae7ea439d4e2177f124559136..e9c0ec2ec4cece6b17489961b24156439d81374b 100644 (file)
@@ -230,7 +230,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level, uint8_
 /**
  * Set PSR power optimization flags.
  */
-static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt)
+static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt, uint8_t panel_inst)
 {
        union dmub_rb_cmd cmd;
        struct dc_context *dc = dmub->ctx;
@@ -239,7 +239,9 @@ static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt
        cmd.psr_set_power_opt.header.type = DMUB_CMD__PSR;
        cmd.psr_set_power_opt.header.sub_type = DMUB_CMD__SET_PSR_POWER_OPT;
        cmd.psr_set_power_opt.header.payload_bytes = sizeof(struct dmub_cmd_psr_set_power_opt_data);
+       cmd.psr_set_power_opt.psr_set_power_opt_data.cmd_version = DMUB_CMD_PSR_CONTROL_VERSION_1;
        cmd.psr_set_power_opt.psr_set_power_opt_data.power_opt = power_opt;
+       cmd.psr_set_power_opt.psr_set_power_opt_data.panel_inst = panel_inst;
 
        dc_dmub_srv_cmd_queue(dc->dmub_srv, &cmd);
        dc_dmub_srv_cmd_execute(dc->dmub_srv);
index 5dbd479660f1aff522987ab8e8c6d4800c946504..01acc01cc191127d2ea47010b4141edf4ff77d4c 100644 (file)
@@ -46,7 +46,7 @@ struct dmub_psr_funcs {
        void (*psr_force_static)(struct dmub_psr *dmub, uint8_t panel_inst);
        void (*psr_get_residency)(struct dmub_psr *dmub, uint32_t *residency,
        uint8_t panel_inst);
-       void (*psr_set_power_opt)(struct dmub_psr *dmub, unsigned int power_opt);
+       void (*psr_set_power_opt)(struct dmub_psr *dmub, unsigned int power_opt, uint8_t panel_inst);
 };
 
 struct dmub_psr *dmub_psr_create(struct dc_context *ctx);