aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2016-09-22 10:01:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-22 13:06:43 -0400
commite37e4f057b47ff1e502799062f8ab30156e54bd3 (patch)
treea49bc2ad8cfea0d3100a936f92e12f024488eb4f
parent735598477f386d05af018e8708aa9e71f1ae163e (diff)
drm/amd/amdgpu: Remove division from vblank_wait
Removes division from vblank_wait for DCE v6, v8, and v10. Was already implemented for v11. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v10_0.c8
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v6_0.c8
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v8_0.c8
3 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index db6e6c3eaae2..9a63d7766604 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -221,7 +221,7 @@ static bool dce_v10_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
221 */ 221 */
222static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc) 222static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
223{ 223{
224 unsigned i = 0; 224 unsigned i = 100;
225 225
226 if (crtc >= adev->mode_info.num_crtc) 226 if (crtc >= adev->mode_info.num_crtc)
227 return; 227 return;
@@ -233,14 +233,16 @@ static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
233 * wait for another frame. 233 * wait for another frame.
234 */ 234 */
235 while (dce_v10_0_is_in_vblank(adev, crtc)) { 235 while (dce_v10_0_is_in_vblank(adev, crtc)) {
236 if (i++ % 100 == 0) { 236 if (i++ == 100) {
237 i = 0;
237 if (!dce_v10_0_is_counter_moving(adev, crtc)) 238 if (!dce_v10_0_is_counter_moving(adev, crtc))
238 break; 239 break;
239 } 240 }
240 } 241 }
241 242
242 while (!dce_v10_0_is_in_vblank(adev, crtc)) { 243 while (!dce_v10_0_is_in_vblank(adev, crtc)) {
243 if (i++ % 100 == 0) { 244 if (i++ == 100) {
245 i = 0;
244 if (!dce_v10_0_is_counter_moving(adev, crtc)) 246 if (!dce_v10_0_is_counter_moving(adev, crtc))
245 break; 247 break;
246 } 248 }
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index c8380f030400..c866185fd091 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -146,7 +146,7 @@ static bool dce_v6_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
146 */ 146 */
147static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc) 147static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
148{ 148{
149 unsigned i = 0; 149 unsigned i = 100;
150 150
151 if (crtc >= adev->mode_info.num_crtc) 151 if (crtc >= adev->mode_info.num_crtc)
152 return; 152 return;
@@ -158,14 +158,16 @@ static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
158 * wait for another frame. 158 * wait for another frame.
159 */ 159 */
160 while (dce_v6_0_is_in_vblank(adev, crtc)) { 160 while (dce_v6_0_is_in_vblank(adev, crtc)) {
161 if (i++ % 100 == 0) { 161 if (i++ == 100) {
162 i = 0;
162 if (!dce_v6_0_is_counter_moving(adev, crtc)) 163 if (!dce_v6_0_is_counter_moving(adev, crtc))
163 break; 164 break;
164 } 165 }
165 } 166 }
166 167
167 while (!dce_v6_0_is_in_vblank(adev, crtc)) { 168 while (!dce_v6_0_is_in_vblank(adev, crtc)) {
168 if (i++ % 100 == 0) { 169 if (i++ == 100) {
170 i = 0;
169 if (!dce_v6_0_is_counter_moving(adev, crtc)) 171 if (!dce_v6_0_is_counter_moving(adev, crtc))
170 break; 172 break;
171 } 173 }
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 845a30b03cb4..3e1e3d0a850e 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -170,7 +170,7 @@ static bool dce_v8_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
170 */ 170 */
171static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc) 171static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
172{ 172{
173 unsigned i = 0; 173 unsigned i = 100;
174 174
175 if (crtc >= adev->mode_info.num_crtc) 175 if (crtc >= adev->mode_info.num_crtc)
176 return; 176 return;
@@ -182,14 +182,16 @@ static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
182 * wait for another frame. 182 * wait for another frame.
183 */ 183 */
184 while (dce_v8_0_is_in_vblank(adev, crtc)) { 184 while (dce_v8_0_is_in_vblank(adev, crtc)) {
185 if (i++ % 100 == 0) { 185 if (i++ == 100) {
186 i = 0;
186 if (!dce_v8_0_is_counter_moving(adev, crtc)) 187 if (!dce_v8_0_is_counter_moving(adev, crtc))
187 break; 188 break;
188 } 189 }
189 } 190 }
190 191
191 while (!dce_v8_0_is_in_vblank(adev, crtc)) { 192 while (!dce_v8_0_is_in_vblank(adev, crtc)) {
192 if (i++ % 100 == 0) { 193 if (i++ == 100) {
194 i = 0;
193 if (!dce_v8_0_is_counter_moving(adev, crtc)) 195 if (!dce_v8_0_is_counter_moving(adev, crtc))
194 break; 196 break;
195 } 197 }