diff mbox

[v2] drm/i915: fix a limit check in hsw_compute_wm_results()

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

Commit Message

Dan Carpenter Aug. 9, 2013, 10:07 a.m. UTC
The '!' here was not intended.  Since '!' has higher precedence than
compare, it means the check is never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: My first patch was wrong.

Comments

Ville Syrjälä Aug. 9, 2013, 10:29 a.m. UTC | #1
On Fri, Aug 09, 2013 at 01:07:31PM +0300, Dan Carpenter wrote:
> The '!' here was not intended.  Since '!' has higher precedence than
> compare, it means the check is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

The culprit for Daniel:

commit 71fff20ff1bb790f4defe0c880e028581ffab420
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Tue Aug 6 22:24:03 2013 +0300

    drm/i915: Kill fbc_enable from hsw_lp_wm_results

> ---
> v2: My first patch was wrong.
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 96234c6..0f5eb21 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2685,7 +2685,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;
>  		}
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Aug. 9, 2013, 4:27 p.m. UTC | #2
On Fri, Aug 09, 2013 at 01:29:33PM +0300, Ville Syrjälä wrote:
> On Fri, Aug 09, 2013 at 01:07:31PM +0300, Dan Carpenter wrote:
> > The '!' here was not intended.  Since '!' has higher precedence than
> > compare, it means the check is never true.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The culprit for Daniel:
> 
> commit 71fff20ff1bb790f4defe0c880e028581ffab420
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Tue Aug 6 22:24:03 2013 +0300
> 
>     drm/i915: Kill fbc_enable from hsw_lp_wm_results

Queued for -next, thanks for the patch.
-Daniel
> 
> > ---
> > v2: My first patch was wrong.
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 96234c6..0f5eb21 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -2685,7 +2685,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;
> >  		}
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel OTC
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 96234c6..0f5eb21 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2685,7 +2685,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;
 		}