drm/amd/display: Hookup psr set version call
authorWyatt Wood <wyatt.wood@amd.com>
Thu, 16 Jan 2020 22:53:09 +0000 (17:53 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Feb 2020 16:49:54 +0000 (11:49 -0500)
[Why]
Set version is currently not called.

[How]
Add call to set version from copy settings. This
should be the only time this is called as the eDP
caps should never change.

Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.h

index 59cdd8ea31fb8288c43ea838050ce0edc8630676..cacb46979f3146bc34fda0326c1ab52ca5b62b33 100644 (file)
@@ -42,17 +42,19 @@ static void dmub_psr_get_state(uint32_t *psr_state)
        // Trigger GPINT interrupt from firmware
 }
 
-static void dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state *stream)
+/**
+ * Set PSR version.
+ */
+static bool dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state *stream)
 {
-       //stream->psr_version;
        union dmub_rb_cmd cmd;
        struct dc_context *dc = dmub->ctx;
 
        cmd.psr_set_version.header.type = DMUB_CMD__PSR;
        cmd.psr_set_version.header.sub_type = DMUB_CMD__PSR_SET_VERSION;
 
-       if (stream->psr_version == 0x0)
-               return;
+       if (stream->psr_version == 0x0) // Unsupported
+               return false;
        else if (stream->psr_version == 0x1)
                cmd.psr_set_version.psr_set_version_data.version = PSR_VERSION_1;
        else if (stream->psr_version == 0x2)
@@ -63,6 +65,8 @@ static void dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state *
        dc_dmub_srv_cmd_queue(dc->dmub_srv, &cmd.psr_enable.header);
        dc_dmub_srv_cmd_execute(dc->dmub_srv);
        dc_dmub_srv_wait_idle(dc->dmub_srv);
+
+       return true;
 }
 
 /**
@@ -139,6 +143,10 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub,
        if (!pipe_ctx || !&pipe_ctx->plane_res || !&pipe_ctx->stream_res)
                return false;
 
+       // First, set the psr version
+       if (!dmub_psr_set_version(dmub, pipe_ctx->stream))
+               return false;
+
        // Program DP DPHY fast training registers
        link->link_enc->funcs->psr_program_dp_dphy_fast_training(link->link_enc,
                        psr_context->psrExitLinkTrainingRequired);
@@ -186,7 +194,6 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub,
 }
 
 static const struct dmub_psr_funcs psr_funcs = {
-       .psr_set_version                = dmub_psr_set_version,
        .psr_copy_settings              = dmub_psr_copy_settings,
        .psr_enable                     = dmub_psr_enable,
        .psr_get_state                  = dmub_psr_get_state,
index 4fe8b53d9551d66ae8c51a142ae0fc764ec03be0..5e8553d450c93553f483c39dd288d80298b2d609 100644 (file)
@@ -34,7 +34,6 @@ struct dmub_psr {
 };
 
 struct dmub_psr_funcs {
-       void (*psr_set_version)(struct dmub_psr *dmub, struct dc_stream_state *stream);
        bool (*psr_copy_settings)(struct dmub_psr *dmub, struct dc_link *link, struct psr_context *psr_context);
        void (*psr_enable)(struct dmub_psr *dmub, bool enable);
        void (*psr_get_state)(uint32_t *psr_state);