Patch "drm/radeon: use 64-bit math to calculate CTS values for audio (v2)" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    drm/radeon: use 64-bit math to calculate CTS values for audio (v2)

to the 3.10-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-radeon-use-64-bit-math-to-calculate-cts-values-for-audio-v2.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 062c2e4363451d49ef840232fe65e8bff0dde2a5 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@xxxxxxx>
Date: Fri, 27 Sep 2013 18:09:54 -0400
Subject: drm/radeon: use 64-bit math to calculate CTS values for audio (v2)

From: Alex Deucher <alexander.deucher@xxxxxxx>

commit 062c2e4363451d49ef840232fe65e8bff0dde2a5 upstream.

Avoid losing precision.  See bug:
https://bugs.freedesktop.org/show_bug.cgi?id=69675

v2: fix math as per Anssi's comments.

Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/gpu/drm/radeon/r600_hdmi.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -75,8 +75,15 @@ static const struct radeon_hdmi_acr r600
  */
 static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq)
 {
-	if (*CTS == 0)
-		*CTS = clock * N / (128 * freq) * 1000;
+	u64 n;
+	u32 d;
+
+	if (*CTS == 0) {
+		n = (u64)clock * (u64)N * 1000ULL;
+		d = 128 * freq;
+		do_div(n, d);
+		*CTS = n;
+	}
 	DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n",
 		  N, *CTS, freq);
 }


Patches currently in stable-queue which might be from alexander.deucher@xxxxxxx are

queue-3.10/drm-radeon-use-hw-generated-cts-n-values-for-audio.patch
queue-3.10/drm-radeon-si-fix-define-for-mc_seq_train_wakeup_cntl.patch
queue-3.10/drm-radeon-fix-n-cts-clock-matching-for-audio.patch
queue-3.10/drm-radeon-re-enable-sw-acr-support-on-pre-dce4.patch
queue-3.10/drm-radeon-vm-don-t-attempt-to-update-ptes-if-ib-allocation-fails.patch
queue-3.10/drm-radeon-don-t-share-pplls-on-dce4.1.patch
queue-3.10/drm-radeon-activate-uvd-clocks-before-sending-the-destroy-msg.patch
queue-3.10/drm-radeon-use-64-bit-math-to-calculate-cts-values-for-audio-v2.patch
queue-3.10/radeon-workaround-pinning-failure-on-low-ram-gpu.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]