Skip to contentSkip to conversation

drm/amdgpu: add S/G display parameter

PATCH In review Alex Deucher 4 participants 7 messages Feb 9, 2023 – Feb 10, 2023

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/4 drm/amdgpu: add S/G display parameter

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). Add a option to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           | 11 +++++++++++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +++
 3 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 64f9cc6fbbf0..187597024c1e 100644
@@ -242,6 +242,7 @@ extern int amdgpu_num_kcq;
 
 #define AMDGPU_VCNFW_LOG_SIZE (32 * 1024)
 extern int amdgpu_vcnfw_log;
+extern int amdgpu_sg_display;
 
 extern int amdgpu_force_sg_display;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +11 -0
index fa3788bb6a2c..afa5c39c9c74 100644
@@ -188,6 +188,7 @@ int amdgpu_num_kcq = -1;
 int amdgpu_smartshift_bias;
 int amdgpu_use_xgmi_p2p = 1;
 int amdgpu_vcnfw_log;
+int amdgpu_sg_display = -1; /* auto */
 
 static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
 
@@ -933,6 +934,16 @@ module_param_named(num_kcq, amdgpu_num_kcq, int, 0444);
 MODULE_PARM_DESC(vcnfw_log, "Enable vcnfw log(0 = disable (default value), 1 = enable)");
 module_param_named(vcnfw_log, amdgpu_vcnfw_log, int, 0444);
 
+/**
+ * DOC: sg_display (int)
+ * Disable S/G (scatter/gather) display (i.e., display from system memory).
+ * This option is only relevant on APUs.  Set this option to 0 to disable
+ * S/G display if you experience flickering or other issues under memory
+ * pressure and report the issue.
+ */
+MODULE_PARM_DESC(sg_display, "S/G Display (-1 = auto (default), 0 = disable)");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
 /**
  * DOC: smu_pptable_id (int)
  * Used to override pptable id. id = 0 use VBIOS pptable.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index bf06875e6a01..1babdfaa789a 100644
@@ -1576,6 +1576,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		}
 		break;
 	}
+	if (init_data.flags.gpu_vm_support &&
+	    (amdgpu_sg_display == 0))
+		adev->mode_info.gpu_vm_support = false;
 
 	if (init_data.flags.gpu_vm_support)
 		adev->mode_info.gpu_vm_support = true;
Signature · 1 line
2.39.1
author maintainer
#1 lore raw

PATCH 2/4 Revert "drm/amd/display: disable S/G display on DCN 3.1.2/3"

This reverts commit f081cd4ca2658752a8c0e2353d50aec80d07c65f.

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). We have a parameter to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further. Having this enabled seems like the lesser of to evils.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index 1babdfaa789a..d22bbd6d8ba5 100644
@@ -1567,6 +1567,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 				init_data.flags.gpu_vm_support = true;
 			break;
 		case IP_VERSION(3, 0, 1):
+		case IP_VERSION(3, 1, 2):
+		case IP_VERSION(3, 1, 3):
 		case IP_VERSION(3, 1, 4):
 		case IP_VERSION(3, 1, 6):
 			init_data.flags.gpu_vm_support = true;
Signature · 1 line
2.39.1
author maintainer
#2 lore raw

PATCH 3/4 Revert "drm/amd/display: disable S/G display on DCN 2.1.0"

In reply to Alex Deucher

This reverts commit 2404f9b0ea0153c3fddb0c4d7a43869dc8608f6f.

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). We have a parameter to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further. Having this enabled seems like the lesser of to evils.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index d22bbd6d8ba5..f7ba65fd8f48 100644
@@ -1566,6 +1566,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 			    (adev->apu_flags & AMD_APU_IS_PICASSO))
 				init_data.flags.gpu_vm_support = true;
 			break;
+		case IP_VERSION(2, 1, 0):
 		case IP_VERSION(3, 0, 1):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
Signature · 1 line
2.39.1
author maintainer
#3 lore raw

PATCH 4/4 Revert "drm/amd/display: disable S/G display on DCN 3.1.5"

In reply to Alex Deucher

This reverts commit 3cc67fe1b3aa1ac4720e002f2aa2d08c9199a584.

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). We have a parameter to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further. Having this enabled seems like the lesser of to evils.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index f7ba65fd8f48..7f16be84f3b1 100644
@@ -1571,6 +1571,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
 		case IP_VERSION(3, 1, 4):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			init_data.flags.gpu_vm_support = true;
 			break;
Signature · 1 line
2.39.1
Reviewed-by on v1 4/4
#4 lore raw

RE: [PATCH 4/4] Revert "drm/amd/display: disable S/G display on DCN 3.1.5"

[Public]

This series is

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, February 9, 2023 10:12 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 4/4] Revert "drm/amd/display: disable S/G display on DCN 3.1.5"

This reverts commit 3cc67fe1b3aa1ac4720e002f2aa2d08c9199a584.

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). We have a parameter to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further. Having this enabled seems like the lesser of to evils.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index f7ba65fd8f48..7f16be84f3b1 100644
@@ -1571,6 +1571,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
 		case IP_VERSION(3, 1, 4):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			init_data.flags.gpu_vm_support = true;
 			break;

--
2.39.1

Acked-by on v1 1/4
#5 lore raw
In reply to Alex Deucher

Am 09.02.23 um 15:11 schrieb Alex Deucher:

Quoted 12 lines

Some users have reported flickerng with S/G display. We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to. We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). Add a option to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further.

Quoted 1 line
Quoted 61 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           | 11 +++++++++++
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +++
  3 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 64f9cc6fbbf0..187597024c1e 100644
@@ -242,6 +242,7 @@ extern int amdgpu_num_kcq;
 
  #define AMDGPU_VCNFW_LOG_SIZE (32 * 1024)
  extern int amdgpu_vcnfw_log;
+extern int amdgpu_sg_display;
 
  extern int amdgpu_force_sg_display;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +11 -0
index fa3788bb6a2c..afa5c39c9c74 100644
@@ -188,6 +188,7 @@ int amdgpu_num_kcq = -1;
  int amdgpu_smartshift_bias;
  int amdgpu_use_xgmi_p2p = 1;
  int amdgpu_vcnfw_log;
+int amdgpu_sg_display = -1; /* auto */
 
  static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
 
@@ -933,6 +934,16 @@ module_param_named(num_kcq, amdgpu_num_kcq, int, 0444);
  MODULE_PARM_DESC(vcnfw_log, "Enable vcnfw log(0 = disable (default value), 1 = enable)");
  module_param_named(vcnfw_log, amdgpu_vcnfw_log, int, 0444);
 
+/**
+ * DOC: sg_display (int)
+ * Disable S/G (scatter/gather) display (i.e., display from system memory).
+ * This option is only relevant on APUs.  Set this option to 0 to disable
+ * S/G display if you experience flickering or other issues under memory
+ * pressure and report the issue.
+ */
+MODULE_PARM_DESC(sg_display, "S/G Display (-1 = auto (default), 0 = disable)");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
  /**
   * DOC: smu_pptable_id (int)
   * Used to override pptable id. id = 0 use VBIOS pptable.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index bf06875e6a01..1babdfaa789a 100644
@@ -1576,6 +1576,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
  		}
  		break;
  	}
+	if (init_data.flags.gpu_vm_support &&
+	    (amdgpu_sg_display == 0))
+		adev->mode_info.gpu_vm_support = false;
 
  	if (init_data.flags.gpu_vm_support)
  		adev->mode_info.gpu_vm_support = true;
maintainer Reviewed-by
#6 lore raw
Quoted 13 lines · Christian König

Am 09.02.23 um 15:11 schrieb Alex Deucher:

Quoted 12 lines

Some users have reported flickerng with S/G display.  We've tried extensively to reproduce and debug the issue on a wide variety of platform configurations (DRAM bandwidth, etc.) and a variety of monitors, but so far have not been able to.  We disabled S/G display on a number of platforms to address this but that leads to failure to pin framebuffers errors and blank displays when there is memory pressure or no displays at all on systems with limited carveout (e.g., Chromebooks). Add a option to disable this as a debugging option as a way for users to disable this, depending on their use case, and for us to help debug this further.

Quoted 4 lines
Quoted 1 line

Series is

Harry

Quoted 55 lines
Quoted 54 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           | 11 +++++++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +++

  3 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 64f9cc6fbbf0..187597024c1e 100644
@@ -242,6 +242,7 @@ extern int amdgpu_num_kcq;
     #define AMDGPU_VCNFW_LOG_SIZE (32 * 1024)
   extern int amdgpu_vcnfw_log;
+extern int amdgpu_sg_display;
     extern int amdgpu_force_sg_display;

  diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index fa3788bb6a2c..afa5c39c9c74 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -188,6 +188,7 @@ int amdgpu_num_kcq = -1;
   int amdgpu_smartshift_bias;
   int amdgpu_use_xgmi_p2p = 1;
   int amdgpu_vcnfw_log;
+int amdgpu_sg_display = -1; /* auto */
     static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
   @@ -933,6 +934,16 @@ module_param_named(num_kcq, amdgpu_num_kcq, int, 0444);
   MODULE_PARM_DESC(vcnfw_log, "Enable vcnfw log(0 = disable (default value), 1 = enable)");

  module_param_named(vcnfw_log, amdgpu_vcnfw_log, int, 0444); +/**
+ * DOC: sg_display (int)
+ * Disable S/G (scatter/gather) display (i.e., display from system memory).
+ * This option is only relevant on APUs.  Set this option to 0 to disable
+ * S/G display if you experience flickering or other issues under memory
+ * pressure and report the issue.
+ */

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+MODULE_PARM_DESC(sg_display, "S/G Display (-1 = auto (default), 0 = disable)");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+

  /**
   * DOC: smu_pptable_id (int)
   * Used to override pptable id. id = 0 use VBIOS pptable.

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index bf06875e6a01..1babdfaa789a 100644
@@ -1576,6 +1576,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
           }
           break;
       }
+    if (init_data.flags.gpu_vm_support &&
+        (amdgpu_sg_display == 0))
+        adev->mode_info.gpu_vm_support = false;
         if (init_data.flags.gpu_vm_support)
           adev->mode_info.gpu_vm_support = true;