From: Joe Perches <joe@perches.com>
To: Sam Ravnborg <sam@ravnborg.org>,
dri-devel@lists.freedesktop.org,
Jani Nikula <jani.nikula@intel.com>,
Daniel Vetter <daniel@ffwll.ch>
Cc: Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v1 6/8] drm/print: add drm_dev_* logging functions
Date: Sat, 21 Dec 2019 05:56:17 -0800 [thread overview]
Message-ID: <d1995ca9ff5b2f91d255eba97b9461d8a800a807.camel@perches.com> (raw)
In-Reply-To: <20191221095553.13332-7-sam@ravnborg.org>
On Sat, 2019-12-21 at 10:55 +0100, Sam Ravnborg wrote:
> There are a lot of cases where we have a device * but no drm_device *.
> Add drm_dev_* variants of the logging functions to cover these cases.
[]
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
[]
> @@ -468,6 +511,60 @@ static inline bool drm_debug_enabled(enum drm_debug_category category)
> #define drm_dbg_dp(drm, fmt, ...) \
> __drm_cat_printk((drm), DRM_UT_DP, fmt, ##__VA_ARGS__)
>
> +/* struct device based logging. */
> +#define __drm_dev_printk(dev, level, type, fmt, ...) \
> + dev_##level##type(dev, "[drm] " fmt, ##__VA_ARGS__)
> +
> +#define __drm_dev_cat_printk(dev, cat, type, fmt, ...) \
> +({ \
> + if (drm_debug_enabled(cat)) \
> + dev_dbg##type((dev), "[drm] " fmt, ##__VA_ARGS__); \
trivia: The parentheses around dev aren't necessary.
> +})
> +
> +#define drm_dev_info(dev, fmt, ...) \
> + __drm_dev_printk((dev), info,, fmt, ##__VA_ARGS__)
etc...
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-12-21 14:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-21 9:55 [RFC PATCH 0/9] drm: add more new-style logging functions Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 1/8] drm/print: document " Sam Ravnborg
2019-12-23 11:23 ` Jani Nikula
2019-12-23 12:07 ` Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 2/8] drm/print: move new style " Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 3/8] drm/print: add new logging helper for drm logging Sam Ravnborg
2019-12-23 11:16 ` Jani Nikula
2019-12-23 11:18 ` Joe Perches
2019-12-23 12:10 ` Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 4/8] drm/print: add kernel-doc for drm_debug_enabled Sam Ravnborg
2019-12-23 11:18 ` Jani Nikula
2019-12-21 9:55 ` [PATCH v1 5/8] drm/print: rename drm_dev_dbg Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 6/8] drm/print: add drm_dev_* logging functions Sam Ravnborg
2019-12-21 13:56 ` Joe Perches [this message]
2019-12-21 14:48 ` Sam Ravnborg
2019-12-23 11:21 ` Jani Nikula
2019-12-23 11:29 ` Jani Nikula
2019-12-23 12:35 ` Sam Ravnborg
2019-12-31 14:35 ` Jani Nikula
2019-12-21 9:55 ` [PATCH v1 7/8] drm/print: add drm_pr_ logging Sam Ravnborg
2019-12-21 9:55 ` [PATCH v1 8/8] drm/print: let legacy logging use new style functions Sam Ravnborg
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=d1995ca9ff5b2f91d255eba97b9461d8a800a807.camel@perches.com \
--to=joe@perches.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox