Skip to contentSkip to conversation

Patch "drm/amdgpu: change vblank_time's calculation method to reduce computational error." has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Oct 28, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/amdgpu: change vblank_time's calculation method to reduce computational error.

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From dc8184aa8621ee8048652496884d9f40d4bb407f Mon Sep 17 00:00:00 2001

From: Rex Zhu <[email protected]>
Date: Mon, 10 Oct 2016 15:57:21 +0800
Subject: drm/amdgpu: change vblank_time's calculation method to reduce computational error.

From: Rex Zhu <[email protected]>

commit dc8184aa8621ee8048652496884d9f40d4bb407f upstream.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +8 -6
@@ -113,24 +113,26 @@ void amdgpu_dpm_print_ps_status(struct a
 	printk("\n");
 }
 
+
 u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev)
 {
 	struct drm_device *dev = adev->ddev;
 	struct drm_crtc *crtc;
 	struct amdgpu_crtc *amdgpu_crtc;
-	u32 line_time_us, vblank_lines;
+	u32 vblank_in_pixels;
 	u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
 
 	if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
 		list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 			amdgpu_crtc = to_amdgpu_crtc(crtc);
 			if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
-				line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) /
-					amdgpu_crtc->hw_mode.clock;
-				vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end -
+				vblank_in_pixels =
+					amdgpu_crtc->hw_mode.crtc_htotal *
+					(amdgpu_crtc->hw_mode.crtc_vblank_end -
 					amdgpu_crtc->hw_mode.crtc_vdisplay +
-					(amdgpu_crtc->v_border * 2);
-				vblank_time_us = vblank_lines * line_time_us;
+					(amdgpu_crtc->v_border * 2));
+
+				vblank_time_us = vblank_in_pixels * 1000 / amdgpu_crtc->hw_mode.clock;
 				break;
 			}
 		}

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/drm-amd-powerplay-fix-mclk-not-switching-back-after-multi-head-was-disabled.patch queue-4.8/drm-amdgpu-change-vblank_time-s-calculation-method-to-reduce-computational-error.patch