Removes division from vblank_wait for DCE v6, v8,
and v10.  Was already implemented for v11.

Signed-off-by: Tom St Denis <tom.stde...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 8 +++++---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c  | 8 +++++---
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c  | 8 +++++---
 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 5af418f6d027..8fb16e9ba315 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)
  */
 static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
 {
-       unsigned i = 0;
+       unsigned i = 100;
 
        if (crtc >= adev->mode_info.num_crtc)
                return;
@@ -233,14 +233,16 @@ static void dce_v10_0_vblank_wait(struct amdgpu_device 
*adev, int crtc)
         * wait for another frame.
         */
        while (dce_v10_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v10_0_is_counter_moving(adev, crtc))
                                break;
                }
        }
 
        while (!dce_v10_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v10_0_is_counter_moving(adev, crtc))
                                break;
                }
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index 0a6ec8c43ae0..e41d583740b5 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)
  */
 static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
 {
-       unsigned i = 0;
+       unsigned i = 100;
 
        if (crtc >= adev->mode_info.num_crtc)
                return;
@@ -158,14 +158,16 @@ static void dce_v6_0_vblank_wait(struct amdgpu_device 
*adev, int crtc)
         * wait for another frame.
         */
        while (dce_v6_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v6_0_is_counter_moving(adev, crtc))
                                break;
                }
        }
 
        while (!dce_v6_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v6_0_is_counter_moving(adev, crtc))
                                break;
                }
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 4d313aa20096..9ca586c45b69 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)
  */
 static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
 {
-       unsigned i = 0;
+       unsigned i = 100;
 
        if (crtc >= adev->mode_info.num_crtc)
                return;
@@ -182,14 +182,16 @@ static void dce_v8_0_vblank_wait(struct amdgpu_device 
*adev, int crtc)
         * wait for another frame.
         */
        while (dce_v8_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v8_0_is_counter_moving(adev, crtc))
                                break;
                }
        }
 
        while (!dce_v8_0_is_in_vblank(adev, crtc)) {
-               if (i++ % 100 == 0) {
+               if (i++ == 100) {
+                       i = 0;
                        if (!dce_v8_0_is_counter_moving(adev, crtc))
                                break;
                }
-- 
2.10.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to