Skip to contentSkip to conversation

drm/amd/display: call amdgpu_dm_fini whewn hw_fini.

PATCH In review Rex Zhu 4 participants 4 messages May 24, 2017 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/display: call amdgpu_dm_fini whewn hw_fini.

to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.

Change-Id: I493bc923b039eae69717cbe8a85c8f3f3ea97465 [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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 7 ++++++-
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -3
index e39aef6..2774f86 100644
@@ -393,9 +393,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;
 }
 
@@ -488,7 +487,7 @@ static int dm_hw_fini(void *handle)
 	amdgpu_dm_hpd_fini(adev);
 
 	amdgpu_dm_irq_fini(adev);
-
+	amdgpu_dm_fini(adev);
 	return 0;
 }
 
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
index 8106e01..8e1b573 100644
@@ -1583,7 +1583,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);
 }
 
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): 1495624808-19164-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Acked-by Alex Deucher
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Wednesday, May 24, 2017 7:20 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/display: call amdgpu_dm_fini whewn hw_fini.

to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.

+Harry, Andrey

Quoted 61 lines

Change-Id: I493bc923b039eae69717cbe8a85c8f3f3ea97465 [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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 7 ++++++-
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -3
index e39aef6..2774f86 100644
@@ -393,9 +393,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;
 }
 
@@ -488,7 +487,7 @@ static int dm_hw_fini(void *handle)
 	amdgpu_dm_hpd_fini(adev);
 
 	amdgpu_dm_irq_fini(adev);
-
+	amdgpu_dm_fini(adev);
 	return 0;
 }
 
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -2
index 8106e01..8e1b573 100644
@@ -1583,7 +1583,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);
 }
 
--

1.9.1

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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB16524BD226C76A3D640F24F5F7FE0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Andrey Grodzovsky
#4 lore raw
Quoted 85 lines

-----Original Message-----
From: Deucher, Alexander
Sent: Wednesday, May 24, 2017 9:10 AM
To: Zhu, Rex; [email protected]; Wentland, Harry; Grodzovsky, Andrey
Cc: Zhu, Rex
Subject: RE: [PATCH] drm/amd/display: call amdgpu_dm_fini whewn hw_fini.

Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Wednesday, May 24, 2017 7:20 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/display: call amdgpu_dm_fini whewn hw_fini.

to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.

+Harry, Andrey

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_fini(struct amdgpu_device

Quoted 19 lines

Change-Id: I493bc923b039eae69717cbe8a85c8f3f3ea97465 [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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 7 ++++++-
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index e39aef6..2774f86 100644
@@ -393,9 +393,8 @@ void amdgpu_dm_fini(struct amdgpu_device

*adev)

drivers/gpu/drm/amd/display/dc/core/dc.c enum dc_irq_source

Quoted 25 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -3
 		adev->dm.freesync_module = NULL;
 	}
 	/* DC Destroy TODO: Replace destroy DAL */
-	{
+	if (adev->dm.dc)
 		dc_destroy(&adev->dm.dc);
-	}
 	return;
 }
 
@@ -488,7 +487,7 @@ static int dm_hw_fini(void *handle)
 	amdgpu_dm_hpd_fini(adev);
 
 	amdgpu_dm_irq_fini(adev);
-
+	amdgpu_dm_fini(adev);
 	return 0;
 }
 
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index 8106e01..8e1b573 100644
@@ -1583,7 +1583,12 @@ enum dc_irq_source

dc_interrupt_to_irq_source(

Quoted 14 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
 void dc_interrupt_set(const struct dc *dc, enum dc_irq_source src,

bool
enable)
{

drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
-	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);  }
Quoted 7 lines
Quoted 7 lines

--
1.9.1

_______________________________________________
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

Reviewed-by
#5 lore raw
In reply to a message not in the archive

Please fix the typo (whewn -> when) in the title.

With that this patch is

Harry

Quoted 47 lines · Rex Zhu

to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.

Change-Id: I493bc923b039eae69717cbe8a85c8f3f3ea97465 [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.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
  drivers/gpu/drm/amd/display/dc/core/dc.c          | 7 ++++++-
  2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -3
index e39aef6..2774f86 100644
@@ -393,9 +393,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;
  }
 
@@ -488,7 +487,7 @@ static int dm_hw_fini(void *handle)
  	amdgpu_dm_hpd_fini(adev);
 
  	amdgpu_dm_irq_fini(adev);
-
+	amdgpu_dm_fini(adev);
  	return 0;
  }
 
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index 8106e01..8e1b573 100644
@@ -1583,7 +1583,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)
  {

drivers/gpu/drm/amd/display/dc/core/dc.c enum dc_irq_source dc_interrupt_to_irq_source( · line 1594

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
-	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);
  }
 

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