Am 01.11.2016 um 16:27 schrieb Deucher, Alexander:
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf
Of Trigger Huang
Sent: Tuesday, November 01, 2016 3:22 AM
To: [email protected]
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 <[email protected]>
Signed-off-by: Xiangliang Yu <[email protected]>
Signed-off-by: Trigger Huang <[email protected]>
---
  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 <[email protected]>

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;

Additionally to Alex comment above please move the new local variable into the "if" where it is used.

With that fixed the patch is Reviewed-by: Christian König <[email protected]> as well.

Regards,
Christian.


        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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to