Re: [PATCH] drm/i915: Shrink pipe config checker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 05, 2016 at 12:10:41PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> Replace INTEL_ERR_OR_DBG_KMS macro with an intel_err_or_dbg_kms
> function to shrink the code and rodata strings.
> 
>    text    data     bss     dec     hex filename
> 1271480   41831    2016 1315327  1411ff i915.ko.0
> 1265160   41831    2016 1309007  13f94f i915.ko.2
> 
> Total of ~6 KiB saving across text and strings.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 51 ++++++++++++++++++++++++------------
>  1 file changed, 34 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1fafcce53ecc..567c4d16d1f0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13218,6 +13218,31 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n,
>  	return false;
>  }
>  
> +static void
> +intel_err_or_dbg_kms(bool adjust, const char *name, const char *format, ...)
> +{
> +	char *level;
> +	unsigned int category;
> +	struct va_format vaf;
> +	va_list args;
> +
> +	if (adjust) {
> +		level = KERN_DEBUG;
> +		category = DRM_UT_KMS;
> +	} else {
> +		level = KERN_ERR;
> +		category = DRM_UT_NONE;
> +	}
> +
> +	va_start(args, format);
> +	vaf.fmt = format;
> +	vaf.va = &args;
> +
> +	drm_printk(level, category, "mismatch in %s %pV", name, &vaf);
> +
> +	va_end(args);
> +}

Function name still does not quite work for me, best I could suggest
was pipe_config_err() or pipe_config_msg().

However, that is immaterial to this patch which is primarly about taking
advantage of the new drm_printk().

Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux