Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Aug 2014 21:45:58 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r269790 - stable/10/sys/dev/drm2/radeon
Message-ID:  <53e7e816.225d.2dfec8dd@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Sun Aug 10 21:45:58 2014
New Revision: 269790
URL: http://svnweb.freebsd.org/changeset/base/269790

Log:
  MFC r268954
  
  Merge change from upstream linux kernel submitted by OpenBSD:
  
  drm/radeon: fix-up some float to fixed conversion thinkos
  
  Remove #ifdef DUMBBELL_WIP in favor of upstream fix.

Modified:
  stable/10/sys/dev/drm2/radeon/rs690.c
  stable/10/sys/dev/drm2/radeon/rv515.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/drm2/radeon/rs690.c
==============================================================================
--- stable/10/sys/dev/drm2/radeon/rs690.c	Sun Aug 10 21:17:19 2014	(r269789)
+++ stable/10/sys/dev/drm2/radeon/rs690.c	Sun Aug 10 21:45:58 2014	(r269790)
@@ -308,12 +308,11 @@ static void rs690_crtc_bandwidth_compute
 		if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
 			rdev->pm.sideport_bandwidth.full)
 			rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth;
-#ifdef DUMBBELL_WIP
-		read_delay_latency.full = dfixed_const(370 * 800 * 1000);
-#endif /* DUMBBELL_WIP */
-		read_delay_latency.full = UINT_MAX;
-		read_delay_latency.full = dfixed_div(read_delay_latency,
-			rdev->pm.igp_sideport_mclk);
+		read_delay_latency.full = dfixed_const(370 * 800);
+		a.full = dfixed_const(1000);
+		b.full = dfixed_div(rdev->pm.igp_sideport_mclk, a);
+		read_delay_latency.full = dfixed_div(read_delay_latency, b);
+		read_delay_latency.full = dfixed_mul(read_delay_latency, a);
 	} else {
 		if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full &&
 			rdev->pm.k8_bandwidth.full)
@@ -488,14 +487,10 @@ void rs690_bandwidth_update(struct radeo
 		}
 		if (wm0.priority_mark.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark.full;
-		if (dfixed_trunc(priority_mark02) < 0)
-			priority_mark02.full = 0;
 		if (wm0.priority_mark_max.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark_max.full;
 		if (wm1.priority_mark.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark.full;
-		if (dfixed_trunc(priority_mark12) < 0)
-			priority_mark12.full = 0;
 		if (wm1.priority_mark_max.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark_max.full;
 		d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
@@ -526,8 +521,6 @@ void rs690_bandwidth_update(struct radeo
 		}
 		if (wm0.priority_mark.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark.full;
-		if (dfixed_trunc(priority_mark02) < 0)
-			priority_mark02.full = 0;
 		if (wm0.priority_mark_max.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark_max.full;
 		d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
@@ -555,8 +548,6 @@ void rs690_bandwidth_update(struct radeo
 		}
 		if (wm1.priority_mark.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark.full;
-		if (dfixed_trunc(priority_mark12) < 0)
-			priority_mark12.full = 0;
 		if (wm1.priority_mark_max.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark_max.full;
 		d2mode_priority_a_cnt = dfixed_trunc(priority_mark12);

Modified: stable/10/sys/dev/drm2/radeon/rv515.c
==============================================================================
--- stable/10/sys/dev/drm2/radeon/rv515.c	Sun Aug 10 21:17:19 2014	(r269789)
+++ stable/10/sys/dev/drm2/radeon/rv515.c	Sun Aug 10 21:45:58 2014	(r269790)
@@ -1087,14 +1087,10 @@ void rv515_bandwidth_avivo_update(struct
 		}
 		if (wm0.priority_mark.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark.full;
-		if (dfixed_trunc(priority_mark02) < 0)
-			priority_mark02.full = 0;
 		if (wm0.priority_mark_max.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark_max.full;
 		if (wm1.priority_mark.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark.full;
-		if (dfixed_trunc(priority_mark12) < 0)
-			priority_mark12.full = 0;
 		if (wm1.priority_mark_max.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark_max.full;
 		d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
@@ -1125,8 +1121,6 @@ void rv515_bandwidth_avivo_update(struct
 		}
 		if (wm0.priority_mark.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark.full;
-		if (dfixed_trunc(priority_mark02) < 0)
-			priority_mark02.full = 0;
 		if (wm0.priority_mark_max.full > priority_mark02.full)
 			priority_mark02.full = wm0.priority_mark_max.full;
 		d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
@@ -1154,8 +1148,6 @@ void rv515_bandwidth_avivo_update(struct
 		}
 		if (wm1.priority_mark.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark.full;
-		if (dfixed_trunc(priority_mark12) < 0)
-			priority_mark12.full = 0;
 		if (wm1.priority_mark_max.full > priority_mark12.full)
 			priority_mark12.full = wm1.priority_mark_max.full;
 		d2mode_priority_a_cnt = dfixed_trunc(priority_mark12);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e7e816.225d.2dfec8dd>