From: Tom St Denis Date: Thu, 31 Aug 2017 13:48:11 +0000 (-0400) Subject: drm/amd/amdgpu: Simplify gfx_v9_0_wait_for_idle() X-Git-Tag: Ubuntu-5.2.0-15.16~5530^2~28^2~164 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2b9bdfa70faf8c00969f91d3c4548a0df6071b90;p=mirror_ubuntu-eoan-kernel.git drm/amd/amdgpu: Simplify gfx_v9_0_wait_for_idle() Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 2ba02739a228..a21182debb3d 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -2937,15 +2937,10 @@ static bool gfx_v9_0_is_idle(void *handle) static int gfx_v9_0_wait_for_idle(void *handle) { unsigned i; - u32 tmp; struct amdgpu_device *adev = (struct amdgpu_device *)handle; for (i = 0; i < adev->usec_timeout; i++) { - /* read MC_STATUS */ - tmp = RREG32_SOC15(GC, 0, mmGRBM_STATUS) & - GRBM_STATUS__GUI_ACTIVE_MASK; - - if (!REG_GET_FIELD(tmp, GRBM_STATUS, GUI_ACTIVE)) + if (gfx_v9_0_is_idle(handle)) return 0; udelay(1); }