aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-04-20 14:41:34 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-24 18:22:50 -0400
commite7f78b69aba479728865ef3ec4229b372fc79f94 (patch)
tree2b83271bce7ba877bc81d2b26e414237d7c27d61
parent9c2e1ae3ae2fe4759359d76f1e639e0eb4f79030 (diff)
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. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Acked-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon.h4
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c18
3 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c1c8e2208a21..0a0341528471 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -116,6 +116,10 @@ extern int radeon_mst;
116extern int radeon_uvd; 116extern int radeon_uvd;
117extern int radeon_vce; 117extern int radeon_vce;
118 118
119#ifdef CONFIG_DRM_AMDGPU_CIK
120extern int radeon_cik_support;
121#endif
122
119/* 123/*
120 * Copy from radeon_drv.h so we don't have to include both and have conflicting 124 * Copy from radeon_drv.h so we don't have to include both and have conflicting
121 * symbol; 125 * symbol;
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index ef8a75940980..acb37386c9f8 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -295,6 +295,12 @@ module_param_named(uvd, radeon_uvd, int, 0444);
295MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)"); 295MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
296module_param_named(vce, radeon_vce, int, 0444); 296module_param_named(vce, radeon_vce, int, 0444);
297 297
298#ifdef CONFIG_DRM_AMDGPU_CIK
299int radeon_cik_support = 0;
300MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
301module_param_named(cik_support, radeon_cik_support, int, 0444);
302#endif
303
298static struct pci_device_id pciidlist[] = { 304static struct pci_device_id pciidlist[] = {
299 radeon_PCI_IDS 305 radeon_PCI_IDS
300}; 306};
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 6a68d440bc44..f0abba3caac2 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -98,6 +98,24 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
98 struct radeon_device *rdev; 98 struct radeon_device *rdev;
99 int r, acpi_status; 99 int r, acpi_status;
100 100
101#ifdef CONFIG_DRM_AMDGPU_CIK
102 if (!radeon_cik_support) {
103 switch (flags & RADEON_FAMILY_MASK) {
104 case CHIP_KAVERI:
105 case CHIP_BONAIRE:
106 case CHIP_HAWAII:
107 case CHIP_KABINI:
108 case CHIP_MULLINS:
109 dev_info(dev->dev,
110 "CIK support provided by amdgpu.\n");
111 dev_info(dev->dev,
112 "Use radeon.cik_support=1 amdgpu.cik_support=0 to override.\n"
113 );
114 return -ENODEV;
115 }
116 }
117#endif
118
101 rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL); 119 rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
102 if (rdev == NULL) { 120 if (rdev == NULL) {
103 return -ENOMEM; 121 return -ENOMEM;