RE: [PATCH 4/5] drm/amdgpu: Add fw load in gfx_v8 and sdma_v3

2018-10-08 Thread Zhu, Rex
Thanks.
I will fix this error in a following patch.

Best Regards
Rex

> -Original Message-
> From: Alex Deucher 
> Sent: Thursday, October 4, 2018 11:33 AM
> To: Zhu, Rex 
> Cc: amd-gfx list 
> Subject: Re: [PATCH 4/5] drm/amdgpu: Add fw load in gfx_v8 and sdma_v3
> 
> On Wed, Oct 3, 2018 at 7:11 AM Rex Zhu  wrote:
> >
> > gfx and sdma can be initialized before smu.
> >
> > Signed-off-by: Rex Zhu 
> 
> I think sdma_v2_4.c needs a similar update for iceland.  With that fixed:
> Reviewed-by: Alex Deucher 
> 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 11 +++
> > drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c |  8 
> >  2 files changed, 19 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > index 6b1954e..77e05c1 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > @@ -4180,9 +4180,20 @@ static void gfx_v8_0_rlc_start(struct
> > amdgpu_device *adev)
> >
> >  static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)  {
> > +   int r;
> > +
> > gfx_v8_0_rlc_stop(adev);
> > gfx_v8_0_rlc_reset(adev);
> > gfx_v8_0_init_pg(adev);
> > +
> > +   if (adev->powerplay.pp_funcs->load_firmware) {
> > +   r = adev->powerplay.pp_funcs->load_firmware(adev-
> >powerplay.pp_handle);
> > +   if (r) {
> > +   pr_err("firmware loading failed\n");
> > +   return r;
> > +   }
> > +   }
> > +
> > gfx_v8_0_rlc_start(adev);
> >
> > return 0;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > index 6fb3eda..0bdde7f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > @@ -788,6 +788,14 @@ static int sdma_v3_0_start(struct amdgpu_device
> > *adev)  {
> > int r;
> >
> > +   if (adev->powerplay.pp_funcs->load_firmware) {
> > +   r = adev->powerplay.pp_funcs->load_firmware(adev-
> >powerplay.pp_handle);
> > +   if (r) {
> > +   pr_err("firmware loading failed\n");
> > +   return r;
> > +   }
> > +   }
> > +
> > /* disable sdma engine before programing it */
> > sdma_v3_0_ctx_switch_enable(adev, false);
> > sdma_v3_0_enable(adev, false);
> > --
> > 1.9.1
> >
> > ___
> > 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


Re: [PATCH 4/5] drm/amdgpu: Add fw load in gfx_v8 and sdma_v3

2018-10-03 Thread Alex Deucher
On Wed, Oct 3, 2018 at 7:11 AM Rex Zhu  wrote:
>
> gfx and sdma can be initialized before smu.
>
> Signed-off-by: Rex Zhu 

I think sdma_v2_4.c needs a similar update for iceland.  With that fixed:
Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 11 +++
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c |  8 
>  2 files changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 6b1954e..77e05c1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -4180,9 +4180,20 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device 
> *adev)
>
>  static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
>  {
> +   int r;
> +
> gfx_v8_0_rlc_stop(adev);
> gfx_v8_0_rlc_reset(adev);
> gfx_v8_0_init_pg(adev);
> +
> +   if (adev->powerplay.pp_funcs->load_firmware) {
> +   r = 
> adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
> +   if (r) {
> +   pr_err("firmware loading failed\n");
> +   return r;
> +   }
> +   }
> +
> gfx_v8_0_rlc_start(adev);
>
> return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 6fb3eda..0bdde7f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -788,6 +788,14 @@ static int sdma_v3_0_start(struct amdgpu_device *adev)
>  {
> int r;
>
> +   if (adev->powerplay.pp_funcs->load_firmware) {
> +   r = 
> adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
> +   if (r) {
> +   pr_err("firmware loading failed\n");
> +   return r;
> +   }
> +   }
> +
> /* disable sdma engine before programing it */
> sdma_v3_0_ctx_switch_enable(adev, false);
> sdma_v3_0_enable(adev, false);
> --
> 1.9.1
>
> ___
> 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


[PATCH 4/5] drm/amdgpu: Add fw load in gfx_v8 and sdma_v3

2018-10-03 Thread Rex Zhu
gfx and sdma can be initialized before smu.

Signed-off-by: Rex Zhu 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 11 +++
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c |  8 
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 6b1954e..77e05c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4180,9 +4180,20 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device 
*adev)
 
 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 {
+   int r;
+
gfx_v8_0_rlc_stop(adev);
gfx_v8_0_rlc_reset(adev);
gfx_v8_0_init_pg(adev);
+
+   if (adev->powerplay.pp_funcs->load_firmware) {
+   r = 
adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
+   if (r) {
+   pr_err("firmware loading failed\n");
+   return r;
+   }
+   }
+
gfx_v8_0_rlc_start(adev);
 
return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 6fb3eda..0bdde7f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -788,6 +788,14 @@ static int sdma_v3_0_start(struct amdgpu_device *adev)
 {
int r;
 
+   if (adev->powerplay.pp_funcs->load_firmware) {
+   r = 
adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
+   if (r) {
+   pr_err("firmware loading failed\n");
+   return r;
+   }
+   }
+
/* disable sdma engine before programing it */
sdma_v3_0_ctx_switch_enable(adev, false);
sdma_v3_0_enable(adev, false);
-- 
1.9.1

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