[PATCH 17/20] drm/amdgpu:new field is_load_stage introduced

Deucher, Alexander Alexander.Deucher at amd.com
Tue Feb 7 16:08:46 UTC 2017


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Monk Liu
> Sent: Tuesday, February 07, 2017 1:11 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Liu, Monk
> Subject: [PATCH 17/20] drm/amdgpu:new field is_load_stage introduced
> 
> use it to seperate first driver load and later reset/resume
> 
> Change-Id: I991e0da52ccd197716d279bf9014de46d39acfea
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 5dd0615..bdb47f7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1493,6 +1493,7 @@ struct amdgpu_device {
>  	/* link all gtt */
>  	spinlock_t			gtt_list_lock;
>  	struct list_head                gtt_list;
> +	bool	is_load_stage;

Since this is only used by gfx, please put it in the gfx structure.  Also, I think it makes more sense reverse the logic and call it in_reset and set/clear it in the sriov reset function.

> 
>  };
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index d5870d0..5be0481 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1800,6 +1800,7 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>  	adev->gc_cac_wreg = &amdgpu_invalid_wreg;
>  	adev->audio_endpt_rreg = &amdgpu_block_invalid_rreg;
>  	adev->audio_endpt_wreg = &amdgpu_block_invalid_wreg;
> +	adev->is_load_stage = true;
> 
> 
>  	DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X
> 0x%04X:0x%04X 0x%02X).\n",
> @@ -2010,6 +2011,7 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>  		goto failed;
>  	}
> 
> +	adev->is_load_stage = false;
>  	return 0;
> 
>  failed:
> --
> 2.7.4
> 
> _______________________________________________
> 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