drm/amdgpu/mes10.1: initialize the software part of mes ring
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 26 Apr 2019 10:59:35 +0000 (18:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2020 05:59:07 +0000 (01:59 -0400)
Do the software initialization on the mes ring.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c

index 7970107be53246c27440d77a0be35cdc6f0a3c12..4f7e345673cabaae4916f9551d2d758b1c955dcb 100644 (file)
@@ -308,11 +308,37 @@ static int mes_v10_1_allocate_eop_buf(struct amdgpu_device *adev)
        return 0;
 }
 
+static int mes_v10_1_ring_init(struct amdgpu_device *adev)
+{
+       struct amdgpu_ring *ring;
+       int r;
+
+       ring = &adev->mes.ring;
+
+       ring->me = 3;
+       ring->pipe = 0;
+       ring->queue = 0;
+
+       ring->ring_obj = NULL;
+       ring->use_doorbell = true;
+       ring->doorbell_index = adev->doorbell_index.mes_ring << 1;
+       ring->eop_gpu_addr = adev->mes.eop_gpu_addr;
+       sprintf(ring->name, "mes_%d.%d.%d", ring->me, ring->pipe, ring->queue);
+
+       r = amdgpu_ring_init(adev, ring, 1024, NULL, 0, AMDGPU_RING_PRIO_DEFAULT);
+       if (r)
+               return r;
+
+       return 0;
+}
+
 static int mes_v10_1_sw_init(void *handle)
 {
        int r;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       adev->mes.adev = adev;
+
        r = mes_v10_1_init_microcode(adev);
        if (r)
                return r;