]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Check hw_init state when determining if DMCUB is initialized
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Mon, 13 Jan 2020 14:00:46 +0000 (09:00 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 22 Jan 2020 21:55:28 +0000 (16:55 -0500)
[Why]
CW2 may already be programmed when coming back from S4. In this case
we want to unconditionally replace whatever DMCUB version is currently
enabled with the latest.

[How]
Check the hw_init flag to know whether or not we've previously executed
the initliazed routine.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

index ea99d4cf34cc68a9f04520291ada836809d2c949..85a518bf8a76b155cc75750fc0add87d25263ca4 100644 (file)
@@ -312,6 +312,9 @@ enum dmub_status dmub_srv_is_hw_init(struct dmub_srv *dmub, bool *is_hw_init)
        if (!dmub->sw_init)
                return DMUB_STATUS_INVALID;
 
+       if (!dmub->hw_init)
+               return DMUB_STATUS_OK;
+
        if (dmub->hw_funcs.is_hw_init)
                *is_hw_init = dmub->hw_funcs.is_hw_init(dmub);