[PATCH] drm/amdgpu:no gpu scheduler for KIQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Trigger Huang
> Sent: Tuesday, November 01, 2016 3:22 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Yu, Xiangliang; Liu, Monk; Huang, Trigger
> Subject: [PATCH] drm/amdgpu:no gpu scheduler for KIQ
> 
> KIQ is used for interaction between driver and
> CP, and not exposed to outside client, as such it
> doesn't need to be handled by GPU scheduler.
> 
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu at amd.com>
> Signed-off-by: Trigger Huang <trigger.huang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 ++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c  | 6 ++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index 77b34ec..c2a2d19 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -382,6 +382,10 @@ int amdgpu_fence_driver_init_ring(struct
> amdgpu_ring *ring,
>  	if (!ring->fence_drv.fences)
>  		return -ENOMEM;
> 
> +	/* Doesn't need gpu scheduler */
> +	if (!num_hw_submission)
> +		return 0;
> +

Rather than returning early here, I'd suggest wrapping the scheduler setup conditionally.  E.g.,

if (num_hw_submission) {
   /* setup scheduler */
 ....
}

That way if we add anything else to that function, we don't accidently break KIQ.

With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

Alex

>  	timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
>  	if (timeout == 0) {
>  		/*
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 4c99282..a254c38 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -168,6 +168,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev,
> struct amdgpu_ring *ring,
>  		     unsigned irq_type)
>  {
>  	int r;
> +	int entry_num = amdgpu_sched_hw_submission;
> 
>  	if (ring->adev == NULL) {
>  		if (adev->num_rings >= AMDGPU_MAX_RINGS)
> @@ -176,8 +177,9 @@ int amdgpu_ring_init(struct amdgpu_device *adev,
> struct amdgpu_ring *ring,
>  		ring->adev = adev;
>  		ring->idx = adev->num_rings++;
>  		adev->rings[ring->idx] = ring;
> -		r = amdgpu_fence_driver_init_ring(ring,
> -			amdgpu_sched_hw_submission);
> +		if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ)
> +			entry_num = 0;
> +		r = amdgpu_fence_driver_init_ring(ring, entry_num);
>  		if (r)
>  			return r;
>  	}
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux