diff mbox

drm/i915: precedence bug in hsw_compute_wm_results()

Message ID 20130809094302.GA29282@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Aug. 9, 2013, 9:43 a.m. UTC
The '!' operation has higher precedence than the compare so probably
this test is never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Chris Wilson Aug. 9, 2013, 9:58 a.m. UTC | #1
On Fri, Aug 09, 2013 at 12:43:02PM +0300, Dan Carpenter wrote:
> The '!' operation has higher precedence than the compare so probably
> this test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index a5a9959..0b9d9a7 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2562,7 +2562,7 @@ static void hsw_compute_wm_results(struct drm_device *dev,
>  	 * a WM level. */
>  	results->enable_fbc_wm = true;
>  	for (level = 1; level <= max_level; level++) {
> -		if (!lp_results[level - 1].fbc_val > lp_maximums->fbc) {
> +		if (lp_results[level - 1].fbc_val <= lp_maximums->fbc) {

I didn't spot that '!' at all. It's a stray and should be just removed.
-Chris
Ville Syrjälä Aug. 9, 2013, 10:04 a.m. UTC | #2
On Fri, Aug 09, 2013 at 12:43:02PM +0300, Dan Carpenter wrote:
> The '!' operation has higher precedence than the compare so probably
> this test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index a5a9959..0b9d9a7 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2562,7 +2562,7 @@ static void hsw_compute_wm_results(struct drm_device *dev,
>  	 * a WM level. */
>  	results->enable_fbc_wm = true;
>  	for (level = 1; level <= max_level; level++) {
> -		if (!lp_results[level - 1].fbc_val > lp_maximums->fbc) {
> +		if (lp_results[level - 1].fbc_val <= lp_maximums->fbc) {

Whoops. My bad.

It should still be > but ! should just be dropped.

>  			results->enable_fbc_wm = false;
>  			lp_results[level - 1].fbc_val = 0;
>  		}
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a5a9959..0b9d9a7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2562,7 +2562,7 @@  static void hsw_compute_wm_results(struct drm_device *dev,
 	 * a WM level. */
 	results->enable_fbc_wm = true;
 	for (level = 1; level <= max_level; level++) {
-		if (!lp_results[level - 1].fbc_val > lp_maximums->fbc) {
+		if (lp_results[level - 1].fbc_val <= lp_maximums->fbc) {
 			results->enable_fbc_wm = false;
 			lp_results[level - 1].fbc_val = 0;
 		}