[PATCH 11/18] drm/amdgpu: export mmhub sw_init into gmc

Christian König christian.koenig at amd.com
Wed May 31 17:04:52 UTC 2017


Am 31.05.2017 um 18:14 schrieb Huang Rui:
> Signed-off-by: Huang Rui <ray.huang at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  1 +
>   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 27 +++++++++++++++------------
>   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h |  1 +
>   3 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 2fee1c6..077b7ce 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -552,6 +552,7 @@ static int gmc_v9_0_sw_init(void *handle)
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   
>   	gfxhub_v1_0_init(adev);
> +	mmhub_v1_0_init(adev);
>   
>   	spin_lock_init(&adev->mc.invalidate_lock);
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> index 2f85647..20d8d2c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> @@ -347,19 +347,8 @@ void mmhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev, bool value)
>   	WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL), tmp);
>   }
>   
> -static int mmhub_v1_0_early_init(void *handle)
> +void mmhub_v1_0_init(struct amdgpu_device *adev)
>   {
> -	return 0;
> -}
> -
> -static int mmhub_v1_0_late_init(void *handle)
> -{
> -	return 0;
> -}
> -
> -static int mmhub_v1_0_sw_init(void *handle)
> -{
> -	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   	struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB];
>   
>   	hub->ctx0_ptb_addr_lo32 =
> @@ -379,6 +368,20 @@ static int mmhub_v1_0_sw_init(void *handle)
>   	hub->vm_l2_pro_fault_cntl =
>   		SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL);
>   
> +}
> +
> +static int mmhub_v1_0_early_init(void *handle)
> +{
> +	return 0;
> +}
> +
> +static int mmhub_v1_0_late_init(void *handle)
> +{
> +	return 0;
> +}
> +
> +static int mmhub_v1_0_sw_init(void *handle)
> +{
>   	return 0;

Return with a value in a function returning void?

Check the compile log for warnings introduced by the patch set.

Christian.

>   }
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h
> index aadedf9..f8a57e1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h
> @@ -28,6 +28,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev);
>   void mmhub_v1_0_gart_disable(struct amdgpu_device *adev);
>   void mmhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev,
>   					 bool value);
> +void mmhub_v1_0_init(struct amdgpu_device *adev);
>   
>   extern const struct amd_ip_funcs mmhub_v1_0_ip_funcs;
>   extern const struct amdgpu_ip_block_version mmhub_v1_0_ip_block;




More information about the amd-gfx mailing list