[PATCH 2/9] drm/amdgpu: make function pointers mandatory

Huang Rui ray.huang at amd.com
Tue Sep 25 10:03:29 UTC 2018


On Mon, Sep 24, 2018 at 02:38:13PM +0200, Christian König wrote:
> We always want those to be setup correctly.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/cik_ih.c      |  3 +--
>  drivers/gpu/drm/amd/amdgpu/cik_sdma.c    | 20 ++++++++------------
>  drivers/gpu/drm/amd/amdgpu/cz_ih.c       |  3 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c   |  3 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c   |  3 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/dce_virtual.c |  3 +--
>  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/iceland_ih.c  |  3 +--
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c   | 20 ++++++++------------
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c   | 20 ++++++++------------
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 20 ++++++++------------
>  drivers/gpu/drm/amd/amdgpu/si_dma.c      | 20 ++++++++------------
>  drivers/gpu/drm/amd/amdgpu/si_ih.c       |  3 +--
>  drivers/gpu/drm/amd/amdgpu/tonga_ih.c    |  3 +--
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c   |  3 +--
>  20 files changed, 55 insertions(+), 90 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> index 44d10c2172f6..e75183e09820 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> @@ -468,8 +468,7 @@ static const struct amdgpu_ih_funcs cik_ih_funcs = {
>  
>  static void cik_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &cik_ih_funcs;
> +	adev->irq.ih_funcs = &cik_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version cik_ih_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index 154b1499b07e..ee9d5c92edb1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -1370,10 +1370,8 @@ static const struct amdgpu_buffer_funcs cik_sdma_buffer_funcs = {
>  
>  static void cik_sdma_set_buffer_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mman.buffer_funcs == NULL) {
> -		adev->mman.buffer_funcs = &cik_sdma_buffer_funcs;
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
> -	}
> +	adev->mman.buffer_funcs = &cik_sdma_buffer_funcs;
> +	adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>  }
>  
>  static const struct amdgpu_vm_pte_funcs cik_sdma_vm_pte_funcs = {
> @@ -1389,15 +1387,13 @@ static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev)
>  	struct drm_gpu_scheduler *sched;
>  	unsigned i;
>  
> -	if (adev->vm_manager.vm_pte_funcs == NULL) {
> -		adev->vm_manager.vm_pte_funcs = &cik_sdma_vm_pte_funcs;
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> -			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +	adev->vm_manager.vm_pte_funcs = &cik_sdma_vm_pte_funcs;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		sched = &adev->sdma.instance[i].ring.sched;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>  	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>  }
>  
>  const struct amdgpu_ip_block_version cik_sdma_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> index 960c29e17da6..9385da1e1e40 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> @@ -449,8 +449,7 @@ static const struct amdgpu_ih_funcs cz_ih_funcs = {
>  
>  static void cz_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &cz_ih_funcs;
> +	adev->irq.ih_funcs = &cz_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version cz_ih_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> index 3916aa6cc4ec..89c09c396fe6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> @@ -3570,8 +3570,7 @@ static const struct amdgpu_display_funcs dce_v10_0_display_funcs = {
>  
>  static void dce_v10_0_set_display_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mode_info.funcs == NULL)
> -		adev->mode_info.funcs = &dce_v10_0_display_funcs;
> +	adev->mode_info.funcs = &dce_v10_0_display_funcs;
>  }
>  
>  static const struct amdgpu_irq_src_funcs dce_v10_0_crtc_irq_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index 4ffb612a4e53..cf6faaa05dbb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -3702,8 +3702,7 @@ static const struct amdgpu_display_funcs dce_v11_0_display_funcs = {
>  
>  static void dce_v11_0_set_display_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mode_info.funcs == NULL)
> -		adev->mode_info.funcs = &dce_v11_0_display_funcs;
> +	adev->mode_info.funcs = &dce_v11_0_display_funcs;
>  }
>  
>  static const struct amdgpu_irq_src_funcs dce_v11_0_crtc_irq_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> index 480c5348a14f..371aa05bf537 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> @@ -3376,8 +3376,7 @@ static const struct amdgpu_display_funcs dce_v6_0_display_funcs = {
>  
>  static void dce_v6_0_set_display_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mode_info.funcs == NULL)
> -		adev->mode_info.funcs = &dce_v6_0_display_funcs;
> +	adev->mode_info.funcs = &dce_v6_0_display_funcs;
>  }
>  
>  static const struct amdgpu_irq_src_funcs dce_v6_0_crtc_irq_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> index 797196476c94..30e76f2407c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> @@ -3458,8 +3458,7 @@ static const struct amdgpu_display_funcs dce_v8_0_display_funcs = {
>  
>  static void dce_v8_0_set_display_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mode_info.funcs == NULL)
> -		adev->mode_info.funcs = &dce_v8_0_display_funcs;
> +	adev->mode_info.funcs = &dce_v8_0_display_funcs;
>  }
>  
>  static const struct amdgpu_irq_src_funcs dce_v8_0_crtc_irq_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 15257634a53a..2cc480d65394 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -649,8 +649,7 @@ static const struct amdgpu_display_funcs dce_virtual_display_funcs = {
>  
>  static void dce_virtual_set_display_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mode_info.funcs == NULL)
> -		adev->mode_info.funcs = &dce_virtual_display_funcs;
> +	adev->mode_info.funcs = &dce_virtual_display_funcs;
>  }
>  
>  static int dce_virtual_pageflip(struct amdgpu_device *adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> index 4411463ca719..3b8ac4442f06 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> @@ -1180,8 +1180,7 @@ static const struct amdgpu_irq_src_funcs gmc_v6_0_irq_funcs = {
>  
>  static void gmc_v6_0_set_gmc_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->gmc.gmc_funcs == NULL)
> -		adev->gmc.gmc_funcs = &gmc_v6_0_gmc_funcs;
> +	adev->gmc.gmc_funcs = &gmc_v6_0_gmc_funcs;
>  }
>  
>  static void gmc_v6_0_set_irq_funcs(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index ae776ce9a415..899634ce4238 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -1388,8 +1388,7 @@ static const struct amdgpu_irq_src_funcs gmc_v7_0_irq_funcs = {
>  
>  static void gmc_v7_0_set_gmc_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->gmc.gmc_funcs == NULL)
> -		adev->gmc.gmc_funcs = &gmc_v7_0_gmc_funcs;
> +	adev->gmc.gmc_funcs = &gmc_v7_0_gmc_funcs;
>  }
>  
>  static void gmc_v7_0_set_irq_funcs(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index 53ae49b8bde8..79143ca7cfac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -1733,8 +1733,7 @@ static const struct amdgpu_irq_src_funcs gmc_v8_0_irq_funcs = {
>  
>  static void gmc_v8_0_set_gmc_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->gmc.gmc_funcs == NULL)
> -		adev->gmc.gmc_funcs = &gmc_v8_0_gmc_funcs;
> +	adev->gmc.gmc_funcs = &gmc_v8_0_gmc_funcs;
>  }
>  
>  static void gmc_v8_0_set_irq_funcs(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index aad3c7c5fb3a..f35d7a554ad5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -593,8 +593,7 @@ static const struct amdgpu_gmc_funcs gmc_v9_0_gmc_funcs = {
>  
>  static void gmc_v9_0_set_gmc_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->gmc.gmc_funcs == NULL)
> -		adev->gmc.gmc_funcs = &gmc_v9_0_gmc_funcs;
> +	adev->gmc.gmc_funcs = &gmc_v9_0_gmc_funcs;
>  }
>  
>  static int gmc_v9_0_early_init(void *handle)
> diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> index 842c4b677b4d..45ef0a818e11 100644
> --- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> @@ -447,8 +447,7 @@ static const struct amdgpu_ih_funcs iceland_ih_funcs = {
>  
>  static void iceland_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &iceland_ih_funcs;
> +	adev->irq.ih_funcs = &iceland_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version iceland_ih_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index c403bdf8ad70..0c5a576dee13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -1296,10 +1296,8 @@ static const struct amdgpu_buffer_funcs sdma_v2_4_buffer_funcs = {
>  
>  static void sdma_v2_4_set_buffer_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mman.buffer_funcs == NULL) {
> -		adev->mman.buffer_funcs = &sdma_v2_4_buffer_funcs;
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
> -	}
> +	adev->mman.buffer_funcs = &sdma_v2_4_buffer_funcs;
> +	adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>  }
>  
>  static const struct amdgpu_vm_pte_funcs sdma_v2_4_vm_pte_funcs = {
> @@ -1315,15 +1313,13 @@ static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev)
>  	struct drm_gpu_scheduler *sched;
>  	unsigned i;
>  
> -	if (adev->vm_manager.vm_pte_funcs == NULL) {
> -		adev->vm_manager.vm_pte_funcs = &sdma_v2_4_vm_pte_funcs;
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> -			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +	adev->vm_manager.vm_pte_funcs = &sdma_v2_4_vm_pte_funcs;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		sched = &adev->sdma.instance[i].ring.sched;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>  	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>  }
>  
>  const struct amdgpu_ip_block_version sdma_v2_4_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 2677d6a1bf42..2587b8de918a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -1736,10 +1736,8 @@ static const struct amdgpu_buffer_funcs sdma_v3_0_buffer_funcs = {
>  
>  static void sdma_v3_0_set_buffer_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mman.buffer_funcs == NULL) {
> -		adev->mman.buffer_funcs = &sdma_v3_0_buffer_funcs;
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
> -	}
> +	adev->mman.buffer_funcs = &sdma_v3_0_buffer_funcs;
> +	adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>  }
>  
>  static const struct amdgpu_vm_pte_funcs sdma_v3_0_vm_pte_funcs = {
> @@ -1755,15 +1753,13 @@ static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev)
>  	struct drm_gpu_scheduler *sched;
>  	unsigned i;
>  
> -	if (adev->vm_manager.vm_pte_funcs == NULL) {
> -		adev->vm_manager.vm_pte_funcs = &sdma_v3_0_vm_pte_funcs;
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> -			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +	adev->vm_manager.vm_pte_funcs = &sdma_v3_0_vm_pte_funcs;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		sched = &adev->sdma.instance[i].ring.sched;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>  	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>  }
>  
>  const struct amdgpu_ip_block_version sdma_v3_0_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 9da4a1bff5c5..a3e2ed15fff2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -1807,10 +1807,8 @@ static const struct amdgpu_buffer_funcs sdma_v4_0_buffer_funcs = {
>  
>  static void sdma_v4_0_set_buffer_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mman.buffer_funcs == NULL) {
> -		adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
> -	}
> +	adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
> +	adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>  }
>  
>  static const struct amdgpu_vm_pte_funcs sdma_v4_0_vm_pte_funcs = {
> @@ -1826,15 +1824,13 @@ static void sdma_v4_0_set_vm_pte_funcs(struct amdgpu_device *adev)
>  	struct drm_gpu_scheduler *sched;
>  	unsigned i;
>  
> -	if (adev->vm_manager.vm_pte_funcs == NULL) {
> -		adev->vm_manager.vm_pte_funcs = &sdma_v4_0_vm_pte_funcs;
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> -			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +	adev->vm_manager.vm_pte_funcs = &sdma_v4_0_vm_pte_funcs;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		sched = &adev->sdma.instance[i].ring.sched;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>  	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>  }
>  
>  const struct amdgpu_ip_block_version sdma_v4_0_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index fafaf259b17b..c3510a703f9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -863,10 +863,8 @@ static const struct amdgpu_buffer_funcs si_dma_buffer_funcs = {
>  
>  static void si_dma_set_buffer_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->mman.buffer_funcs == NULL) {
> -		adev->mman.buffer_funcs = &si_dma_buffer_funcs;
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
> -	}
> +	adev->mman.buffer_funcs = &si_dma_buffer_funcs;
> +	adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>  }
>  
>  static const struct amdgpu_vm_pte_funcs si_dma_vm_pte_funcs = {
> @@ -882,15 +880,13 @@ static void si_dma_set_vm_pte_funcs(struct amdgpu_device *adev)
>  	struct drm_gpu_scheduler *sched;
>  	unsigned i;
>  
> -	if (adev->vm_manager.vm_pte_funcs == NULL) {
> -		adev->vm_manager.vm_pte_funcs = &si_dma_vm_pte_funcs;
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> -			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +	adev->vm_manager.vm_pte_funcs = &si_dma_vm_pte_funcs;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		sched = &adev->sdma.instance[i].ring.sched;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>  	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>  }
>  
>  const struct amdgpu_ip_block_version si_dma_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c b/drivers/gpu/drm/amd/amdgpu/si_ih.c
> index 60dad63098a2..97711d327527 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c
> @@ -308,8 +308,7 @@ static const struct amdgpu_ih_funcs si_ih_funcs = {
>  
>  static void si_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &si_ih_funcs;
> +	adev->irq.ih_funcs = &si_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version si_ih_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> index 52853d8a8fdd..a79a3776888a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> @@ -513,8 +513,7 @@ static const struct amdgpu_ih_funcs tonga_ih_funcs = {
>  
>  static void tonga_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &tonga_ih_funcs;
> +	adev->irq.ih_funcs = &tonga_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version tonga_ih_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index acbe5a770207..37487b4cbd6e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -494,8 +494,7 @@ static const struct amdgpu_ih_funcs vega10_ih_funcs = {
>  
>  static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev)
>  {
> -	if (adev->irq.ih_funcs == NULL)
> -		adev->irq.ih_funcs = &vega10_ih_funcs;
> +	adev->irq.ih_funcs = &vega10_ih_funcs;
>  }
>  
>  const struct amdgpu_ip_block_version vega10_ih_ip_block =
> -- 
> 2.14.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