]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Feb 2020 16:21:30 +0000 (11:21 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Feb 2020 19:21:13 +0000 (14:21 -0500)
In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for display.

v2: add config guard for DC

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com> (v1)
Acked-by: Christian König <christian.koenig@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 02077b1ae3fe3ef52ce1b868024886fb6725708f..3bb74056b9d20b8ca6f0bb3354b2b2e0fb1d7d0b 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "amdgpu.h"
 #include "amdgpu_pm.h"
+#include "amdgpu_dm_debugfs.h"
 
 /**
  * amdgpu_debugfs_add_files - Add simple debugfs entries
@@ -1316,6 +1317,13 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
        if (r)
                DRM_ERROR("registering firmware debugfs failed (%d).\n", r);
 
+#if defined(CONFIG_DRM_AMD_DC)
+       if (amdgpu_device_has_dc_support(adev)) {
+               if (dtn_debugfs_init(adev))
+                       DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n");
+       }
+#endif
+
        for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
                struct amdgpu_ring *ring = adev->rings[i];
 
index 73bb36c63ea8aa889d4ccf60d41fd3d103b77312..200733d503adf1f3c20d6ce2f6057c179be04208 100644 (file)
@@ -1008,11 +1008,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
                goto error;
        }
 
-#if defined(CONFIG_DEBUG_FS)
-       if (dtn_debugfs_init(adev))
-               DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n");
-#endif
-
        DRM_DEBUG_DRIVER("KMS initialized.\n");
 
        return 0;