]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/radeon: Add module param to control CIK support
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 20 Apr 2017 18:41:34 +0000 (14:41 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 22:22:50 +0000 (18:22 -0400)
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>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_kms.c

index c1c8e2208a21b4fd045d309249051dd391a14ec1..0a0341528471be39ee4f7124614c5216d402b3f3 100644 (file)
@@ -116,6 +116,10 @@ extern int radeon_mst;
 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;
index ef8a759409804bf74076986395fee5e536e674a5..acb37386c9f8356e21f331dbe9355a6fd09d38d3 100644 (file)
@@ -295,6 +295,12 @@ module_param_named(uvd, radeon_uvd, int, 0444);
 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
 };
index 6a68d440bc4486b73a8c3433dd5083c42fb8d2ef..f0abba3caac29666004f4ceb03ee14e6ec3bcf33 100644 (file)
@@ -98,6 +98,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;