Skip to contentSkip to conversation

Enable seamless boot more widely

PATCH In review Mario Limonciello 3 participants 8 messages Sep 13, 2023 – Sep 26, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Enable seamless boot more widely

Seamless boot allows keeping the content on the framebuffer from pre-boot so the screen doesn't get "painted black" during boot process.

Ideally the flow looks like:
* UEFI F/W posts vendor logo
* GRUB doesn't show anything, but silently continues
* Plymouth starts and adds OS logo to bottom and spinner
* Simple DRM loads, no mode changes
* amdgpu loads, no mode changes
* Spinner keeps spinning
* GDM starts up

Previously this was only enabled on Van Gogh, but this series enables the functionality more widely onto DCN3.0+.

This also introduces a kernel module parameter that to easily force it enabled on other ASICs too, which may be useful to adjust policy.

Mario Limonciello (4):
drm/amd: Drop special case for yellow carp without discovery drm/amd: Move seamless boot check out of display drm/amd: Add a module parameter for seamless boot drm/amd: Enable seamless boot by default on newer ASICs

 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 28 +++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  8 ++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       |  6 ----
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 +--------------
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  2 --
 6 files changed, 39 insertions(+), 30 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 drm/amd: Drop special case for yellow carp without discovery

amdgpu_gmc_get_vbios_allocations has a special case for how to bring up yellow carp when amdgpu discovery is turned off. As this ASIC ships with discovery turned on, it's generally dead code and worse it causes adev->mman.keep_stolen_vga_memory to not be initialized for yellow carp.

Remove it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -6
index de7b379a9cc8..c7793db6d098 100644
@@ -725,12 +725,6 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
 	case CHIP_RENOIR:
 		adev->mman.keep_stolen_vga_memory = true;
 		break;
-	case CHIP_YELLOW_CARP:
-		if (amdgpu_discovery == 0) {
-			adev->mman.stolen_reserved_offset = 0x1ffb0000;
-			adev->mman.stolen_reserved_size = 64 * PAGE_SIZE;
-		}
-		break;
 	default:
 		adev->mman.keep_stolen_vga_memory = false;
 		break;
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/4 drm/amd: Move seamless boot check out of display

In reply to Mario Limonciello

This will allow base driver to dictate whether seamless should be enabled. No intended functional changes.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 21 +++++++++++++++++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 +------------------
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  2 --
 4 files changed, 23 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 30f44db6c9c5..38a10d6be921 100644
@@ -1327,6 +1327,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
 int amdgpu_device_pci_reset(struct amdgpu_device *adev);
 bool amdgpu_device_need_post(struct amdgpu_device *adev);
+bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev);
 bool amdgpu_device_pcie_dynamic_switching_supported(void);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
 bool amdgpu_device_aspm_support_quirk(void);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +21 -0
index ca56b5a543b4..7187eeb8ffa6 100644
@@ -1358,6 +1358,27 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
 	return true;
 }
 
+/*
+ * Check whether seamless boot is supported.
+ *
+ * So far we only support seamless boot on select ASICs.
+ * If everything goes well, we may consider expanding
+ * seamless boot to other ASICs.
+ */
+bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
+{
+	switch (adev->ip_versions[DCE_HWIP][0]) {
+	case IP_VERSION(3, 0, 1):
+		if (!adev->mman.keep_stolen_vga_memory)
+			return true;
+		break;
+	default:
+		break;
+	}
+
+	return false;
+}
+
 /*
  * Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
  * speed switching. Until we have confirmation from Intel that a specific host
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -22
index 933c9b5d5252..725fad6c8efe 100644
@@ -1680,7 +1680,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.flags.seamless_boot_edp_requested = false;
 
-	if (check_seamless_boot_capability(adev)) {
+	if (amdgpu_device_seamless_boot_supported(adev)) {
 		init_data.flags.seamless_boot_edp_requested = true;
 		init_data.flags.allow_seamless_boot_optimization = true;
 		DRM_INFO("Seamless boot condition check passed\n");
@@ -10997,27 +10997,6 @@ int amdgpu_dm_process_dmub_set_config_sync(
 	return ret;
 }
 
-/*
- * 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 (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
-	case IP_VERSION(3, 0, 1):
-		if (!adev->mman.keep_stolen_vga_memory)
-			return true;
-		break;
-	default:
-		break;
-	}
-
-	return false;
-}
-
 bool dm_execute_dmub_cmd(const struct dc_context *ctx, union dmub_rb_cmd *cmd, enum dm_dmub_wait_type wait_type)
 {
 	return dc_dmub_srv_cmd_run(ctx->dmub_srv, cmd, wait_type);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +0 -2
index 9e4cc5eeda76..3d480be802cb 100644
@@ -825,8 +825,6 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(struct dc_context *ctx, unsigned in
 int amdgpu_dm_process_dmub_set_config_sync(struct dc_context *ctx, unsigned int link_index,
 					struct set_config_cmd_payload *payload, enum set_config_status *operation_result);
 
-bool check_seamless_boot_capability(struct amdgpu_device *adev);
-
 struct dc_stream_state *
 	create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
 					const struct drm_display_mode *drm_mode,
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 3/4 drm/amd: Add a module parameter for seamless boot

In reply to Mario Limonciello

The module parameter can be used to test more easily enabling seamless boot support on additional ASICs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    |  8 ++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 38a10d6be921..875448c44afa 100644
@@ -246,6 +246,7 @@ extern int amdgpu_num_kcq;
 extern int amdgpu_vcnfw_log;
 extern int amdgpu_sg_display;
 extern int amdgpu_umsch_mm;
+extern int amdgpu_seamless;
 
 extern int amdgpu_user_partt_mode;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +17 -3
index 7187eeb8ffa6..2116e016178a 100644
@@ -1367,11 +1367,25 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
  */
 bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
 {
+	switch (amdgpu_seamless) {
+	case -1:
+		break;
+	case 1:
+		return true;
+	case 0:
+		return false;
+	default:
+		DRM_ERROR("Invalid value for amdgpu.seamless: %d\n",
+			  amdgpu_seamless);
+		return false;
+	}
+
+	if (adev->mman.keep_stolen_vga_memory)
+		return false;
+
 	switch (adev->ip_versions[DCE_HWIP][0]) {
 	case IP_VERSION(3, 0, 1):
-		if (!adev->mman.keep_stolen_vga_memory)
-			return true;
-		break;
+		return true;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +8 -0
index 90d6c5e5d66d..e3471293846f 100644
@@ -203,6 +203,7 @@ int amdgpu_vcnfw_log;
 int amdgpu_sg_display = -1; /* auto */
 int amdgpu_user_partt_mode = AMDGPU_AUTO_COMPUTE_PARTITION_MODE;
 int amdgpu_umsch_mm;
+int amdgpu_seamless = -1; /* auto */
 uint amdgpu_debug_mask;
 
 static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
@@ -938,6 +939,13 @@ module_param_named(user_partt_mode, amdgpu_user_partt_mode, uint, 0444);
 module_param(enforce_isolation, bool, 0444);
 MODULE_PARM_DESC(enforce_isolation, "enforce process isolation between graphics and compute . enforce_isolation = on");
 
+/**
+ * DOC: seamless (int)
+ * Seamless boot will keep the image on the screen during the boot process.
+ */
+MODULE_PARM_DESC(seamless, "Seamless boot (-1 = auto (default), 0 = disable, 1 = enable)");
+module_param_named(seamless, amdgpu_seamless, int, 0444);
+
 /**
  * DOC: debug_mask (uint)
  * Debug options for amdgpu, work as a binary mask with the following options:
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 4/4 drm/amd: Enable seamless boot by default on newer ASICs

In reply to Mario Limonciello

Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later.

If users report using the module parameter that it works on older ASICs as well, this can be adjusted.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -11
index 2116e016178a..38fafed31a1b 100644
@@ -1361,9 +1361,9 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
 /*
  * Check whether seamless boot is supported.
  *
- * So far we only support seamless boot on select ASICs.
- * If everything goes well, we may consider expanding
- * seamless boot to other ASICs.
+ * So far we only support seamless boot on DCE 3.0 or later.
+ * If users report that it works on older ASICS as well, we may
+ * loosen this.
  */
 bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
 {
@@ -1383,14 +1383,7 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
 	if (adev->mman.keep_stolen_vga_memory)
 		return false;
 
-	switch (adev->ip_versions[DCE_HWIP][0]) {
-	case IP_VERSION(3, 0, 1):
-		return true;
-	default:
-		break;
-	}
-
-	return false;
+	return adev->ip_versions[DCE_HWIP][0] > IP_VERSION(3, 0, 0);
 }
 
 /*
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 4/4
#5 lore raw

Re: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

Quoted 8 lines · Mario Limonciello

Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later.

If users report using the module parameter that it works on older ASICs as well, this can be adjusted.

Harry

Quoted 37 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++-----------
  1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -11
index 2116e016178a..38fafed31a1b 100644
@@ -1361,9 +1361,9 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
  /*
   * Check whether seamless boot is supported.
   *
- * So far we only support seamless boot on select ASICs.
- * If everything goes well, we may consider expanding
- * seamless boot to other ASICs.
+ * So far we only support seamless boot on DCE 3.0 or later.
+ * If users report that it works on older ASICS as well, we may
+ * loosen this.
   */
  bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
  {
@@ -1383,14 +1383,7 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
  	if (adev->mman.keep_stolen_vga_memory)
  		return false;
 
-	switch (adev->ip_versions[DCE_HWIP][0]) {
-	case IP_VERSION(3, 0, 1):
-		return true;
-	default:
-		break;
-	}
-
-	return false;
+	return adev->ip_versions[DCE_HWIP][0] > IP_VERSION(3, 0, 0);
  }
 
  /*
#6 lore raw

RE: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

In reply to Mario Limonciello

[AMD Official Use Only - General]

Hi Mario,

Navi32 which DCE3.2.0 not support this. This patch will cause modprobe fail on NV32.

[ +0.000126] [drm] DSC precompute is not needed.
[ +19.026503] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000 [ +0.000002] amdgpu 0000:03:00.0: amdgpu: Failed to power gate JPEG!
[ +0.000001] [drm:amdgpu_dpm_enable_jpeg [amdgpu]] *ERROR* Dpm disable jpeg failed, ret = -62.
[9月26 11:00] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000

[  +0.000001] amdgpu 0000:03:00.0: amdgpu: Failed to power gate VCN!
[  +0.000000] [drm:amdgpu_dpm_enable_uvd [amdgpu]] *ERROR* Dpm disable uvd failed, ret = -62.
[  +3.557018] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000

[ +16.269817] watchdog: BUG: soft lockup - CPU#7 stuck for 26s! [modprobe:28704]

Either change to:
return adev->ip_versions[DCE_HWIP][0] == IP_VERSION(3, 2, 0);

Or revert [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs both ok.

Thanks,
Feifei

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, September 14, 2023 1:15 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Limonciello, Mario <[email protected]>
Subject: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later.

If users report using the module parameter that it works on older ASICs as well, this can be adjusted.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -3
index 2116e016178a..38fafed31a1b 100644
@@ -1361,9 +1361,9 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
 /*
  * Check whether seamless boot is supported.
  *
- * So far we only support seamless boot on select ASICs.
- * If everything goes well, we may consider expanding
- * seamless boot to other ASICs.
+ * So far we only support seamless boot on DCE 3.0 or later.
+ * If users report that it works on older ASICS as well, we may
+ * loosen this.
  */
 bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)  { @@ -1383,14 +1383,7 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
        if (adev->mman.keep_stolen_vga_memory)
                return false;

- switch (adev->ip_versions[DCE_HWIP][0]) {
- case IP_VERSION(3, 0, 1):
- return true;
- default:
- break;
- }
-
- return false;
+ return adev->ip_versions[DCE_HWIP][0] > IP_VERSION(3, 0, 0);
}

/*
--
2.34.1

#7 lore raw

Re: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

Hi Feifei,

Quoted 11 lines · Feifei

[AMD Official Use Only - General]

Hi Mario,

Navi32 which DCE3.2.0 not support this. This patch will cause modprobe fail on NV32.

[ +0.000126] [drm] DSC precompute is not needed.
[ +19.026503] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000 [ +0.000002] amdgpu 0000:03:00.0: amdgpu: Failed to power gate JPEG!
[ +0.000001] [drm:amdgpu_dpm_enable_jpeg [amdgpu]] *ERROR* Dpm disable jpeg failed, ret = -62.
[9月26 11:00] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000

Quoted 8 lines
[  +0.000001] amdgpu 0000:03:00.0: amdgpu: Failed to power gate VCN!
[  +0.000000] [drm:amdgpu_dpm_enable_uvd [amdgpu]] *ERROR* Dpm disable uvd failed, ret = -62.
[  +3.557018] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000002D SMN_C2PMSG_82:0x00000000

[ +16.269817] watchdog: BUG: soft lockup - CPU#7 stuck for 26s! [modprobe:28704]

Either change to:
return adev->ip_versions[DCE_HWIP][0] == IP_VERSION(3, 2, 0);

You mean to add an exclusion for Navi32 for this case to return 'false' for amdgpu_device_seamless_boot_supported()?

Quoted 3 lines

Or revert [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs both ok.

What kind of connector do you have connected to display? Is it eDP?

Are you sure it's this patch causing it? With latest ASDN hash can you reproduce it and then try the module parameter (amdgpu.seamless=0) to disable it and confirm things are fixed?

Can I see more complete dmesg?

Quoted 53 lines

Thanks,
Feifei

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, September 14, 2023 1:15 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Limonciello, Mario <[email protected]>
Subject: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later.

If users report using the module parameter that it works on older ASICs as well, this can be adjusted.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++-----------
  1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -3
index 2116e016178a..38fafed31a1b 100644
@@ -1361,9 +1361,9 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
  /*
   * Check whether seamless boot is supported.
   *
- * So far we only support seamless boot on select ASICs.
- * If everything goes well, we may consider expanding
- * seamless boot to other ASICs.
+ * So far we only support seamless boot on DCE 3.0 or later.
+ * If users report that it works on older ASICS as well, we may
+ * loosen this.
   */
  bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)  { @@ -1383,14 +1383,7 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
         if (adev->mman.keep_stolen_vga_memory)
                 return false;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -9
-       switch (adev->ip_versions[DCE_HWIP][0]) {
-       case IP_VERSION(3, 0, 1):
-               return true;
-       default:
-               break;
-       }
-
-       return false;
+       return adev->ip_versions[DCE_HWIP][0] > IP_VERSION(3, 0, 0);
  }
 
  /*
--

2.34.1