drm/amdgpu: Don't need to call csb_vram_unpin

Submitted by Deng, Emily on May 24, 2019, 10:33 a.m.

Details

Message ID 1558694002-19915-1-git-send-email-Emily.Deng@amd.com
State New
Headers show
Series "drm/amdgpu: Don't need to call csb_vram_unpin" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Deng, Emily May 24, 2019, 10:33 a.m.
As it will destory clear_state_obj, and also will
unpin it in the gfx_v9_0_sw_fini, so don't need to
call csb_vram unpin in gfx_v9_0_hw_fini, or it will
have unpin warning.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 ----------------
 1 file changed, 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index c763733..231b9e0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1154,20 +1154,6 @@  static int gfx_v9_0_csb_vram_pin(struct amdgpu_device *adev)
 	return r;
 }
 
-static void gfx_v9_0_csb_vram_unpin(struct amdgpu_device *adev)
-{
-	int r;
-
-	if (!adev->gfx.rlc.clear_state_obj)
-		return;
-
-	r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);
-	if (likely(r == 0)) {
-		amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
-		amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
-	}
-}
-
 static void gfx_v9_0_mec_fini(struct amdgpu_device *adev)
 {
 	amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);
@@ -3385,8 +3371,6 @@  static int gfx_v9_0_hw_fini(void *handle)
 	gfx_v9_0_cp_enable(adev, false);
 	adev->gfx.rlc.funcs->stop(adev);
 
-	gfx_v9_0_csb_vram_unpin(adev);
-
 	return 0;
 }
 

Comments

Ping......

Best wishes
Emily Deng
>-----Original Message-----

>From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Emily

>Deng

>Sent: Friday, May 24, 2019 6:33 PM

>To: amd-gfx@lists.freedesktop.org

>Cc: Deng, Emily <Emily.Deng@amd.com>

>Subject: [PATCH] drm/amdgpu: Don't need to call csb_vram_unpin

>

>[CAUTION: External Email]

>

>As it will destory clear_state_obj, and also will unpin it in the gfx_v9_0_sw_fini,

>so don't need to call csb_vram unpin in gfx_v9_0_hw_fini, or it will have unpin

>warning.

>

>Signed-off-by: Emily Deng <Emily.Deng@amd.com>

>---

> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 ----------------

> 1 file changed, 16 deletions(-)

>

>diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

>b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

>index c763733..231b9e0 100644

>--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

>+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

>@@ -1154,20 +1154,6 @@ static int gfx_v9_0_csb_vram_pin(struct

>amdgpu_device *adev)

>        return r;

> }

>

>-static void gfx_v9_0_csb_vram_unpin(struct amdgpu_device *adev) -{

>-       int r;

>-

>-       if (!adev->gfx.rlc.clear_state_obj)

>-               return;

>-

>-       r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);

>-       if (likely(r == 0)) {

>-               amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);

>-               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);

>-       }

>-}

>-

> static void gfx_v9_0_mec_fini(struct amdgpu_device *adev)  {

>        amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);

>@@ -3385,8 +3371,6 @@ static int gfx_v9_0_hw_fini(void *handle)

>        gfx_v9_0_cp_enable(adev, false);

>        adev->gfx.rlc.funcs->stop(adev);

>

>-       gfx_v9_0_csb_vram_unpin(adev);

>-

>        return 0;

> }

>

>--

>2.7.4

>

>_______________________________________________

>amd-gfx mailing list

>amd-gfx@lists.freedesktop.org

>https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Did you ever test S3 suspend/resume? On S3 suspend/resume path, only hw_fini was called.

> -----Original Message-----

> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of

> Deng, Emily

> Sent: Monday, May 27, 2019 11:09 AM

> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org

> Subject: RE: [PATCH] drm/amdgpu: Don't need to call csb_vram_unpin

> 

> Ping......

> 

> Best wishes

> Emily Deng

> >-----Original Message-----

> >From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of

> >Emily Deng

> >Sent: Friday, May 24, 2019 6:33 PM

> >To: amd-gfx@lists.freedesktop.org

> >Cc: Deng, Emily <Emily.Deng@amd.com>

> >Subject: [PATCH] drm/amdgpu: Don't need to call csb_vram_unpin

> >

> >[CAUTION: External Email]

> >

> >As it will destory clear_state_obj, and also will unpin it in the

> >gfx_v9_0_sw_fini, so don't need to call csb_vram unpin in

> >gfx_v9_0_hw_fini, or it will have unpin warning.

> >

> >Signed-off-by: Emily Deng <Emily.Deng@amd.com>

> >---

> > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 ----------------

> > 1 file changed, 16 deletions(-)

> >

> >diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

> >b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

> >index c763733..231b9e0 100644

> >--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

> >+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

> >@@ -1154,20 +1154,6 @@ static int gfx_v9_0_csb_vram_pin(struct

> >amdgpu_device *adev)

> >        return r;

> > }

> >

> >-static void gfx_v9_0_csb_vram_unpin(struct amdgpu_device *adev) -{

> >-       int r;

> >-

> >-       if (!adev->gfx.rlc.clear_state_obj)

> >-               return;

> >-

> >-       r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);

> >-       if (likely(r == 0)) {

> >-               amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);

> >-               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);

> >-       }

> >-}

> >-

> > static void gfx_v9_0_mec_fini(struct amdgpu_device *adev)  {

> >        amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);

> >@@ -3385,8 +3371,6 @@ static int gfx_v9_0_hw_fini(void *handle)

> >        gfx_v9_0_cp_enable(adev, false);

> >        adev->gfx.rlc.funcs->stop(adev);

> >

> >-       gfx_v9_0_csb_vram_unpin(adev);

> >-

> >        return 0;

> > }

> >

> >--

> >2.7.4

> >

> >_______________________________________________

> >amd-gfx mailing list

> >amd-gfx@lists.freedesktop.org

> >https://lists.freedesktop.org/mailman/listinfo/amd-gfx

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx