From: Jani Nikula <jani.nikula@intel.com>
To: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>,
daniel@ffwll.ch, sam@ravnborg.org, sudeep.dutt@intel.com,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@linux.ie>
Cc: pankaj.laxminarayan.bharadiya@intel.com
Subject: Re: [[Intel-gfx] [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros
Date: Tue, 21 Jan 2020 10:39:34 +0200 [thread overview]
Message-ID: <87muahfbjt.fsf@intel.com> (raw)
In-Reply-To: <87y2u9jav8.fsf@intel.com>
On Wed, 15 Jan 2020, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 15 Jan 2020, Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> wrote:
>> Add new struct drm_device based WARN* macros. These are modeled after
>> the core kernel device based WARN* macros. These would be preferred
>> over the regular WARN* macros, where possible.
>>
>> These macros include device information in the backtrace, so we know
>> what device the warnings originate from.
>>
>> Knowing the device specific information in the backtrace would be
>> helpful in development all around.
>>
>> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
All, I'd really appreciate acks or reviews on this one to unblock the
rest. I think the patch is fine, but I'd like wider approval before
merging.
I'm thinking of putting this in a topic branch and merging to both
drm-intel-next-queued and drm-misc-next, so we can start converting i915
to use this.
BR,
Jani.
>
>> ---
>> include/drm/drm_print.h | 29 +++++++++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>>
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index 8f99d389792d..894a0b9437e2 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -553,4 +553,33 @@ void __drm_err(const char *format, ...);
>> #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...) \
>> DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
>>
>> +/*
>> + * struct drm_device based WARNs
>> + *
>> + * drm_WARN*() acts like WARN*(), but with the key difference of
>> + * using device specific information so that we know from which device
>> + * warning is originating from.
>> + *
>> + * Prefer drm_device based drm_WARN* over regular WARN*
>> + */
>> +
>> +/* Helper for struct drm_device based WARNs */
>> +#define drm_WARN(drm, condition, format, arg...) \
>> + WARN(condition, "%s %s: " format, \
>> + dev_driver_string((drm)->dev), \
>> + dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ONCE(drm, condition, format, arg...) \
>> + WARN_ONCE(condition, "%s %s: " format, \
>> + dev_driver_string((drm)->dev), \
>> + dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ON(drm, x) \
>> + drm_WARN((drm), (x), "%s", \
>> + "drm_WARN_ON(" __stringify(x) ")")
>> +
>> +#define drm_WARN_ON_ONCE(drm, x) \
>> + drm_WARN_ONCE((drm), (x), "%s", \
>> + "drm_WARN_ON_ONCE(" __stringify(x) ")")
>> +
>> #endif /* DRM_PRINT_H_ */
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-01-21 8:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 3:44 [[Intel-gfx] [PATCH v2 00/10] drm: Introduce struct drm_device based WARN* and use them in i915 Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros Pankaj Bharadiya
2020-01-15 10:02 ` Jani Nikula
2020-01-21 8:39 ` Jani Nikula [this message]
2020-01-21 9:13 ` Sam Ravnborg
2020-01-22 13:30 ` [Intel-gfx] [ " Sean Paul
2020-01-22 15:32 ` Jani Nikula
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 02/10] drm/i915/display: Make WARN* drm specific where drm_device ptr is available Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 03/10] drm/i915/display: Make WARN* drm specific where drm_priv " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 04/10] drm/i915/display: Make WARN* drm specific where encoder " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 05/10] drm/i915/gem: Make WARN* drm specific where drm_priv " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 06/10] drm/i915/gt: " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 07/10] drm/i915/gvt: " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 08/10] drm/i915/gvt: Make WARN* drm specific where vgpu " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 09/10] drm/i915: Make WARN* drm specific where drm_priv " Pankaj Bharadiya
2020-01-15 3:44 ` [[Intel-gfx] [PATCH v2 10/10] drm/i915: Make WARN* drm specific where uncore or stream " Pankaj Bharadiya
2020-01-22 16:22 ` [[Intel-gfx] [PATCH v2 00/10] drm: Introduce struct drm_device based WARN* and use them in i915 Jani Nikula
2020-01-23 9:00 ` Bharadiya,Pankaj
2020-01-23 9:39 ` Jani Nikula
2020-01-27 8:14 ` Bharadiya,Pankaj
2020-01-27 9:01 ` Jani Nikula
-- strict thread matches above, loose matches on Subject: below --
2020-01-15 3:43 Pankaj Bharadiya
2020-01-15 3:43 ` [[Intel-gfx] [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros Pankaj Bharadiya
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=87muahfbjt.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=pankaj.laxminarayan.bharadiya@intel.com \
--cc=sam@ravnborg.org \
--cc=sudeep.dutt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).