All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: Add PIPE_CONF_CHECK_CLOCK_FUZZY()
Date: Wed, 04 Sep 2013 12:11:10 +0300	[thread overview]
Message-ID: <87li3dhryp.fsf@intel.com> (raw)
In-Reply-To: <1378218761-17395-3-git-send-email-ville.syrjala@linux.intel.com>

On Tue, 03 Sep 2013, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Add a new pipe config check macro PIPE_CONF_CHECK_CLOCK_FUZZY() to make
> it trivial and error proof to compare clocks in a fuzzy manner.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1fea189..bfa531a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8601,6 +8601,15 @@ intel_pipe_config_compare(struct drm_device *dev,
>  		return false; \
>  	}
>  
> +#define PIPE_CONF_CHECK_CLOCK_FUZZY(name) \
> +	if (!intel_fuzzy_clock_check(current_config->name, pipe_config->name)) { \
> +		DRM_ERROR("mismatch in " #name " " \
> +			  "(expected %i, found %i)\n", \
> +			  current_config->name, \
> +			  pipe_config->name); \
> +		return false; \
> +	}

I think I'd find this to have more clarity, but ymmv:

		DRM_ERROR("mismatch in %s (expected %i, found %i)\n", \
			  #name, current_config->name, pipe_config->name); \

Either way, on the series,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>



> +
>  #define PIPE_CONF_QUIRK(quirk)	\
>  	((current_config->quirks | pipe_config->quirks) & (quirk))
>  
> @@ -8663,21 +8672,16 @@ intel_pipe_config_compare(struct drm_device *dev,
>  	PIPE_CONF_CHECK_X(dpll_hw_state.fp0);
>  	PIPE_CONF_CHECK_X(dpll_hw_state.fp1);
>  
> +	if (!IS_HASWELL(dev)) {
> +		PIPE_CONF_CHECK_CLOCK_FUZZY(adjusted_mode.clock);
> +	}
> +
>  #undef PIPE_CONF_CHECK_X
>  #undef PIPE_CONF_CHECK_I
>  #undef PIPE_CONF_CHECK_FLAGS
> +#undef PIPE_CONF_CHECK_CLOCK_FUZZY
>  #undef PIPE_CONF_QUIRK
>  
> -	if (!IS_HASWELL(dev)) {
> -		if (!intel_fuzzy_clock_check(current_config->adjusted_mode.clock,
> -					     pipe_config->adjusted_mode.clock)) {
> -			DRM_ERROR("mismatch in clock (expected %d, found %d)\n",
> -				  current_config->adjusted_mode.clock,
> -				  pipe_config->adjusted_mode.clock);
> -			return false;
> -		}
> -	}
> -
>  	return true;
>  }
>  
> -- 
> 1.8.1.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2013-09-04  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 14:32 [PATCH 0/3] drm/i915: Fuzzy clock check for port_clock ville.syrjala
2013-09-03 14:32 ` [PATCH 1/3] drm/i915: Make intel_fuzzy_clock_check() take in arbitrary clocks ville.syrjala
2013-09-03 14:32 ` [PATCH 2/3] drm/i915: Add PIPE_CONF_CHECK_CLOCK_FUZZY() ville.syrjala
2013-09-04  9:11   ` Jani Nikula [this message]
2013-09-03 14:32 ` [PATCH 3/3] drm/i915: Add fuzzy clock check for port_clock ville.syrjala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87li3dhryp.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.