]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amd/amdgpu: Remove division from vblank_wait
authorTom St Denis <tom.stdenis@amd.com>
Thu, 22 Sep 2016 14:01:00 +0000 (10:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Sep 2016 17:06:43 +0000 (13:06 -0400)
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>
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c

index db6e6c3eaae2a9ab08aef5384cd8e1c24ca4c5ce..9a63d7766604de872c73b93335abf1cf52f7d2e4 100644 (file)
@@ -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;
                }
index c8380f03040007de006a18b339b41ecf8ed70970..c866185fd091efdb00eba72ab229cdf6f90f67ea 100644 (file)
@@ -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;
                }
index 845a30b03cb4051d06f4c2c1452b31f9aa3ddb54..3e1e3d0a850e7cac69f7f3d4e4ebf1ab55e366d6 100644 (file)
@@ -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;
                }