[PATCH] drm/amdgpu: stop/resume fb access when gpu reset V2

Alex Deucher alexdeucher at gmail.com
Wed Jun 22 16:40:05 UTC 2016


On Wed, Jun 22, 2016 at 2:04 AM, Chunming Zhou <David1.Zhou at amd.com> wrote:
> V2: add wait_for_mc_idle after stopping fb access
>
> Change-Id: I86b5c2b8c78a17ef43ade2a97ef8a33853650be0
> Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
> Reviewed-by: Christian König <christian.koenig at amd.com> (V1)
> ---
>  drivers/gpu/drm/amd/amdgpu/cik.c | 12 +++++++++++-
>  drivers/gpu/drm/amd/amdgpu/vi.c  | 10 +++++++++-
>  2 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> index 40f4fda..7f2e3db 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> @@ -1213,10 +1213,20 @@ static void cik_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hu
>  static int cik_asic_reset(struct amdgpu_device *adev)
>  {
>         int r;
> -       cik_set_bios_scratch_engine_hung(adev, true);
> +       struct amdgpu_mode_mc_save save;
>
> +       cik_set_bios_scratch_engine_hung(adev, true);
> +       /* Disable fb access */
> +       if (adev->mode_info.num_crtc) {
> +               amdgpu_display_stop_mc_access(adev, &save);
> +               amdgpu_asic_wait_for_mc_idle(adev);

Please use the GMC IP block wait_for_idle callback as I just removed
amdgpu_asic_wait_for_mc_idle() in another patch set sent out
yesterday.  Actually why not do this in amdgpu_gpu_reset() before
calling amdgpu_asic_reset() since it's the same for all asics.

> +       }
>         r = cik_gpu_pci_config_reset(adev);
>
> +       /* resume fb access */
> +       if (adev->mode_info.num_crtc)
> +               amdgpu_display_resume_mc_access(adev, &save);
> +

I think this part should be dropped.  There's no need to unblank the
displays.  After the reset, the entire display pipeline is
theoretically reset so this won't really do anything useful.  Same
with vi.c

Alex

>         cik_set_bios_scratch_engine_hung(adev, false);
>
>         return r;
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 1ac0c91..5337c4f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -633,10 +633,18 @@ static void vi_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hun
>  static int vi_asic_reset(struct amdgpu_device *adev)
>  {
>         int r;
> +       struct amdgpu_mode_mc_save save;
>
>         vi_set_bios_scratch_engine_hung(adev, true);
> -
> +       /* Disable fb access */
> +       if (adev->mode_info.num_crtc) {
> +               amdgpu_display_stop_mc_access(adev, &save);
> +               amdgpu_asic_wait_for_mc_idle(adev);
> +       }
>         r = vi_gpu_pci_config_reset(adev);
> +       /* resume fb access */
> +       if (adev->mode_info.num_crtc)
> +               amdgpu_display_resume_mc_access(adev, &save);
>
>         vi_set_bios_scratch_engine_hung(adev, false);
>
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list