diff options
author | Tom St Denis <tom.stdenis@amd.com> | 2015-12-15 13:01:49 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-01-04 17:21:03 -0500 |
commit | 9e4e1ae82f2479a32bee61132206367a710e961e (patch) | |
tree | 87158cb72e69300fb171acf64944a6ccb39eb815 | |
parent | 691ca86a3a15a9c5054edb3c517a1aeb40e9fadc (diff) |
amdgpu/dce11: Remove division from dce_v11_0_vblank_wait()
Mimics odd behaviour where (i++ % 100 == 0) is true in the first iteration of each loop...
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index 8701661a8868..80be62a0b99b 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | |||
@@ -211,7 +211,7 @@ static bool dce_v11_0_is_counter_moving(struct amdgpu_device *adev, int crtc) | |||
211 | */ | 211 | */ |
212 | static void dce_v11_0_vblank_wait(struct amdgpu_device *adev, int crtc) | 212 | static void dce_v11_0_vblank_wait(struct amdgpu_device *adev, int crtc) |
213 | { | 213 | { |
214 | unsigned i = 0; | 214 | unsigned i = 100; |
215 | 215 | ||
216 | if (crtc >= adev->mode_info.num_crtc) | 216 | if (crtc >= adev->mode_info.num_crtc) |
217 | return; | 217 | return; |
@@ -223,14 +223,16 @@ static void dce_v11_0_vblank_wait(struct amdgpu_device *adev, int crtc) | |||
223 | * wait for another frame. | 223 | * wait for another frame. |
224 | */ | 224 | */ |
225 | while (dce_v11_0_is_in_vblank(adev, crtc)) { | 225 | while (dce_v11_0_is_in_vblank(adev, crtc)) { |
226 | if (i++ % 100 == 0) { | 226 | if (i++ == 100) { |
227 | i = 0; | ||
227 | if (!dce_v11_0_is_counter_moving(adev, crtc)) | 228 | if (!dce_v11_0_is_counter_moving(adev, crtc)) |
228 | break; | 229 | break; |
229 | } | 230 | } |
230 | } | 231 | } |
231 | 232 | ||
232 | while (!dce_v11_0_is_in_vblank(adev, crtc)) { | 233 | while (!dce_v11_0_is_in_vblank(adev, crtc)) { |
233 | if (i++ % 100 == 0) { | 234 | if (i++ == 100) { |
235 | i = 0; | ||
234 | if (!dce_v11_0_is_counter_moving(adev, crtc)) | 236 | if (!dce_v11_0_is_counter_moving(adev, crtc)) |
235 | break; | 237 | break; |
236 | } | 238 | } |