diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index cf2e8c4e9b8b..d2d0f60ff36d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -83,6 +83,13 @@ int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type, | |||
83 | } | 83 | } |
84 | break; | 84 | break; |
85 | } | 85 | } |
86 | |||
87 | if (!(*out_ring && (*out_ring)->adev)) { | ||
88 | DRM_ERROR("Ring %d is not initialized on IP %d\n", | ||
89 | ring, ip_type); | ||
90 | return -EINVAL; | ||
91 | } | ||
92 | |||
86 | return 0; | 93 | return 0; |
87 | } | 94 | } |
88 | 95 | ||
@@ -344,8 +351,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev) | |||
344 | * submission. This can result in a debt that can stop buffer migrations | 351 | * submission. This can result in a debt that can stop buffer migrations |
345 | * temporarily. | 352 | * temporarily. |
346 | */ | 353 | */ |
347 | static void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, | 354 | void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes) |
348 | u64 num_bytes) | ||
349 | { | 355 | { |
350 | spin_lock(&adev->mm_stats.lock); | 356 | spin_lock(&adev->mm_stats.lock); |
351 | adev->mm_stats.accum_us -= bytes_to_us(adev, num_bytes); | 357 | adev->mm_stats.accum_us -= bytes_to_us(adev, num_bytes); |