drm/amd: Add a module parameter for seamless boot
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 5 Sep 2023 19:25:59 +0000 (14:25 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Sep 2023 16:24:39 +0000 (12:24 -0400)
The module parameter can be used to test more easily enabling seamless
boot support on additional ASICs.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index 19c757e300b01b0ca9ea632066ff5c154b698be8..a70babb8ad13590b91ee3fa2e60a8b226d5aaf3c 100644 (file)
@@ -245,6 +245,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;
 
index 7187eeb8ffa65d151dd2dae3f9752bddb7f7e788..2116e016178abb23e13c78d05c929b8357457bd2 100644 (file)
@@ -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;
        }
index 4605803fc92ffa4c92d2420123d1377561d27f5c..d9052475f2fc73b882a5378285c2d7a082690f90 100644 (file)
@@ -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: