Skip to contentSkip to conversation

drm: Harmonize CIK ASIC support in radeon and amdgpu (v2)

PATCH In review Felix Kuehling 5 participants 25 messages Apr 10, 2017 – May 22, 2017 19 messages not in the archive

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

PATCH 1/1 drm: Harmonize CIK ASIC support in radeon and amdgpu (v2)

Provide convenient compile time and boot time options for selecting CIK ASIC support in either or both drivers.

v2: git add missing files

---
 drivers/gpu/drm/Kconfig                 |  51 ++++++++++++++
 drivers/gpu/drm/amd/amdgpu/Kconfig      |  10 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |   9 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  26 ++++++++
 drivers/gpu/drm/radeon/Kconfig          |   8 +++
 drivers/gpu/drm/radeon/radeon.h         |   1 +
 drivers/gpu/drm/radeon/radeon_drv.c     |  13 ++++
 drivers/gpu/drm/radeon/radeon_kms.c     |  13 ++++
 include/drm/drm_pciids.h                | 114 ++++++++++++++++----------------
 10 files changed, 184 insertions(+), 62 deletions(-)
drivers/gpu/drm/Kconfig +51 -0
index 483059a..f85f81c 100644
@@ -148,6 +148,57 @@ config DRM_AMDGPU
 
 source "drivers/gpu/drm/amd/amdgpu/Kconfig"
 
+choice DRM_CIK_SUPPORT
+	prompt "Support for AMD CIK ASICs"
+	default DRM_CIK_RADEON
+	depends on DRM_AMDGPU || DRM_RADEON
+	help
+	  Choose the driver used to support AMD CIK ASICs.
+
+config DRM_CIK_RADEON
+	bool "Radeon"
+	depends on DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	help
+	  The Radeon driver was traditionally used to support CIK ASICs.
+
+config DRM_CIK_AMDGPU
+	bool "AMD GPU"
+	depends on DRM_AMDGPU
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  The AMD GPU driver has more active development for features and
+	  performance. If you choose this driver, you also need the amdgpu
+	  DDX driver for X.org.
+
+config DRM_CIK_BOTH_DEFAULT_RADEON
+	bool "Both, use Radeon by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	select DRM_AMDGPU_CIK
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+config DRM_CIK_BOTH_DEFAULT_AMDGPU
+	bool "Both, use AMD GPU by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+endchoice
+
 source "drivers/gpu/drm/nouveau/Kconfig"
 
 source "drivers/gpu/drm/i915/Kconfig"
drivers/gpu/drm/amd/amdgpu/Kconfig +4 -6
index f3b6df8..7bc171d 100644
@@ -6,14 +6,12 @@ config DRM_AMDGPU_SI
 	  for SI asics.
 
 config DRM_AMDGPU_CIK
-	bool "Enable amdgpu support for CIK parts"
+	bool
 	depends on DRM_AMDGPU
-	help
-	  Choose this option if you want to enable experimental support
-	  for CIK asics.
 
-	  CIK is already supported in radeon.  CIK support in amdgpu
-	  is for experimentation and testing.
+config DRM_AMDGPU_CIK_ENABLED
+	bool
+	depends on DRM_AMDGPU
 
 config DRM_AMDGPU_USERPTR
 	bool "Always enable userptr write support"
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 5487580..e028169 100644
@@ -111,6 +111,7 @@
 extern int amdgpu_pos_buf_per_se;
 extern int amdgpu_cntl_sb_buf_per_se;
 extern int amdgpu_param_buf_per_se;
+extern int amdgpu_enable_cik;
 
 #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS	        3000
 #define AMDGPU_MAX_USEC_TIMEOUT			100000	/* 100 ms */
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 -0
index 6238e2e..84d393d 100644
@@ -109,6 +109,11 @@
 int amdgpu_pos_buf_per_se = 0;
 int amdgpu_cntl_sb_buf_per_se = 0;
 int amdgpu_param_buf_per_se = 0;
+#ifdef CONFIG_DRM_AMDGPU_CIK_ENABLED
+int amdgpu_enable_cik = 1;
+#else
+int amdgpu_enable_cik = 0;
+#endif
 
 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -234,6 +239,10 @@
 MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)");
 module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444);
 
+#ifdef DRM_AMDGPU_CIK
+MODULE_PARAM_DESC(enable_cik, "Enable CIK support");
+module_param_named(enable_cik, amdgpu_enable_cik, int, 0444);
+#endif
 
 static const struct pci_device_id pciidlist[] = {
 #ifdef  CONFIG_DRM_AMDGPU_SI
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +26 -0
index 1006d7c..b30f2b0 100644
@@ -88,6 +88,32 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct amdgpu_device *adev;
 	int r, acpi_status;
 
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+                                 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
 	adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
 	if (adev == NULL) {
 		return -ENOMEM;
drivers/gpu/drm/radeon/Kconfig +8 -0
index 9909f5c..6ef6363 100644
@@ -1,3 +1,11 @@
+config DRM_RADEON_CIK
+	bool
+	depends on DRM_RADEON
+
+config DRM_RADEON_CIK_ENABLED
+	bool
+	depends on DRM_RADEON
+
 config DRM_RADEON_USERPTR
 	bool "Always enable userptr support"
 	depends on DRM_RADEON
drivers/gpu/drm/radeon/radeon.h +1 -0
index 7e9d3b9..47dd0e6 100644
@@ -115,6 +115,7 @@
 extern int radeon_mst;
 extern int radeon_uvd;
 extern int radeon_vce;
+extern int radeon_enable_cik;
 
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
drivers/gpu/drm/radeon/radeon_drv.c +13 -0
index 2e5d680..518a7b2 100644
@@ -204,6 +204,11 @@ static inline void radeon_unregister_atpx_handler(void) {}
 int radeon_mst = 0;
 int radeon_uvd = 1;
 int radeon_vce = 1;
+#ifdef CONFIG_DRM_RADEON_CIK_ENABLED
+int radeon_enable_cik = 1;
+#else
+int radeon_enable_cik = 0;
+#endif
 
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -301,7 +306,15 @@ 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 DRM_RADEON_CIK
+MODULE_PARAM_DESC(enable_cik, "Enable CIK support");
+module_param_named(enable_cik, radeon_enable_cik, int, 0444);
+#endif
+
 static struct pci_device_id pciidlist[] = {
+#ifdef CONFIG_DRM_RADEON_CIK
+	radeon_CIK_PCI_IDS,
+#endif
 	radeon_PCI_IDS
 };
 
drivers/gpu/drm/radeon/radeon_kms.c +13 -0
index 4388dde..c92e3e5 100644
@@ -99,6 +99,19 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct radeon_device *rdev;
 	int r, acpi_status;
 
+	if (!radeon_enable_cik) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
 	rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
 	if (rdev == NULL) {
 		return -ENOMEM;
include/drm/drm_pciids.h +58 -56

141 lines not on this page · raw message

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): 1491866474-1016-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

#2 lore raw

I tested this with Hawaii on the KFD branch and DRM_CIK_BOTH_DEFAULT_AMDGPU. Both modules get loaded, but radeon doesn't initialize the device. Amdgpu works with kfdtest.

To keep the driver code clean I only use straight-forward per-driver options in #ifdefs. The CONFIG_DRM_CIK_... options that affect both drivers select the right set of driver-specific options but aren't referenced in the code directly.

Sorry about messed up v1. I missed some files when moving from amd-kfd-staging to amd-staging-4.9.

If you like this approach, I can do the same for SI.

Regards,
Felix

Quoted 404 lines · Felix Kuehling

Provide convenient compile time and boot time options for selecting CIK ASIC support in either or both drivers.

v2: git add missing files

---
 drivers/gpu/drm/Kconfig                 |  51 ++++++++++++++
 drivers/gpu/drm/amd/amdgpu/Kconfig      |  10 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |   9 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  26 ++++++++
 drivers/gpu/drm/radeon/Kconfig          |   8 +++
 drivers/gpu/drm/radeon/radeon.h         |   1 +
 drivers/gpu/drm/radeon/radeon_drv.c     |  13 ++++
 drivers/gpu/drm/radeon/radeon_kms.c     |  13 ++++
 include/drm/drm_pciids.h                | 114 ++++++++++++++++----------------
 10 files changed, 184 insertions(+), 62 deletions(-)
drivers/gpu/drm/Kconfig +51 -0
index 483059a..f85f81c 100644
@@ -148,6 +148,57 @@ config DRM_AMDGPU
 
 source "drivers/gpu/drm/amd/amdgpu/Kconfig"
 
+choice DRM_CIK_SUPPORT
+	prompt "Support for AMD CIK ASICs"
+	default DRM_CIK_RADEON
+	depends on DRM_AMDGPU || DRM_RADEON
+	help
+	  Choose the driver used to support AMD CIK ASICs.
+
+config DRM_CIK_RADEON
+	bool "Radeon"
+	depends on DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	help
+	  The Radeon driver was traditionally used to support CIK ASICs.
+
+config DRM_CIK_AMDGPU
+	bool "AMD GPU"
+	depends on DRM_AMDGPU
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  The AMD GPU driver has more active development for features and
+	  performance. If you choose this driver, you also need the amdgpu
+	  DDX driver for X.org.
+
+config DRM_CIK_BOTH_DEFAULT_RADEON
+	bool "Both, use Radeon by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	select DRM_AMDGPU_CIK
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+config DRM_CIK_BOTH_DEFAULT_AMDGPU
+	bool "Both, use AMD GPU by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+endchoice
+
 source "drivers/gpu/drm/nouveau/Kconfig"
 
 source "drivers/gpu/drm/i915/Kconfig"
drivers/gpu/drm/amd/amdgpu/Kconfig +4 -6
index f3b6df8..7bc171d 100644
@@ -6,14 +6,12 @@ config DRM_AMDGPU_SI
 	  for SI asics.
 
 config DRM_AMDGPU_CIK
-	bool "Enable amdgpu support for CIK parts"
+	bool
 	depends on DRM_AMDGPU
-	help
-	  Choose this option if you want to enable experimental support
-	  for CIK asics.
 
-	  CIK is already supported in radeon.  CIK support in amdgpu
-	  is for experimentation and testing.
+config DRM_AMDGPU_CIK_ENABLED
+	bool
+	depends on DRM_AMDGPU
 
 config DRM_AMDGPU_USERPTR
 	bool "Always enable userptr write support"
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 5487580..e028169 100644
@@ -111,6 +111,7 @@
 extern int amdgpu_pos_buf_per_se;
 extern int amdgpu_cntl_sb_buf_per_se;
 extern int amdgpu_param_buf_per_se;
+extern int amdgpu_enable_cik;
 
 #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS	        3000
 #define AMDGPU_MAX_USEC_TIMEOUT			100000	/* 100 ms */
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 -0
index 6238e2e..84d393d 100644
@@ -109,6 +109,11 @@
 int amdgpu_pos_buf_per_se = 0;
 int amdgpu_cntl_sb_buf_per_se = 0;
 int amdgpu_param_buf_per_se = 0;
+#ifdef CONFIG_DRM_AMDGPU_CIK_ENABLED
+int amdgpu_enable_cik = 1;
+#else
+int amdgpu_enable_cik = 0;
+#endif
 
 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -234,6 +239,10 @@
 MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)");
 module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444);
 
+#ifdef DRM_AMDGPU_CIK
+MODULE_PARAM_DESC(enable_cik, "Enable CIK support");
+module_param_named(enable_cik, amdgpu_enable_cik, int, 0444);
+#endif
 
 static const struct pci_device_id pciidlist[] = {
 #ifdef  CONFIG_DRM_AMDGPU_SI
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +26 -0
index 1006d7c..b30f2b0 100644
@@ -88,6 +88,32 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct amdgpu_device *adev;
 	int r, acpi_status;
 
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+                                 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
 	adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
 	if (adev == NULL) {
 		return -ENOMEM;
drivers/gpu/drm/radeon/Kconfig +8 -0
index 9909f5c..6ef6363 100644
@@ -1,3 +1,11 @@
+config DRM_RADEON_CIK
+	bool
+	depends on DRM_RADEON
+
+config DRM_RADEON_CIK_ENABLED
+	bool
+	depends on DRM_RADEON
+
 config DRM_RADEON_USERPTR
 	bool "Always enable userptr support"
 	depends on DRM_RADEON
drivers/gpu/drm/radeon/radeon.h +1 -0
index 7e9d3b9..47dd0e6 100644
@@ -115,6 +115,7 @@
 extern int radeon_mst;
 extern int radeon_uvd;
 extern int radeon_vce;
+extern int radeon_enable_cik;
 
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
drivers/gpu/drm/radeon/radeon_drv.c +13 -0
index 2e5d680..518a7b2 100644
@@ -204,6 +204,11 @@ static inline void radeon_unregister_atpx_handler(void) {}
 int radeon_mst = 0;
 int radeon_uvd = 1;
 int radeon_vce = 1;
+#ifdef CONFIG_DRM_RADEON_CIK_ENABLED
+int radeon_enable_cik = 1;
+#else
+int radeon_enable_cik = 0;
+#endif
 
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -301,7 +306,15 @@ 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 DRM_RADEON_CIK
+MODULE_PARAM_DESC(enable_cik, "Enable CIK support");
+module_param_named(enable_cik, radeon_enable_cik, int, 0444);
+#endif
+
 static struct pci_device_id pciidlist[] = {
+#ifdef CONFIG_DRM_RADEON_CIK
+	radeon_CIK_PCI_IDS,
+#endif
 	radeon_PCI_IDS
 };
 
drivers/gpu/drm/radeon/radeon_kms.c +13 -0
index 4388dde..c92e3e5 100644
@@ -99,6 +99,19 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct radeon_device *rdev;
 	int r, acpi_status;
 
+	if (!radeon_enable_cik) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
 	rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
 	if (rdev == NULL) {
 		return -ENOMEM;
include/drm/drm_pciids.h +58 -49
index 8bc073d..cf17901 100644
@@ -1,4 +1,4 @@
-#define radeon_PCI_IDS \
+#define radeon_CIK_PCI_IDS \
 	{0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x1306, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
@@ -21,6 +21,63 @@
 	{0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x131D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x6640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6650, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6658, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x665c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x665d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x665f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67A8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67A9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67AA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67B0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67B8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67BA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x67BE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x9830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9832, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9833, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x983f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9851, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9852, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9853, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9854, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9855, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9856, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9857, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9858, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9859, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}
+
+#define radeon_PCI_IDS \
 	{0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
 	{0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -177,17 +234,6 @@
 	{0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6650, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x6658, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x665c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x665d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x665f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6663, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6664, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -268,18 +314,6 @@
 	{0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67A8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67A9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67AA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67B0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67B8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67BA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
-	{0x1002, 0x67BE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6802, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -629,38 +663,6 @@
 	{0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x980A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9832, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9833, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x983f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9851, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9852, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9853, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9854, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9855, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9856, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9857, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x9858, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \

include/drm/drm_pciids.h line 668

Quoted 10 lines
include/drm/drm_pciids.h +0 -7
-	{0x1002, 0x9859, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \

_______________________________________________
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): f3f9c088-0c34-20b3-87be-50d64ec32d9d-5C7GfCeVMHo@public.gmane.org

#4 lore raw
Quoted 3 lines · Felix Kuehling

I tested this with Hawaii on the KFD branch and DRM_CIK_BOTH_DEFAULT_AMDGPU. Both modules get loaded, but radeon doesn't initialize the device. Amdgpu works with kfdtest.

Did radeon print the "CIK support disabled by module param" message?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): ddeaae54-6cff-03a0-df5d-ffe1047e518a-otUistvHUpPR7s880joybQ@public.gmane.org

#6 lore raw
Quoted 5 lines · Michel Dänzer
Quoted 3 lines · Felix Kuehling

I tested this with Hawaii on the KFD branch and DRM_CIK_BOTH_DEFAULT_AMDGPU. Both modules get loaded, but radeon doesn't initialize the device. Amdgpu works with kfdtest.

Did radeon print the "CIK support disabled by module param" message?

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

#7 lore raw
In reply to a message not in the archive
Quoted 4 lines · Felix Kuehling

Provide convenient compile time and boot time options for selecting CIK ASIC support in either or both drivers.

v2: git add missing files

[...]

Quoted 48 lines
drivers/gpu/drm/Kconfig +40 -0
index 483059a..f85f81c 100644
@@ -148,6 +148,57 @@ config DRM_AMDGPU
 
 source "drivers/gpu/drm/amd/amdgpu/Kconfig"
 
+choice DRM_CIK_SUPPORT
+	prompt "Support for AMD CIK ASICs"
+	default DRM_CIK_RADEON
+	depends on DRM_AMDGPU || DRM_RADEON
+	help
+	  Choose the driver used to support AMD CIK ASICs.
+
+config DRM_CIK_RADEON
+	bool "Radeon"
+	depends on DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	help
+	  The Radeon driver was traditionally used to support CIK ASICs.
+
+config DRM_CIK_AMDGPU
+	bool "AMD GPU"
+	depends on DRM_AMDGPU
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  The AMD GPU driver has more active development for features and
+	  performance. If you choose this driver, you also need the amdgpu
+	  DDX driver for X.org.
+
+config DRM_CIK_BOTH_DEFAULT_RADEON
+	bool "Both, use Radeon by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	select DRM_AMDGPU_CIK
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+config DRM_CIK_BOTH_DEFAULT_AMDGPU
+	bool "Both, use AMD GPU by default"
+	depends on DRM_AMDGPU && DRM_RADEON

drivers/gpu/drm/Kconfig config DRM_AMDGPU · line 200

Quoted 10 lines
drivers/gpu/drm/Kconfig +10 -0
+	select DRM_RADEON_CIK
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+endchoice

I wonder if we really need all these Kconfig options. I was thinking we could simply always compile CIK support in amdgpu, and make DRM_AMDGPU_CIK choose between using amdgpu or radeon by default for CIK.

Quoted 24 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +16 -0
index 1006d7c..b30f2b0 100644
@@ -88,6 +88,32 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct amdgpu_device *adev;
 	int r, acpi_status;
 
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
+	if (!amdgpu_enable_cik) {
+		switch (flags & AMD_ASIC_MASK) {
+		case CHIP_KAVERI:

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) · line 116

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +10 -0
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_warn(dev->dev,
+                                 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+

Duplicate code.

Other than that, this looks good to me.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 873ede66-d438-c1e5-2cd3-cc8837d69d2d-otUistvHUpPR7s880joybQ@public.gmane.org

#9 lore raw
Quoted 62 lines · Michel Dänzer
Quoted 4 lines · Felix Kuehling

Provide convenient compile time and boot time options for selecting CIK ASIC support in either or both drivers.

v2: git add missing files

[...]

Quoted 54 lines
drivers/gpu/drm/Kconfig +46 -0
index 483059a..f85f81c 100644
@@ -148,6 +148,57 @@ config DRM_AMDGPU
 
 source "drivers/gpu/drm/amd/amdgpu/Kconfig"
 
+choice DRM_CIK_SUPPORT
+	prompt "Support for AMD CIK ASICs"
+	default DRM_CIK_RADEON
+	depends on DRM_AMDGPU || DRM_RADEON
+	help
+	  Choose the driver used to support AMD CIK ASICs.
+
+config DRM_CIK_RADEON
+	bool "Radeon"
+	depends on DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	help
+	  The Radeon driver was traditionally used to support CIK ASICs.
+
+config DRM_CIK_AMDGPU
+	bool "AMD GPU"
+	depends on DRM_AMDGPU
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  The AMD GPU driver has more active development for features and
+	  performance. If you choose this driver, you also need the amdgpu
+	  DDX driver for X.org.
+
+config DRM_CIK_BOTH_DEFAULT_RADEON
+	bool "Both, use Radeon by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_RADEON_CIK_ENABLED
+	select DRM_AMDGPU_CIK
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+config DRM_CIK_BOTH_DEFAULT_AMDGPU
+	bool "Both, use AMD GPU by default"
+	depends on DRM_AMDGPU && DRM_RADEON
+	select DRM_RADEON_CIK
+	select DRM_AMDGPU_CIK
+	select DRM_AMDGPU_CIK_ENABLED
+	help
+	  This option is useful for driver developers who want to test
+	  both drivers while running the same kernel. The active driver
Quoted 8 lines

drivers/gpu/drm/Kconfig config DRM_AMDGPU · line 200

Quoted 4 lines
drivers/gpu/drm/Kconfig +4 -0
+	  can be selected using the module parameters radeon.enable_cik
+	  and amdgpu.enable_cik.
+
+endchoice

I wonder if we really need all these Kconfig options. I was thinking we could simply always compile CIK support in amdgpu, and make DRM_AMDGPU_CIK choose between using amdgpu or radeon by default for CIK.

BTW, if we decide we do need the new options, let's call them something like DRM_AMD_CIK_* to make it clearer where they belong to.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#10 lore raw
In reply to a message not in the archive
Quoted 6 lines · Felix Kuehling

Provide convenient compile time and boot time options for selecting CIK ASIC support in either or both drivers.

v2: git add missing files

[...]

Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
index 6238e2e..84d393d 100644
@@ -109,6 +109,11 @@
 int amdgpu_pos_buf_per_se = 0;
 int amdgpu_cntl_sb_buf_per_se = 0;
 int amdgpu_param_buf_per_se = 0;
+#ifdef CONFIG_DRM_AMDGPU_CIK_ENABLED
+int amdgpu_enable_cik = 1;
+#else
+int amdgpu_enable_cik = 0;
+#endif
 
 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 245

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -234,6 +239,10 @@
 MODULE_PARM_DESC(param_buf_per_se, "the size of Off-Chip Pramater Cache per Shader Engine (default depending on gfx)");
 module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444);
 
+#ifdef DRM_AMDGPU_CIK
+MODULE_PARAM_DESC(enable_cik, "Enable CIK support");
+module_param_named(enable_cik, amdgpu_enable_cik, int, 0444);
+#endif

One issue with this per-driver enable_cik option is that if the user only enables it in the driver where it's disabled by default, without also disabling it in the driver where it's enabled by default, it's back to the current situation where both drivers try to use the same GPUs, and it's up to chance which one actually gets to.

That's why I was thinking about also having a shared command line option respected by both drivers, e.g. amd_cik_driver=amdgpu/radeon . That would be the preferred way to choose the driver at runtime.

Note that the per-driver enable_cik option will still be needed to be able to override the kernel command line when manually loading the drivers.

Maybe there's a better way to handle both cases that I haven't thought of.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): ac35e641-6fd9-a5d1-c4d9-35e71fa9eb08-otUistvHUpPR7s880joybQ@public.gmane.org

#12 lore raw
Quoted 9 lines · Michel Dänzer

One issue with this per-driver enable_cik option is that if the user only enables it in the driver where it's disabled by default, without also disabling it in the driver where it's enabled by default, it's back to the current situation where both drivers try to use the same GPUs, and it's up to chance which one actually gets to.

That's why I was thinking about also having a shared command line option respected by both drivers, e.g. amd_cik_driver=amdgpu/radeon . That would be the preferred way to choose the driver at runtime.

The shared option could not be in either amdgpu or radeon. Otherwise we'd create a cross-dependency between the drivers. It would have to be in drm, I guess?

Quoted 2 lines

Note that the per-driver enable_cik option will still be needed to be able to override the kernel command line when manually loading the drivers.

Why? I could make the shared option writable in /sys/module/drm/parameters/amd_cik_driver so you can change it before loading the module.

Regards,
Felix

Quoted 4 lines

Maybe there's a better way to handle both cases that I haven't thought of.

_______________________________________________
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): cbcc54ec-c86f-f0eb-715e-f66790b5f964-5C7GfCeVMHo@public.gmane.org

#14 lore raw

Am 11.04.2017 um 18:05 schrieb Felix Kuehling:

Quoted 7 lines · Michel Dänzer
Quoted 6 lines

One issue with this per-driver enable_cik option is that if the user only enables it in the driver where it's disabled by default, without also disabling it in the driver where it's enabled by default, it's back to the current situation where both drivers try to use the same GPUs, and it's up to chance which one actually gets to.

Quoted 6 lines
Quoted 3 lines

That's why I was thinking about also having a shared command line option respected by both drivers, e.g. amd_cik_driver=amdgpu/radeon . That would be the preferred way to choose the driver at runtime.

The shared option could not be in either amdgpu or radeon. Otherwise we'd create a cross-dependency between the drivers. It would have to be in drm, I guess?

Yes, but to be honest that sounds more and more like shooting with cannonballs on birds to me.

At least I was fine with the per driver config option.

Regards,
Christian.

Quoted 10 lines
Quoted 3 lines

Note that the per-driver enable_cik option will still be needed to be able to override the kernel command line when manually loading the drivers.

Why? I could make the shared option writable in /sys/module/drm/parameters/amd_cik_driver so you can change it before loading the module.

Regards,
Felix

Quoted 7 lines
Quoted 3 lines

Maybe there's a better way to handle both cases that I haven't thought of.

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

_______________________________________________
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): 10a4dec2-0640-f36e-1902-c5e0cebf59ef-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#16 lore raw
Quoted 15 lines · Christian König

Am 11.04.2017 um 18:05 schrieb Felix Kuehling:

Quoted 7 lines · Michel Dänzer
Quoted 6 lines

One issue with this per-driver enable_cik option is that if the user only enables it in the driver where it's disabled by default, without also disabling it in the driver where it's enabled by default, it's back to the current situation where both drivers try to use the same GPUs, and it's up to chance which one actually gets to.

Quoted 6 lines
Quoted 3 lines

That's why I was thinking about also having a shared command line option respected by both drivers, e.g. amd_cik_driver=amdgpu/radeon . That would be the preferred way to choose the driver at runtime.

The shared option could not be in either amdgpu or radeon. Otherwise we'd create a cross-dependency between the drivers. It would have to be in drm, I guess?

Quoted 9 lines

Yes, but to be honest that sounds more and more like shooting with cannonballs on birds to me.

At least I was fine with the per driver config option.

Regards,
Christian.

Quoted 1 line

Any reason we can't just rip out the PCI IDs for CIK in radeon? If distros then can enable both drivers the kernel will load the correct one based on where the PCI IDs are being probed?

Or are there drm ioctl issues that make that incompatible?

Thanks,
Shawn

Quoted 20 lines
Quoted 10 lines
Quoted 3 lines

Note that the per-driver enable_cik option will still be needed to be able to override the kernel command line when manually loading the drivers.

Why? I could make the shared option writable in /sys/module/drm/parameters/amd_cik_driver so you can change it before loading the module.

Regards,
Felix

Quoted 8 lines
Quoted 4 lines

Maybe there's a better way to handle both cases that I haven't thought of.

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

Quoted 4 lines

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

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

#17 lore raw
In reply to a message not in the archive
Quoted 15 lines · Felix Kuehling
Quoted 9 lines · Michel Dänzer

One issue with this per-driver enable_cik option is that if the user only enables it in the driver where it's disabled by default, without also disabling it in the driver where it's enabled by default, it's back to the current situation where both drivers try to use the same GPUs, and it's up to chance which one actually gets to.

That's why I was thinking about also having a shared command line option respected by both drivers, e.g. amd_cik_driver=amdgpu/radeon . That would be the preferred way to choose the driver at runtime.

The shared option could not be in either amdgpu or radeon. Otherwise we'd create a cross-dependency between the drivers. It would have to be in drm, I guess?

Quoted 6 lines
Quoted 2 lines

Note that the per-driver enable_cik option will still be needed to be able to override the kernel command line when manually loading the drivers.

Why? I could make the shared option writable in /sys/module/drm/parameters/amd_cik_driver so you can change it before loading the module.

I was thinking of a pure kernel command line option which is parsed by both drivers, not a module parameter.

One possibility would be making each driver also parse the other driver's module parameter on the kernel command line. I.e. radeon would parse

amdgpu.enable_cik=0

on the kernel command line and set its own enable_cik parameter to 1, and vice versa. This would probably require making the default value of the enable_cik options e.g. -1, and only parsing the other driver's option in that case.

If you don't want to tackle that, I can give it a go as a follow-up patch.

We do need to settle on whether all those Kconfig options are needed though; I think they're overkill.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 340a5310-e6d1-5e09-81aa-d7106bcdca02-otUistvHUpPR7s880joybQ@public.gmane.org

#19 lore raw
Quoted 5 lines · Michel Dänzer

One possibility would be making each driver also parse the other driver's module parameter on the kernel command line. I.e. radeon would parse

amdgpu.enable_cik=0

I looked for a way to do this. I think I figured out the parsing part. But I can't see where to get the kernel command line from. The command line that is parsed by modules in load_module comes from user mode, and I think it's pre-processed by modprobe to strip the "<module>." prefix and only include the module-specific options.

There is a global variable saved_command_line, which is what's used for /proc/cmdline. But that variable is not exported to modules.

Regards,
Felix
_______________________________________________
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): dedfed15-00b3-83ff-aca7-f4dffff8cc09-5C7GfCeVMHo@public.gmane.org

#21 lore raw
Quoted 6 lines · Felix Kuehling
Quoted 5 lines · Michel Dänzer

One possibility would be making each driver also parse the other driver's module parameter on the kernel command line. I.e. radeon would parse

amdgpu.enable_cik=0

Quoted 8 lines

I looked for a way to do this. I think I figured out the parsing part. But I can't see where to get the kernel command line from. The command line that is parsed by modules in load_module comes from user mode, and I think it's pre-processed by modprobe to strip the "<module>." prefix and only include the module-specific options.

There is a global variable saved_command_line, which is what's used for /proc/cmdline. But that variable is not exported to modules.

I see two possibilities:

Either use __module_param_call directly, like drivers/tty/serial/8250/8250_core.c:s8250_options().

Or use __setup, like e.g. drivers/video/fbdev/core/fb_cmdline.c:video_setup().

I'm leaning towards the former.

Anyway, my offer to look into this as a follow-up change stands; the only issue that needs to be resolved for your patch to land is the Kconfig options.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 4bd2c7cf-a555-6cee-a863-b56ee824f9ad-otUistvHUpPR7s880joybQ@public.gmane.org

#23 lore raw

__setup doesn't work in modules.

s8250_options is only compiled if the driver is not a module.

I came up with a different way to parse another module's options. But I can't get the commandline that I would parse in that way:

@@ -787,12 +793,45 @@ long amdgpu_drm_ioctl(struct file *filp,
.driver.pm = &amdgpu_pm_ops,
};

-
+#if 0
+static int radeon_cik_support = 0;
+static int param_set(const char *val, const struct kernel_param *kp) +{
+ return kstrtoint(val, 0, kp.arg);
+}
+static struct kernel_param_ops radeon_force_cik_param_ops = {

+       .flags = 0,
+       .set = param_set,
+       .get = NULL,
+       .free = NULL
+};
+static struct kernel_param radeon_cik_support_param = {
+       .name = "radeon.cik_support",
+       .mod = THIS_MODULE,
+       .ops = radeon_cik_support_param_ops,
+       .perm = 0444,
+       .level = -1,
+       .flags = 0,
+       .arg = &radeon_cik_support

+};
+#endif

static int __init amdgpu_init(void)

 {
        int r;

+#if 0
+ /* Doesn't work because saved_command_line isn't exported to
+ * modules */
+ r = parse_args("amdgpu", saved_command_line,
+ &radeon_cik_support_param, 1,
+ -32768, 32767, NULL, NULL);
+ if (r)
+ return r;
+
+ amdgpu_cik_support = !radeon_cik_support;
+#endif
+

        r = amdgpu_sync_init();
        if (r)
                goto error_sync;

Regards,
Felix

Quoted 23 lines · Michel Dänzer
Quoted 6 lines · Felix Kuehling
Quoted 5 lines · Michel Dänzer

One possibility would be making each driver also parse the other driver's module parameter on the kernel command line. I.e. radeon would parse

amdgpu.enable_cik=0

Quoted 8 lines

I looked for a way to do this. I think I figured out the parsing part. But I can't see where to get the kernel command line from. The command line that is parsed by modules in load_module comes from user mode, and I think it's pre-processed by modprobe to strip the "<module>." prefix and only include the module-specific options.

There is a global variable saved_command_line, which is what's used for /proc/cmdline. But that variable is not exported to modules.

I see two possibilities:

Either use __module_param_call directly, like drivers/tty/serial/8250/8250_core.c:s8250_options().

Or use __setup, like e.g. drivers/video/fbdev/core/fb_cmdline.c:video_setup().

Quoted 8 lines

I'm leaning towards the former.

Anyway, my offer to look into this as a follow-up change stands; the only issue that needs to be resolved for your patch to land is the Kconfig options.

_______________________________________________
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): f2f87cd4-c6c5-7c62-3035-d2f1584d7f00-5C7GfCeVMHo@public.gmane.org

#25 lore raw
Quoted 1 line · Felix Kuehling

__setup doesn't work in modules.

Right. We could build something like drivers/video/fbdev/core/fb_cmdline.c:video_setup() into the kernel to handle this, but it's a bit ugly, which is one reason why I was leaning towards:

Quoted 1 line

s8250_options is only compiled if the driver is not a module.

That doesn't prevent us from using __module_param_call directly, does it?

Although, that still doesn't work as I envision if only one driver's option is set e.g. in /etc/modprobe.d/*.conf .

So, I'm starting to think we need a shared module for this, which provides one or multiple module parameters to choose which driver to use for CIK/SI[0], and provides the result to the amdgpu/radeon drivers. That might make things easier for amdgpu-pro / other standalone amdgpu versions in the long run as well, as they could add files to /etc/modprobe.d/ choosing themselves by default, without having to blacklist radeon.

What do you guys think?

[0] or possibly even more fine-grained in the future

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): cebca833-9e3f-86c5-8100-feca6ea590e5-otUistvHUpPR7s880joybQ@public.gmane.org

#27 lore raw
Quoted 25 lines · Michel Dänzer
Quoted 1 line · Felix Kuehling

__setup doesn't work in modules.

Right. We could build something like drivers/video/fbdev/core/fb_cmdline.c:video_setup() into the kernel to handle this, but it's a bit ugly, which is one reason why I was leaning towards:

Quoted 1 line

s8250_options is only compiled if the driver is not a module.

That doesn't prevent us from using __module_param_call directly, does it?

Although, that still doesn't work as I envision if only one driver's option is set e.g. in /etc/modprobe.d/*.conf .

So, I'm starting to think we need a shared module for this, which provides one or multiple module parameters to choose which driver to use for CIK/SI[0], and provides the result to the amdgpu/radeon drivers. That might make things easier for amdgpu-pro / other standalone amdgpu versions in the long run as well, as they could add files to /etc/modprobe.d/ choosing themselves by default, without having to blacklist radeon.

Quoted 1 line

What do you guys think?

I suspect that adding an entire module just to select between two other modules is the kind of thing that should be discussed in a wider audience first.

It is probably the cleanest solution that doesn't require teaching the general modprobe architecture about having multiple modules for the same PCI ID...

Cheers,
Nicolai

Quoted 4 lines

[0] or possibly even more fine-grained in the future

Signature · 6 lines
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
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): 5b7d9374-8277-4c35-efc7-9e93069426a2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#29 lore raw
Quoted 11 lines · Nicolai Hähnle
Quoted 10 lines · Michel Dänzer

On 22/04/17 02:05 AM, Felix Kuehling wrote:

So, I'm starting to think we need a shared module for this, which provides one or multiple module parameters to choose which driver to use for CIK/SI[0], and provides the result to the amdgpu/radeon drivers. That might make things easier for amdgpu-pro / other standalone amdgpu versions in the long run as well, as they could add files to /etc/modprobe.d/ choosing themselves by default, without having to blacklist radeon.

Quoted 3 lines
Quoted 1 line

What do you guys think?

I suspect that adding an entire module

That sounds quite dramatic. :) Which particular aspect(s) of that are you concerned about?

Quoted 1 line

just to select between two other modules

FWIW, I suspect that could actually end up smaller overall than the alternatives we've discussed at least by some metrics.

And maybe this module could be used for sharing / coordinating more stuff between the drivers in the future.

Quoted 1 line

is the kind of thing that should be discussed in a wider audience first.

I'd like to have at least a proof of concept before that.

Signature · 7 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#30 lore raw
In reply to a message not in the archive
Quoted 23 lines · Michel Dänzer
Quoted 1 line · Felix Kuehling

__setup doesn't work in modules.

Right. We could build something like drivers/video/fbdev/core/fb_cmdline.c:video_setup() into the kernel to handle this, but it's a bit ugly, which is one reason why I was leaning towards:

Quoted 1 line

s8250_options is only compiled if the driver is not a module.

That doesn't prevent us from using __module_param_call directly, does it?

Although, that still doesn't work as I envision if only one driver's option is set e.g. in /etc/modprobe.d/*.conf .

So, I'm starting to think we need a shared module for this, which provides one or multiple module parameters to choose which driver to use for CIK/SI[0], and provides the result to the amdgpu/radeon drivers. That might make things easier for amdgpu-pro / other standalone amdgpu versions in the long run as well, as they could add files to /etc/modprobe.d/ choosing themselves by default, without having to blacklist radeon.

Quoted 1 line

What do you guys think?

Hi Michel,

You said in an earlier email that it doesn't have to be convenient. With that in mind, I went back to a minimalistic solution that doesn't need any additional Kconfig options and only uses two module parameters (one in radeon, one in amdgpu).

I'm attaching my WIP patches for reference (currently based on amd-kfd-staging). For an official review I'd rebase them on amd-staging-4.9, remove the #if-0-ed hack that didn't work out, and add the same for SI.

Can everyone can agree that this is good enough?

Regards,
Felix

Quoted 6 lines

[0] or possibly even more fine-grained in the future

From e1d5fc320dbe2f60d922c466986863489f4bfe77 Mon Sep 17 00:00:00 2001

From: Felix Kuehling <[email protected]>
Date: Thu, 20 Apr 2017 14:41:34 -0400
Subject: [PATCH 1/2] 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.

Change-Id Ib594f7359b9b3143c859b3be5c0244a9a2a773cd
---
 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 5f16bf3..a05aaea 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 d6d58bc..28ab255 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_warn(dev->dev,
+				 "CIK support provided by amdgpu.\n");
+			dev_warn(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 · 1 line
1.9.1
Quoted 1 line

From 18d4b8b6282215073c3c6762f36c9009b1218f3c Mon Sep 17 00:00:00 2001

From: Felix Kuehling <[email protected]>
Date: Thu, 20 Apr 2017 14:42:04 -0400
Subject: [PATCH 2/2] 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.

Change-Id Ica1296beae96b1c5f48698c06cfd2453fe1ff080
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     |  4 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 41 ++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 ++++++++++++
 3 files changed, 59 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +4 -0
index e6e623a..eaf980d 100644
@@ -113,6 +113,10 @@
 extern int amdgpu_cntl_sb_buf_per_se;
 extern int amdgpu_param_buf_per_se;
 
+#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 +40 -1

58 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +15 -0
index 6443e24..e51c92f 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_warn(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 · 1 line
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): 588f3a43-3f29-e733-1ffd-154878303f0f-5C7GfCeVMHo@public.gmane.org

#32 lore raw

Am 26.04.2017 um 22:15 schrieb Felix Kuehling:

Quoted 32 lines · Michel Dänzer
Quoted 23 lines · Felix Kuehling
Quoted 1 line

__setup doesn't work in modules.

Right. We could build something like drivers/video/fbdev/core/fb_cmdline.c:video_setup() into the kernel to handle this, but it's a bit ugly, which is one reason why I was leaning towards:

Quoted 1 line

s8250_options is only compiled if the driver is not a module.

That doesn't prevent us from using __module_param_call directly, does it?

Although, that still doesn't work as I envision if only one driver's option is set e.g. in /etc/modprobe.d/*.conf .

So, I'm starting to think we need a shared module for this, which provides one or multiple module parameters to choose which driver to use for CIK/SI[0], and provides the result to the amdgpu/radeon drivers. That might make things easier for amdgpu-pro / other standalone amdgpu versions in the long run as well, as they could add files to /etc/modprobe.d/ choosing themselves by default, without having to blacklist radeon.

Quoted 1 line

What do you guys think?

Hi Michel,

You said in an earlier email that it doesn't have to be convenient. With that in mind, I went back to a minimalistic solution that doesn't need any additional Kconfig options and only uses two module parameters (one in radeon, one in amdgpu).

Quoted 6 lines

I'm attaching my WIP patches for reference (currently based on amd-kfd-staging). For an official review I'd rebase them on amd-staging-4.9, remove the #if-0-ed hack that didn't work out, and add the same for SI.

Can everyone can agree that this is good enough?

It's certainly good enough for me.

With the disabled dummy code removed feel free to stick a Reviewed-by: Christian König <[email protected]> at those patches.

Regards,
Christian.

Quoted 5 lines

Regards,
Felix

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

[0] or possibly even more fine-grained in the future

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

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

#33 lore raw
In reply to a message not in the archive
Quoted 8 lines · Felix Kuehling

Hi Michel,

You said in an earlier email that it doesn't have to be convenient. With that in mind, I went back to a minimalistic solution that doesn't need any additional Kconfig options and only uses two module parameters (one in radeon, one in amdgpu).

Quoted 6 lines

I'm attaching my WIP patches for reference (currently based on amd-kfd-staging). For an official review I'd rebase them on amd-staging-4.9, remove the #if-0-ed hack that didn't work out, and add the same for SI.

Can everyone can agree that this is good enough?

Yes, something like this could be a good first step in the right direction. Some comments:

The radeon options should be available regardless of CONFIG_DRM_AMDGPU_CIK/SI, or they won't be useful for amdgpu-pro / other out-of-tree amdgpu builds.

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled; more definitely so for SI. Then we can flip the default and remove CONFIG_DRM_AMDGPU_CIK/SI at some point in the future, and (much) later maybe remove the CIK/SI code from radeon.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 04fb5e39-c951-d58f-97c7-eedb604624fd-otUistvHUpPR7s880joybQ@public.gmane.org

#35 lore raw
Quoted 13 lines · Michel Dänzer
Quoted 12 lines · Felix Kuehling

Hi Michel,

You said in an earlier email that it doesn't have to be convenient. With that in mind, I went back to a minimalistic solution that doesn't need any additional Kconfig options and only uses two module parameters (one in radeon, one in amdgpu).

I'm attaching my WIP patches for reference (currently based on amd-kfd-staging). For an official review I'd rebase them on amd-staging-4.9, remove the #if-0-ed hack that didn't work out, and add the same for SI.

Quoted 7 lines
Quoted 1 line

Can everyone can agree that this is good enough?

Yes, something like this could be a good first step in the right direction. Some comments:

The radeon options should be available regardless of CONFIG_DRM_AMDGPU_CIK/SI, or they won't be useful for amdgpu-pro / other out-of-tree amdgpu builds.

Hmm, when an amdgpu-pro build is installed on a system with an older kernel, radeon won't have the module option at all. Unless the pro-build blacklists radeon, or replaces radeon with its own version, it will always have to be compiled without CIK support.

Therefore, I think my patch, meant for upstream, should not consider this case.

Quoted 3 lines

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled;

Alex and Christian seem to think otherwise.

Regards,
Felix

Quoted 6 lines

more
definitely so for SI. Then we can flip the default and remove CONFIG_DRM_AMDGPU_CIK/SI at some point in the future, and (much) later maybe remove the CIK/SI code from radeon.

_______________________________________________
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): f28b5760-4751-4f88-b62f-8c73a1df61f9-5C7GfCeVMHo@public.gmane.org

#37 lore raw
Quoted 22 lines · Felix Kuehling
Quoted 13 lines · Michel Dänzer
Quoted 12 lines · Felix Kuehling

Hi Michel,

You said in an earlier email that it doesn't have to be convenient. With that in mind, I went back to a minimalistic solution that doesn't need any additional Kconfig options and only uses two module parameters (one in radeon, one in amdgpu).

I'm attaching my WIP patches for reference (currently based on amd-kfd-staging). For an official review I'd rebase them on amd-staging-4.9, remove the #if-0-ed hack that didn't work out, and add the same for SI.

Quoted 7 lines
Quoted 1 line

Can everyone can agree that this is good enough?

Yes, something like this could be a good first step in the right direction. Some comments:

The radeon options should be available regardless of CONFIG_DRM_AMDGPU_CIK/SI, or they won't be useful for amdgpu-pro / other out-of-tree amdgpu builds.

Quoted 7 lines

Hmm, when an amdgpu-pro build is installed on a system with an older kernel, radeon won't have the module option at all. Unless the pro-build blacklists radeon, or replaces radeon with its own version, it will always have to be compiled without CIK support.

Therefore, I think my patch, meant for upstream, should not consider this case.

Obviously, out-of-tree module builds will have to continue doing what they've been doing so far with kernels without your patch. I'm thinking about making it easier for them with kernels which do have your patch. At some point in the future, maybe the support for kernels without your patch can be dropped entirely.

Quoted 4 lines
Quoted 2 lines

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled;

Alex and Christian seem to think otherwise.

FWIW, on my AMD notebook (HP EliteBook 725 G2, Kaveri), suspend/resume with amdgpu results in a black screen (can reboot blindly); works fine with radeon.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): fe21a443-161f-631a-12dd-84faabfc2f88-otUistvHUpPR7s880joybQ@public.gmane.org

#39 lore raw
Quoted 5 lines · Michel Dänzer

Obviously, out-of-tree module builds will have to continue doing what they've been doing so far with kernels without your patch. I'm thinking about making it easier for them with kernels which do have your patch. At some point in the future, maybe the support for kernels without your patch can be dropped entirely.

I think out-of-tree builds using the CONFIG_AMDGPU_CIK option of the target kernel is not safe. Hybrid should use its own option that is determined by what the hybrid stack supports (kernel and user mode).

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled;

Alex and Christian seem to think otherwise.

FWIW, on my AMD notebook (HP EliteBook 725 G2, Kaveri), suspend/resume with amdgpu results in a black screen (can reboot blindly); works fine with radeon.

Has this problem been reported anywhere? Is anyone working on fixing it? If it's not reported, it will never be fixed.

Regards,
Felix

_______________________________________________
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): eecf434d-54c0-6b6e-12db-4370249e5065-5C7GfCeVMHo@public.gmane.org

#41 lore raw
Quoted 10 lines · Felix Kuehling
Quoted 5 lines · Michel Dänzer

Obviously, out-of-tree module builds will have to continue doing what they've been doing so far with kernels without your patch. I'm thinking about making it easier for them with kernels which do have your patch. At some point in the future, maybe the support for kernels without your patch can be dropped entirely.

I think out-of-tree builds using the CONFIG_AMDGPU_CIK option of the target kernel is not safe. Hybrid should use its own option that is determined by what the hybrid stack supports (kernel and user mode).

Sure, that's not what I mean. I mean out-of-tree builds can use

options radeon ci_support=0 si_support=0

e.g. in /etc/modprobe.d/amdgpu-dkms.conf to prefer amdgpu in a cleaner way than by blacklisting radeon.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled;

Alex and Christian seem to think otherwise.

FWIW, on my AMD notebook (HP EliteBook 725 G2, Kaveri), suspend/resume with amdgpu results in a black screen (can reboot blindly); works fine with radeon.

Has this problem been reported anywhere? Is anyone working on fixing it? If it's not reported, it will never be fixed.

You're right, I'll file a bug report.

Another issue is the lack of HDMI / DP audio support without DC. It seems weird to change the default to amdgpu before there is feature parity.

Anyway, go ahead and land your latest series, you can have my

for that. I'll propose some changes on top of that.

Signature · 7 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

_______________________________________________
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): 64dbb041-e331-6f0b-7373-b845bc239341-otUistvHUpPR7s880joybQ@public.gmane.org

#43 lore raw
Quoted 6 lines · Michel Dänzer
Quoted 5 lines · Felix Kuehling
Quoted 3 lines · Michel Dänzer
Quoted 3 lines
Quoted 2 lines

The default at this point should possibly still be for CIK GPUs to be driven by radeon, even if CONFIG_DRM_AMDGPU_CIK is enabled;

Alex and Christian seem to think otherwise.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

FWIW, on my AMD notebook (HP EliteBook 725 G2, Kaveri), suspend/resume with amdgpu results in a black screen (can reboot blindly); works fine with radeon.

Has this problem been reported anywhere? Is anyone working on fixing it? If it's not reported, it will never be fixed.

You're right, I'll file a bug report.

I get the same error lines as described in
https://bugs.freedesktop.org/100949, I'm trying to get clarification if it's the same bug.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx