From owner-freebsd-x11@FreeBSD.ORG Wed Jul 16 19:25:11 2014 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 1B9297CF; Wed, 16 Jul 2014 19:25:10 +0000 (UTC) Message-ID: <53C6D196.2060708@FreeBSD.org> Date: Wed, 16 Jul 2014 15:25:10 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: sbruno@freebsd.org, =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , freebsd-x11@freebsd.org Subject: Re: [patch] [radeon] remove meaningless checks of unsigned < 0 References: <1405535535.15600.8.camel@bruno> <53C6CD07.50300@FreeBSD.org> In-Reply-To: <53C6CD07.50300@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------090309040205080407010405" X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 19:25:11 -0000 This is a multi-part message in MIME format. --------------090309040205080407010405 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-07-16 15:05:43 -0400, Jung-uk Kim wrote: > On 2014-07-16 14:32:14 -0400, Sean Bruno wrote: >> https://phabric.freebsd.org/D423 > >> This has been in my queue for a while. Anyone have any >> objections to this? > As I noted in the CR, I prefer the upstream changes, i.e., > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7 > > Note our code has "#ifdef DUMBBELL_WIP" around the first patch. > Probably dumbbell hacked it to work around the first problem. ;-) Please see the attached patch. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJTxtGWAAoJEHyflib82/FGBS4H/i5PfoiTm+GeSvRUkbNrL/yp jI5v/7+DX3nlWQARqN6UEeZHfMXtwinetOgRlvx9j+lEBQjt+BgiMKgBvjffu0LK KMW5RxKdHZcQ2gJj/2Y9J99Bh7xU/EohVZyW8VGIfBpNR9y3D4YSAVXVkB/TTvFZ cGpK+eKM3QKpsSMotoHmbDq1srwuWQD7v409pWd+oHmqEyGTzYIthtKVrhJl48GP KJxWPZKpTxmHc73bBmx8yhODFwk6SDUjqLM2TpkPROqbYRWMsDnXnZfg8Sza3gyu 0TbiNV/B4TV6SlohMD5FqoNyKheMn8qfFW7zYdBdNKqK2fZQSBcBlTNARvhqp/g= =x/0E -----END PGP SIGNATURE----- --------------090309040205080407010405 Content-Type: text/x-patch; name="drm2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="drm2.diff" Index: sys/dev/drm2/radeon/rs690.c =================================================================== --- sys/dev/drm2/radeon/rs690.c (revision 268773) +++ sys/dev/drm2/radeon/rs690.c (working copy) @@ -308,12 +308,11 @@ static void rs690_crtc_bandwidth_compute(struct ra 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 radeon_device * } 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 radeon_device * } 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 radeon_device * } 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); Index: sys/dev/drm2/radeon/rv515.c =================================================================== --- sys/dev/drm2/radeon/rv515.c (revision 268773) +++ sys/dev/drm2/radeon/rv515.c (working copy) @@ -1087,14 +1087,10 @@ void rv515_bandwidth_avivo_update(struct radeon_de } 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 radeon_de } 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 radeon_de } 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); --------------090309040205080407010405--