From patchwork Wed Jan 24 16:18:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10183241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE91160353 for ; Wed, 24 Jan 2018 23:07:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B643F28929 for ; Wed, 24 Jan 2018 23:07:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A851828946; Wed, 24 Jan 2018 23:07:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5170728929 for ; Wed, 24 Jan 2018 23:07:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FB0C6E6BB; Wed, 24 Jan 2018 23:07:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id A59BC6E60A for ; Wed, 24 Jan 2018 16:18:54 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id b21so9674588wme.4 for ; Wed, 24 Jan 2018 08:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0BoXZQQLoMz+4RZ32qhl/bsSjpNUAgL5W1qZeEVooLU=; b=EyMGvMv51n1qWrNWky4ofE9GiiPo92xtKHnb20zw3vhVYbQQEHtP0q+FF26l8Brpwm 1WaTMFExvbZX6czPyvyFO8SgVlazqrQVzZriGewueHhyFVkQDz7TV22nIKSiZQNWxB3+ piKeD2rmF3QodbRvC9hbWgDvqQpahc5Mzr/riu2WDYwQ3pi7EWZonjFVrhODVEu2WBAi BoUL5+fFfRYkgucXXZaYuL/Pjxfnr1ksLEqq/nMutgYb5H08L0gKxbwlM3nP0veH5/Px p6N6r/BBzAPHMEZddBgEvPv2xCHKjSyj6EpaYmRXeT8wUEwI3XKEY5ckDw/KDIrNHiwx GWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0BoXZQQLoMz+4RZ32qhl/bsSjpNUAgL5W1qZeEVooLU=; b=A0MqojcDH42LLAM2yYkGolKfil8YVz5NzPNaaqnZgUgFjdcRTGsufOVGVhco6cryAz BMGtG+RWuhlmngTa3K0fvDETY1hm7GCodhDjYwwLBrj2vJ6hc4FEFd6DfXwXyK/+feep LTTF2wc0pnGZRl4Hbb1pZD7vSCMRO5RZ2Kaz3bf/aCV+kxNXgRjenaCuzp/T6dROpsHp 9I2X3HTN1ZbpSy/C9ci0/LKsbjkjfEmmDKRZNjJV52VQSeou+Gvl12LZphKNythjRsMv miVb1xq9GdVX5Ajo9FBHnJG+sruN7MjZ3UFeWdUP0+24wA36xxTTuBABIC8rZAfUFMWc UpGA== X-Gm-Message-State: AKwxytdB6qFn7TeKNUAjoxq7VNkRJ032oOCg2voIjnuihkj0Ti2zIvQt 03CbYjKYtUStC2TFJPQlsZNO6g== X-Google-Smtp-Source: AH8x226mNrwcLI3fKql6yngTqv6yI7qsAXMjNtWDpDLP1lvFBjlVpBn1rdDVUTiWQ1T43cIuSR6U/w== X-Received: by 10.28.225.133 with SMTP id y127mr4888997wmg.55.1516810733167; Wed, 24 Jan 2018 08:18:53 -0800 (PST) Received: from localhost.localdomain ([95.146.148.3]) by smtp.gmail.com with ESMTPSA id y62sm5702609wrb.48.2018.01.24.08.18.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 08:18:52 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Subject: [RFC 2/6] drm: Introduce unexported DRM_LOG_NAME define for logging Date: Wed, 24 Jan 2018 16:18:17 +0000 Message-Id: <20180124161821.28780-3-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180124161821.28780-1-tvrtko.ursulin@linux.intel.com> References: <20180124161821.28780-1-tvrtko.ursulin@linux.intel.com> X-Mailman-Approved-At: Wed, 24 Jan 2018 23:07:46 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tvrtko Ursulin , David Airlie , dri-devel@lists.freedesktop.org, tursulin@ursulin.net, Daniel Vetter MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Instead of having DRM_NAME which is defined in the uAPI headers used for kernel log prefix messages, introduct a new DRM_LOG_NAME define defined privately in kernel space. Leave the DRM_NAME around, but mark it as obsolete in case there is some userspace code depending on its presence. Signed-off-by: Tvrtko Ursulin Cc: Daniel Vetter Cc: Gustavo Padovan Cc: Sean Paul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_print.c | 6 +++--- drivers/gpu/drm/i915/i915_drv.c | 2 +- include/drm/drm_print.h | 9 ++++++++- include/uapi/drm/drm.h | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 781518fd88e3..27244f11c9a3 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -38,7 +38,7 @@ EXPORT_SYMBOL(__drm_printfn_seq_file); void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf) { - dev_info(p->arg, "[" DRM_NAME "] %pV", vaf); + dev_info(p->arg, "[" DRM_LOG_NAME "] %pV", vaf); } EXPORT_SYMBOL(__drm_printfn_info); @@ -63,7 +63,7 @@ void drm_printf(struct drm_printer *p, const char *f, ...) } EXPORT_SYMBOL(drm_printf); -#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV" +#define DRM_PRINTK_FMT "[" DRM_LOG_NAME ":%s]%s %pV" void drm_dev_printk(const struct device *dev, const char *level, unsigned int category, const char *function_name, @@ -102,7 +102,7 @@ void drm_printk(const char *level, unsigned int category, vaf.fmt = format; vaf.va = &args; - printk("%s" "[" DRM_NAME ":%ps]%s %pV", + printk("%s" "[" DRM_LOG_NAME ":%ps]%s %pV", level, __builtin_return_address(0), strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf); diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 1fbe37889d92..915e43aacaa5 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -94,7 +94,7 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level, vaf.fmt = fmt; vaf.va = &args; - dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV", + dev_printk(level, kdev, "[" DRM_LOG_NAME ":%ps] %pV", __builtin_return_address(0), &vaf); if (is_error && !shown_bug_once) { diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 2a4a42e59a47..d6901128faf2 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -60,6 +60,13 @@ * } */ +/** + * String output in log messages - can be overriden by driver code. + */ +#ifndef DRM_LOG_NAME +#define DRM_LOG_NAME "drm" +#endif + /** * struct drm_printer - drm output "stream" * @@ -208,7 +215,7 @@ void drm_printk(const char *level, unsigned int category, #define _DRM_PRINTK(once, level, fmt, ...) \ do { \ - printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ + printk##once(KERN_##level "[" DRM_LOG_NAME "] " fmt, \ ##__VA_ARGS__); \ } while (0) diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 6fdff5945c8a..7b512673c220 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -69,7 +69,7 @@ typedef unsigned long drm_handle_t; extern "C" { #endif -#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ +#define DRM_NAME "drm" /**< Deprecated. */ #define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ #define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ #define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */