drm/amdgpu: add basics for SDMA page queue support
authorChristian König <christian.koenig@amd.com>
Thu, 4 Oct 2018 14:22:41 +0000 (16:22 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Nov 2018 19:20:54 +0000 (14:20 -0500)
Just the common helper and a new ring in the SDMA instance.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h

index bc9244b429ef11932b87ea96a191ad5af3e60d24..0fb9907494bb3aecdd498a7fa1720c4ecb05c388 100644 (file)
@@ -34,11 +34,9 @@ struct amdgpu_sdma_instance * amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
        int i;
 
        for (i = 0; i < adev->sdma.num_instances; i++)
-               if (&adev->sdma.instance[i].ring == ring)
-                       break;
+               if (ring == &adev->sdma.instance[i].ring ||
+                   ring == &adev->sdma.instance[i].page)
+                       return &adev->sdma.instance[i];
 
-       if (i < AMDGPU_MAX_SDMA_INSTANCES)
-               return &adev->sdma.instance[i];
-       else
-               return NULL;
+       return NULL;
 }
index 500113ec65caaf63a3ba6cc6d1f385b211bf34dc..556db42edaed60efe2fb59d3d411a7874eb5c1ef 100644 (file)
@@ -41,6 +41,7 @@ struct amdgpu_sdma_instance {
        uint32_t                feature_version;
 
        struct amdgpu_ring      ring;
+       struct amdgpu_ring      page;
        bool                    burst_nop;
 };