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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to