OSDN Git Service

drm/amd/display: enable seamless boot for DCN301
authorZhan Liu <Zhan.Liu@amd.com>
Tue, 9 Nov 2021 00:31:00 +0000 (19:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Nov 2021 19:59:13 +0000 (14:59 -0500)
[Why]
DCN301 is capable of running seamless boot
if keep_stolen_vga_memory is not set.

[How]
Add a helper to check whether an ASIC can support
seamless boot and set it based on base driver flags.

Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Zhan Liu <Zhan.Liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@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/amdgpu_dm/amdgpu_dm.h
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c

index 3845d7e..6aadb1b 100644 (file)
@@ -1454,6 +1454,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
        init_data.flags.power_down_display_on_boot = true;
 
+       if (check_seamless_boot_capability(adev)) {
+               init_data.flags.power_down_display_on_boot = false;
+               init_data.flags.allow_seamless_boot_optimization = true;
+               DRM_INFO("Seamless boot condition check passed\n");
+       }
+
        INIT_LIST_HEAD(&adev->dm.da_list);
        /* Display Core create. */
        adev->dm.dc = dc_create(&init_data);
@@ -11616,3 +11622,24 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(bool is_cmd_aux, struct dc_context
                        ctx, DMUB_ASYNC_TO_SYNC_ACCESS_SUCCESS,
                        (uint32_t *)operation_result);
 }
+
+/*
+ * Check whether seamless boot is supported.
+ *
+ * So far we only support seamless boot on CHIP_VANGOGH.
+ * If everything goes well, we may consider expanding
+ * seamless boot to other ASICs.
+ */
+bool check_seamless_boot_capability(struct amdgpu_device *adev)
+{
+       switch (adev->asic_type) {
+       case CHIP_VANGOGH:
+               if (!adev->mman.keep_stolen_vga_memory)
+                       return true;
+               break;
+       default:
+               break;
+       }
+
+       return false;
+}
index 37e61a8..bb65f41 100644 (file)
@@ -731,4 +731,7 @@ extern const struct drm_encoder_helper_funcs amdgpu_dm_encoder_helper_funcs;
 int amdgpu_dm_process_dmub_aux_transfer_sync(bool is_cmd_aux,
                                        struct dc_context *ctx, unsigned int link_index,
                                        void *payload, void *operation_result);
+
+bool check_seamless_boot_capability(struct amdgpu_device *adev);
+
 #endif /* __AMDGPU_DM_H__ */
index 564163a..1da91f2 100644 (file)
@@ -2078,7 +2078,6 @@ static void mark_seamless_boot_stream(
 {
        struct dc_bios *dcb = dc->ctx->dc_bios;
 
-       /* TODO: Check Linux */
        if (dc->config.allow_seamless_boot_optimization &&
                        !dcb->funcs->is_accelerated_mode(dcb)) {
                if (dc_validate_seamless_boot_timing(dc, stream->sink, &stream->timing))
index e3596a5..7abc36a 100644 (file)
@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = {
        .disable_clock_gate = true,
        .disable_pplib_clock_request = true,
        .disable_pplib_wm_range = true,
-       .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP,
+       .pipe_split_policy = MPC_SPLIT_AVOID,
        .force_single_disp_pipe_split = false,
        .disable_dcc = DCC_ENABLE,
        .vsr_support = true,