Skip to contentSkip to conversation

drm/radeon: Add module param to control CIK support

PATCH In review Felix Kuehling 2 participants 6 messages May 18, 2017 – May 19, 2017 1 message not in the archive

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

PATCH 1/5 drm/radeon: Add module param to control CIK support

If AMDGPU supports CIK, add a module parameter to control CIK support in radeon. It's off by default in radeon, while it will be on by default in AMDGPU.

---
 drivers/gpu/drm/radeon/radeon.h     |  4 ++++
 drivers/gpu/drm/radeon/radeon_drv.c |  6 ++++++
 drivers/gpu/drm/radeon/radeon_kms.c | 18 ++++++++++++++++++
 3 files changed, 28 insertions(+)
drivers/gpu/drm/radeon/radeon.h +4 -0
index 7e9d3b9..8d2a021 100644
@@ -116,6 +116,10 @@
 extern int radeon_uvd;
 extern int radeon_vce;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+extern int radeon_cik_support;
+#endif
+
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
  * symbol;
drivers/gpu/drm/radeon/radeon_drv.c +6 -0
index 2e5d680..2cdb01b 100644
@@ -301,6 +301,12 @@ static inline void radeon_unregister_atpx_handler(void) {}
 MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
 module_param_named(vce, radeon_vce, int, 0444);
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+int radeon_cik_support = 0;
+MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
+module_param_named(cik_support, radeon_cik_support, int, 0444);
+#endif
+
 static struct pci_device_id pciidlist[] = {
 	radeon_PCI_IDS
 };
drivers/gpu/drm/radeon/radeon_kms.c +18 -0
index 4388dde..9453e28 100644
@@ -99,6 +99,24 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct radeon_device *rdev;
 	int r, acpi_status;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+	if (!radeon_cik_support) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_info(dev->dev,
+				 "CIK support provided by amdgpu.\n");
+			dev_info(dev->dev,
+		"Use radeon.cik_support=1 amdgpu.cik_support=0 to override.\n"
+				);
+			return -ENODEV;
+		}
+	}
+#endif
+
 	rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
 	if (rdev == NULL) {
 		return -ENOMEM;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1495143874-10874-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/5 drm/amdgpu: Add module param to control CIK support

If AMDGPU supports CIK, add a module parameter to control CIK support. It's on by default in AMDGPU, while it is off by default in radeon.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     |  4 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |  6 ++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +++++++++++++++
 3 files changed, 25 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +4 -0
index ae7e775..be1cb3b 100644
@@ -114,6 +114,10 @@
 extern int amdgpu_param_buf_per_se;
 extern int amdgpu_job_hang_limit;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+extern int amdgpu_cik_support;
+#endif
+
 #define AMDGPU_DEFAULT_GTT_SIZE_MB		3072ULL /* 3GB by default */
 #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS	        3000
 #define AMDGPU_MAX_USEC_TIMEOUT			100000	/* 100 ms */
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6 -0
index 130c45d..f131ac2 100644
@@ -241,6 +241,12 @@
 MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)");
 module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444);
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+int amdgpu_cik_support = 1;
+MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
+module_param_named(cik_support, amdgpu_cik_support, int, 0444);
+#endif
+
 
 static const struct pci_device_id pciidlist[] = {
 #ifdef  CONFIG_DRM_AMDGPU_SI
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +15 -0
index 75d0eba..a2171c3 100644
@@ -88,6 +88,21 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct amdgpu_device *adev;
 	int r, acpi_status;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+	if (!amdgpu_cik_support) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_info(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+#endif
+
 	adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
 	if (adev == NULL) {
 		return -ENOMEM;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/5 drm/radeon: Add module param to control SI support

In reply to a message not in the archive

If AMDGPU supports SI, add a module parameter to control SI support in radeon. It's on by default in radeon, while it will be off by default in AMDGPU as long as SI support is experimental.

---
 drivers/gpu/drm/radeon/radeon.h     |  3 +++
 drivers/gpu/drm/radeon/radeon_drv.c |  6 ++++++
 drivers/gpu/drm/radeon/radeon_kms.c | 14 ++++++++++++++
 3 files changed, 23 insertions(+)
drivers/gpu/drm/radeon/radeon.h +3 -0
index 8d2a021..8698812 100644
@@ -116,6 +116,9 @@
 extern int radeon_uvd;
 extern int radeon_vce;
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+extern int radeon_si_support;
+#endif
 #ifdef CONFIG_DRM_AMDGPU_CIK
 extern int radeon_cik_support;
 #endif
drivers/gpu/drm/radeon/radeon_drv.c +6 -0
index 2cdb01b..247a923 100644
@@ -301,6 +301,12 @@ static inline void radeon_unregister_atpx_handler(void) {}
 MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
 module_param_named(vce, radeon_vce, int, 0444);
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+int radeon_si_support = 1;
+MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)");
+module_param_named(si_support, radeon_si_support, int, 0444);
+#endif
+
 #ifdef CONFIG_DRM_AMDGPU_CIK
 int radeon_cik_support = 0;
 MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
drivers/gpu/drm/radeon/radeon_kms.c +14 -0
index 9453e28..63d9f2d 100644
@@ -99,6 +99,20 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct radeon_device *rdev;
 	int r, acpi_status;
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+	if (!radeon_si_support) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_TAHITI:
+		case CHIP_PITCAIRN:
+		case CHIP_VERDE:
+		case CHIP_OLAND:
+		case CHIP_HAINAN:
+			dev_info(dev->dev,
+				 "SI support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+#endif
 #ifdef CONFIG_DRM_AMDGPU_CIK
 	if (!radeon_cik_support) {
 		switch (flags & RADEON_FAMILY_MASK) {
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 4/5 drm/amdgpu: Add module param to control SI support

In reply to a message not in the archive

If AMDGPU supports SI, add a module parameter to control SI support. It's off by default in AMDGPU as long as SI suppost is experimental, while it is on by default in radeon.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     |  3 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |  6 ++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 17 +++++++++++++++++
 3 files changed, 26 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 -0
index be1cb3b..de7e409 100644
@@ -114,6 +114,9 @@
 extern int amdgpu_param_buf_per_se;
 extern int amdgpu_job_hang_limit;
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+extern int amdgpu_si_support;
+#endif
 #ifdef CONFIG_DRM_AMDGPU_CIK
 extern int amdgpu_cik_support;
 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6 -0
index f131ac2..24297a0 100644
@@ -241,6 +241,12 @@
 MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)");
 module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444);
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+int amdgpu_si_support = 1;
+MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
+module_param_named(si_support, amdgpu_si_support, int, 0444);
+#endif
+
 #ifdef CONFIG_DRM_AMDGPU_CIK
 int amdgpu_cik_support = 1;
 MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +17 -0
index a2171c3..f418fa4 100644
@@ -88,6 +88,23 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct amdgpu_device *adev;
 	int r, acpi_status;
 
+#ifdef CONFIG_DRM_AMDGPU_SI
+	if (!amdgpu_si_support) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_TAHITI:
+		case CHIP_PITCAIRN:
+		case CHIP_VERDE:
+		case CHIP_OLAND:
+		case CHIP_HAINAN:
+			dev_info(dev->dev,
+				 "SI support provided by radeon.\n");
+			dev_info(dev->dev,
+		"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
+				);
+			return -ENODEV;
+		}
+	}
+#endif
 #ifdef CONFIG_DRM_AMDGPU_CIK
 	if (!amdgpu_cik_support) {
 		switch (flags & AMD_ASIC_MASK) {
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 5/5 drm/amdgpu: Update Kconfig help for SI and CIK support

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +12 -4
index f3b6df8..468a19b 100644
@@ -5,15 +5,23 @@ config DRM_AMDGPU_SI
 	  Choose this option if you want to enable experimental support
 	  for SI asics.
 
+	  SI is already supported in radeon. Experimental support for SI
+	  in amdgpu will be disabled by default and is still provided by
+	  radeon. Use module options to override this:
+
+	  radeon.si_support=0 amdgpu.si_support=1
+
 config DRM_AMDGPU_CIK
 	bool "Enable amdgpu support for CIK parts"
 	depends on DRM_AMDGPU
 	help
-	  Choose this option if you want to enable experimental support
-	  for CIK asics.
+	  Choose this option if you want to enable support for CIK asics.
+
+	  CIK is already supported in radeon. If you enable this option,
+	  support for CIK will be provided by amdgpu and disabled in
+	  radeon by default. Use module options to override this:
 
-	  CIK is already supported in radeon.  CIK support in amdgpu
-	  is for experimentation and testing.
+	  radeon.cik_support=1 amdgpu.cik_support=0
 
 config DRM_AMDGPU_USERPTR
 	bool "Always enable userptr write support"
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw
In reply to a message not in the archive

Am 18.05.2017 um 23:44 schrieb Felix Kuehling:

Quoted 5 lines

If AMDGPU supports CIK, add a module parameter to control CIK support in radeon. It's off by default in radeon, while it will be on by default in AMDGPU.

I'm not 100% sure if amdgpu should be the default for CIK either, but let's give that a try for now.

Patches are Reviewed-by: Christian König <[email protected]>.

Quoted 57 lines
---
  drivers/gpu/drm/radeon/radeon.h     |  4 ++++
  drivers/gpu/drm/radeon/radeon_drv.c |  6 ++++++
  drivers/gpu/drm/radeon/radeon_kms.c | 18 ++++++++++++++++++
  3 files changed, 28 insertions(+)
drivers/gpu/drm/radeon/radeon.h +4 -0
index 7e9d3b9..8d2a021 100644
@@ -116,6 +116,10 @@
  extern int radeon_uvd;
  extern int radeon_vce;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+extern int radeon_cik_support;
+#endif
+
  /*
   * Copy from radeon_drv.h so we don't have to include both and have conflicting
   * symbol;
drivers/gpu/drm/radeon/radeon_drv.c +6 -0
index 2e5d680..2cdb01b 100644
@@ -301,6 +301,12 @@ static inline void radeon_unregister_atpx_handler(void) {}
  MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
  module_param_named(vce, radeon_vce, int, 0444);
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+int radeon_cik_support = 0;
+MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
+module_param_named(cik_support, radeon_cik_support, int, 0444);
+#endif
+
  static struct pci_device_id pciidlist[] = {
  	radeon_PCI_IDS
  };
drivers/gpu/drm/radeon/radeon_kms.c +11 -0
index 4388dde..9453e28 100644
@@ -99,6 +99,24 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
  	struct radeon_device *rdev;
  	int r, acpi_status;
 
+#ifdef CONFIG_DRM_AMDGPU_CIK
+	if (!radeon_cik_support) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_info(dev->dev,
+				 "CIK support provided by amdgpu.\n");
+			dev_info(dev->dev,

drivers/gpu/drm/radeon/radeon_kms.c int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) · line 122

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_kms.c +7 -0
+		"Use radeon.cik_support=1 amdgpu.cik_support=0 to override.\n"
+				);
+			return -ENODEV;
+		}
+	}
+#endif
+
  	rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
  	if (rdev == NULL) {
  		return -ENOMEM;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx