All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
@ 2019-08-02  5:22 likun Gao
       [not found] ` <1564723334-18375-1-git-send-email-likun.gao-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: likun Gao @ 2019-08-02  5:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alex Deucher, Likun Gao, Paul Gover

From: Likun Gao <Likun.Gao@amd.com>

Remove unpin rlc clear_state_obj for gfx v8 when rlc init,
which will make Stoney pm_suspend hang.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index d290718..0b73c6e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -1292,6 +1292,8 @@ static int gfx_v8_0_cp_jump_table_num(struct amdgpu_device *adev)
 
 static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
 {
+	volatile u32 *dst_ptr;
+	u32 dws;
 	const struct cs_section_def *cs_data;
 	int r;
 
@@ -1300,10 +1302,24 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
 	cs_data = adev->gfx.rlc.cs_data;
 
 	if (cs_data) {
-		/* init clear state block */
-		r = amdgpu_gfx_rlc_init_csb(adev);
-		if (r)
+		/* clear state block */
+		adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs->get_csb_size(adev);
+		r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
+					      AMDGPU_GEM_DOMAIN_VRAM,
+					      &adev->gfx.rlc.clear_state_obj,
+					      &adev->gfx.rlc.clear_state_gpu_addr,
+					      (void **)&adev->gfx.rlc.cs_ptr);
+		if (r) {
+			dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
+			amdgpu_gfx_rlc_fini(adev);
 			return r;
+		}
+
+		/* set up the cs buffer */
+		dst_ptr = adev->gfx.rlc.cs_ptr;
+		adev->gfx.rlc.funcs->get_csb_buffer(adev, dst_ptr);
+		amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
+		amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
 	}
 
 	if ((adev->asic_type == CHIP_CARRIZO) ||
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
       [not found] ` <1564723334-18375-1-git-send-email-likun.gao-5C7GfCeVMHo@public.gmane.org>
@ 2019-08-02  6:12   ` Yuan, Xiaojie
       [not found]     ` <BN8PR12MB3602D2293EFA72B3A3545EE389D90-h6+T2+wrnx1lGJ5xs4l7kQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yuan, Xiaojie @ 2019-08-02  6:12 UTC (permalink / raw)
  To: Gao, Likun, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander, Paul Gover

Hi Likun,

Looks like you can pin csb buffer @gfx_v8_0_hw_init() just like what following patch does for gfx9, so that we can still use the common function amdgpu_gfx_rlc_init_csb():

commit 137dc4b9060e99a22dce59b42ca71912cf0180f3
Author: Evan Quan <evan.quan@amd.com>
Date:   Wed Jul 4 16:21:52 2018 +0800

    drm/amdgpu: pin the csb buffer on hw init v2

    Without this pin, the csb buffer will be filled with inconsistent
    data after S3 resume. And that will causes gfx hang on gfxoff
    exit since this csb will be executed then.

    v2: fit amdgpu_bo_pin change(take one less argument)

    Signed-off-by: Evan Quan <evan.quan@amd.com>
    Reviewed-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

BR,
Xiaojie

________________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of likun Gao <likun.gao@amd.com>
Sent: Friday, August 2, 2019 1:22 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander; Gao, Likun; Paul Gover
Subject: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8

From: Likun Gao <Likun.Gao@amd.com>

Remove unpin rlc clear_state_obj for gfx v8 when rlc init,
which will make Stoney pm_suspend hang.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index d290718..0b73c6e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -1292,6 +1292,8 @@ static int gfx_v8_0_cp_jump_table_num(struct amdgpu_device *adev)

 static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
 {
+       volatile u32 *dst_ptr;
+       u32 dws;
        const struct cs_section_def *cs_data;
        int r;

@@ -1300,10 +1302,24 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
        cs_data = adev->gfx.rlc.cs_data;

        if (cs_data) {
-               /* init clear state block */
-               r = amdgpu_gfx_rlc_init_csb(adev);
-               if (r)
+               /* clear state block */
+               adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs->get_csb_size(adev);
+               r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
+                                             AMDGPU_GEM_DOMAIN_VRAM,
+                                             &adev->gfx.rlc.clear_state_obj,
+                                             &adev->gfx.rlc.clear_state_gpu_addr,
+                                             (void **)&adev->gfx.rlc.cs_ptr);
+               if (r) {
+                       dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
+                       amdgpu_gfx_rlc_fini(adev);
                        return r;
+               }
+
+               /* set up the cs buffer */
+               dst_ptr = adev->gfx.rlc.cs_ptr;
+               adev->gfx.rlc.funcs->get_csb_buffer(adev, dst_ptr);
+               amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
+               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
        }

        if ((adev->asic_type == CHIP_CARRIZO) ||
--
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
       [not found]     ` <BN8PR12MB3602D2293EFA72B3A3545EE389D90-h6+T2+wrnx1lGJ5xs4l7kQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-08-02  6:34       ` Gao, Likun
  2019-08-02  9:35       ` Huang, Ray
  1 sibling, 0 replies; 5+ messages in thread
From: Gao, Likun @ 2019-08-02  6:34 UTC (permalink / raw)
  To: Yuan, Xiaojie, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander, Paul Gover

OK, thanks, will try to fix with that method.

Regards,
Likun

-----Original Message-----
From: Yuan, Xiaojie <Xiaojie.Yuan@amd.com> 
Sent: Friday, August 2, 2019 2:12 PM
To: Gao, Likun <Likun.Gao@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Paul Gover <pmw.gover@yahoo.co.uk>
Subject: Re: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8

Hi Likun,

Looks like you can pin csb buffer @gfx_v8_0_hw_init() just like what following patch does for gfx9, so that we can still use the common function amdgpu_gfx_rlc_init_csb():

commit 137dc4b9060e99a22dce59b42ca71912cf0180f3
Author: Evan Quan <evan.quan@amd.com>
Date:   Wed Jul 4 16:21:52 2018 +0800

    drm/amdgpu: pin the csb buffer on hw init v2

    Without this pin, the csb buffer will be filled with inconsistent
    data after S3 resume. And that will causes gfx hang on gfxoff
    exit since this csb will be executed then.

    v2: fit amdgpu_bo_pin change(take one less argument)

    Signed-off-by: Evan Quan <evan.quan@amd.com>
    Reviewed-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

BR,
Xiaojie

________________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of likun Gao <likun.gao@amd.com>
Sent: Friday, August 2, 2019 1:22 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander; Gao, Likun; Paul Gover
Subject: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8

From: Likun Gao <Likun.Gao@amd.com>

Remove unpin rlc clear_state_obj for gfx v8 when rlc init, which will make Stoney pm_suspend hang.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index d290718..0b73c6e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -1292,6 +1292,8 @@ static int gfx_v8_0_cp_jump_table_num(struct amdgpu_device *adev)

 static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)  {
+       volatile u32 *dst_ptr;
+       u32 dws;
        const struct cs_section_def *cs_data;
        int r;

@@ -1300,10 +1302,24 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
        cs_data = adev->gfx.rlc.cs_data;

        if (cs_data) {
-               /* init clear state block */
-               r = amdgpu_gfx_rlc_init_csb(adev);
-               if (r)
+               /* clear state block */
+               adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs->get_csb_size(adev);
+               r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
+                                             AMDGPU_GEM_DOMAIN_VRAM,
+                                             &adev->gfx.rlc.clear_state_obj,
+                                             &adev->gfx.rlc.clear_state_gpu_addr,
+                                             (void **)&adev->gfx.rlc.cs_ptr);
+               if (r) {
+                       dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
+                       amdgpu_gfx_rlc_fini(adev);
                        return r;
+               }
+
+               /* set up the cs buffer */
+               dst_ptr = adev->gfx.rlc.cs_ptr;
+               adev->gfx.rlc.funcs->get_csb_buffer(adev, dst_ptr);
+               amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
+               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
        }

        if ((adev->asic_type == CHIP_CARRIZO) ||
--
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
       [not found]     ` <BN8PR12MB3602D2293EFA72B3A3545EE389D90-h6+T2+wrnx1lGJ5xs4l7kQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2019-08-02  6:34       ` Gao, Likun
@ 2019-08-02  9:35       ` Huang, Ray
       [not found]         ` <MN2PR12MB3309BB83CBB215AA393EDEF7ECD90-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Huang, Ray @ 2019-08-02  9:35 UTC (permalink / raw)
  To: Yuan, Xiaojie, Gao, Likun, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander, Paul Gover

Is the issue triggered on APU?

Actually, while we do S3, the vram bo won't be cleared on APU. This patch is to fix the vram bo clearing on the DGPU side.

Thanks,
Ray

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Yuan, Xiaojie
> Sent: Friday, August 02, 2019 2:12 PM
> To: Gao, Likun <Likun.Gao@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Paul Gover
> <pmw.gover@yahoo.co.uk>
> Subject: Re: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
> 
> Hi Likun,
> 
> Looks like you can pin csb buffer @gfx_v8_0_hw_init() just like what
> following patch does for gfx9, so that we can still use the common function
> amdgpu_gfx_rlc_init_csb():
> 
> commit 137dc4b9060e99a22dce59b42ca71912cf0180f3
> Author: Evan Quan <evan.quan@amd.com>
> Date:   Wed Jul 4 16:21:52 2018 +0800
> 
>     drm/amdgpu: pin the csb buffer on hw init v2
> 
>     Without this pin, the csb buffer will be filled with inconsistent
>     data after S3 resume. And that will causes gfx hang on gfxoff
>     exit since this csb will be executed then.
> 
>     v2: fit amdgpu_bo_pin change(take one less argument)
> 
>     Signed-off-by: Evan Quan <evan.quan@amd.com>
>     Reviewed-by: Huang Rui <ray.huang@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> BR,
> Xiaojie
> 
> ________________________________________
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of likun
> Gao <likun.gao@amd.com>
> Sent: Friday, August 2, 2019 1:22 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander; Gao, Likun; Paul Gover
> Subject: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
> 
> From: Likun Gao <Likun.Gao@amd.com>
> 
> Remove unpin rlc clear_state_obj for gfx v8 when rlc init, which will make
> Stoney pm_suspend hang.
> 
> Signed-off-by: Likun Gao <Likun.Gao@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index d290718..0b73c6e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -1292,6 +1292,8 @@ static int gfx_v8_0_cp_jump_table_num(struct
> amdgpu_device *adev)
> 
>  static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)  {
> +       volatile u32 *dst_ptr;
> +       u32 dws;
>         const struct cs_section_def *cs_data;
>         int r;
> 
> @@ -1300,10 +1302,24 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device
> *adev)
>         cs_data = adev->gfx.rlc.cs_data;
> 
>         if (cs_data) {
> -               /* init clear state block */
> -               r = amdgpu_gfx_rlc_init_csb(adev);
> -               if (r)
> +               /* clear state block */
> +               adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs-
> >get_csb_size(adev);
> +               r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
> +                                             AMDGPU_GEM_DOMAIN_VRAM,
> +                                             &adev->gfx.rlc.clear_state_obj,
> +                                             &adev->gfx.rlc.clear_state_gpu_addr,
> +                                             (void **)&adev->gfx.rlc.cs_ptr);
> +               if (r) {
> +                       dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
> +                       amdgpu_gfx_rlc_fini(adev);
>                         return r;
> +               }
> +
> +               /* set up the cs buffer */
> +               dst_ptr = adev->gfx.rlc.cs_ptr;
> +               adev->gfx.rlc.funcs->get_csb_buffer(adev, dst_ptr);
> +               amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
> +               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
>         }
> 
>         if ((adev->asic_type == CHIP_CARRIZO) ||
> --
> 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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
       [not found]         ` <MN2PR12MB3309BB83CBB215AA393EDEF7ECD90-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-08-02  9:49           ` Gao, Likun
  0 siblings, 0 replies; 5+ messages in thread
From: Gao, Likun @ 2019-08-02  9:49 UTC (permalink / raw)
  To: Huang, Ray, Yuan, Xiaojie, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander, Paul Gover

This issue occurred on Stoney.

Regards,
Likun

-----Original Message-----
From: Huang, Ray <Ray.Huang@amd.com> 
Sent: Friday, August 2, 2019 5:36 PM
To: Yuan, Xiaojie <Xiaojie.Yuan@amd.com>; Gao, Likun <Likun.Gao@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Paul Gover <pmw.gover@yahoo.co.uk>
Subject: RE: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8

Is the issue triggered on APU?

Actually, while we do S3, the vram bo won't be cleared on APU. This patch is to fix the vram bo clearing on the DGPU side.

Thanks,
Ray

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Yuan, Xiaojie
> Sent: Friday, August 02, 2019 2:12 PM
> To: Gao, Likun <Likun.Gao@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Paul Gover 
> <pmw.gover@yahoo.co.uk>
> Subject: Re: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx 
> v8
> 
> Hi Likun,
> 
> Looks like you can pin csb buffer @gfx_v8_0_hw_init() just like what 
> following patch does for gfx9, so that we can still use the common 
> function
> amdgpu_gfx_rlc_init_csb():
> 
> commit 137dc4b9060e99a22dce59b42ca71912cf0180f3
> Author: Evan Quan <evan.quan@amd.com>
> Date:   Wed Jul 4 16:21:52 2018 +0800
> 
>     drm/amdgpu: pin the csb buffer on hw init v2
> 
>     Without this pin, the csb buffer will be filled with inconsistent
>     data after S3 resume. And that will causes gfx hang on gfxoff
>     exit since this csb will be executed then.
> 
>     v2: fit amdgpu_bo_pin change(take one less argument)
> 
>     Signed-off-by: Evan Quan <evan.quan@amd.com>
>     Reviewed-by: Huang Rui <ray.huang@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> BR,
> Xiaojie
> 
> ________________________________________
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of 
> likun Gao <likun.gao@amd.com>
> Sent: Friday, August 2, 2019 1:22 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander; Gao, Likun; Paul Gover
> Subject: [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8
> 
> From: Likun Gao <Likun.Gao@amd.com>
> 
> Remove unpin rlc clear_state_obj for gfx v8 when rlc init, which will 
> make Stoney pm_suspend hang.
> 
> Signed-off-by: Likun Gao <Likun.Gao@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index d290718..0b73c6e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -1292,6 +1292,8 @@ static int gfx_v8_0_cp_jump_table_num(struct 
> amdgpu_device *adev)
> 
>  static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)  {
> +       volatile u32 *dst_ptr;
> +       u32 dws;
>         const struct cs_section_def *cs_data;
>         int r;
> 
> @@ -1300,10 +1302,24 @@ static int gfx_v8_0_rlc_init(struct 
> amdgpu_device
> *adev)
>         cs_data = adev->gfx.rlc.cs_data;
> 
>         if (cs_data) {
> -               /* init clear state block */
> -               r = amdgpu_gfx_rlc_init_csb(adev);
> -               if (r)
> +               /* clear state block */
> +               adev->gfx.rlc.clear_state_size = dws = 
> + adev->gfx.rlc.funcs-
> >get_csb_size(adev);
> +               r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
> +                                             AMDGPU_GEM_DOMAIN_VRAM,
> +                                             &adev->gfx.rlc.clear_state_obj,
> +                                             &adev->gfx.rlc.clear_state_gpu_addr,
> +                                             (void **)&adev->gfx.rlc.cs_ptr);
> +               if (r) {
> +                       dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
> +                       amdgpu_gfx_rlc_fini(adev);
>                         return r;
> +               }
> +
> +               /* set up the cs buffer */
> +               dst_ptr = adev->gfx.rlc.cs_ptr;
> +               adev->gfx.rlc.funcs->get_csb_buffer(adev, dst_ptr);
> +               amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
> +               amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
>         }
> 
>         if ((adev->asic_type == CHIP_CARRIZO) ||
> --
> 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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-02  9:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02  5:22 [PATCH] drm/amdgpu: remove unpin clear_state_obj for gfx v8 likun Gao
     [not found] ` <1564723334-18375-1-git-send-email-likun.gao-5C7GfCeVMHo@public.gmane.org>
2019-08-02  6:12   ` Yuan, Xiaojie
     [not found]     ` <BN8PR12MB3602D2293EFA72B3A3545EE389D90-h6+T2+wrnx1lGJ5xs4l7kQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-02  6:34       ` Gao, Likun
2019-08-02  9:35       ` Huang, Ray
     [not found]         ` <MN2PR12MB3309BB83CBB215AA393EDEF7ECD90-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-02  9:49           ` Gao, Likun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.