drm/amd/display: call amdgpu_dm_fini when hw_fini.
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 22 May 2017 05:11:15 +0000 (13:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:07:29 +0000 (18:07 -0400)
to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.
[drm:drm_debugfs_init [drm]] *ERROR* Cannot create /sys/kernel/debug/dri/0
[drm:drm_minor_register [drm]] *ERROR* DRM: Failed to initialize /sys/kernel/debug/dri.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Andrey Grodzovsky<andrey.grodzovsky@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc.c

index 7e28f98..74415fd 100644 (file)
@@ -395,9 +395,8 @@ void amdgpu_dm_fini(struct amdgpu_device *adev)
                adev->dm.freesync_module = NULL;
        }
        /* DC Destroy TODO: Replace destroy DAL */
-       {
+       if (adev->dm.dc)
                dc_destroy(&adev->dm.dc);
-       }
        return;
 }
 
@@ -490,7 +489,7 @@ static int dm_hw_fini(void *handle)
        amdgpu_dm_hpd_fini(adev);
 
        amdgpu_dm_irq_fini(adev);
-
+       amdgpu_dm_fini(adev);
        return 0;
 }
 
index 773f0ef..b428c7c 100644 (file)
@@ -1541,7 +1541,12 @@ enum dc_irq_source dc_interrupt_to_irq_source(
 
 void dc_interrupt_set(const struct dc *dc, enum dc_irq_source src, bool enable)
 {
-       struct core_dc *core_dc = DC_TO_CORE(dc);
+       struct core_dc *core_dc;
+
+       if (dc == NULL)
+               return;
+       core_dc = DC_TO_CORE(dc);
+
        dal_irq_service_set(core_dc->res_pool->irqs, src, enable);
 }