drm/amd/display: Add power down display on boot flag
authorThomas Lim <Thomas.Lim@amd.com>
Wed, 10 Apr 2019 21:06:07 +0000 (17:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Apr 2019 19:58:53 +0000 (14:58 -0500)
[Why]

Due to the generic introduction of seamless boot, the display is no
longer blanked upon boot. However, this causes corruption on some
systems that does not lock the memory in the non-secure boot case,
resulting in brief corruption on boot due to garbage being written into
the frame buffer.

[How]
Add a flag, read during DC init, to determine whether display should be
blanked on boot. Default to true.

Signed-off-by: Thomas Lim <Thomas.Lim@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

index 4e7af55944590caf1e490995ce7e0ef2221570c1..a7e6f45a375c6d6dfe79efb7f9b51804d1fe83eb 100644 (file)
@@ -534,6 +534,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
        if (amdgpu_dc_feature_mask & DC_FBC_MASK)
                init_data.flags.fbc_support = true;
 
+       init_data.flags.power_down_display_on_boot = true;
+
        /* Display Core create. */
        adev->dm.dc = dc_create(&init_data);
 
index aa2954dda129580fdb6b91d6607c526b3aad5f46..70edd9ea5afeb33c4aec0df53e71e654fe813022 100644 (file)
@@ -204,6 +204,7 @@ struct dc_config {
        bool optimize_edp_link_rate;
        bool disable_fractional_pwm;
        bool allow_seamless_boot_optimization;
+       bool power_down_display_on_boot;
 };
 
 enum visual_confirm {
index 549836c60220c0e7f8cadc1923920dd19f747492..7e173c74907c7e3dee77675553896e626352a0d8 100644 (file)
@@ -1118,7 +1118,7 @@ static void dcn10_init_hw(struct dc *dc)
         * Otherwise, if taking control is not possible, we need to power
         * everything down.
         */
-       if (dcb->funcs->is_accelerated_mode(dcb)) {
+       if (dcb->funcs->is_accelerated_mode(dcb) || dc->config.power_down_display_on_boot) {
                for (i = 0; i < dc->res_pool->pipe_count; i++) {
                        struct hubp *hubp = dc->res_pool->hubps[i];
                        struct dpp *dpp = dc->res_pool->dpps[i];