]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/print: introduce new struct drm_device based logging macros
authorJani Nikula <jani.nikula@intel.com>
Tue, 10 Dec 2019 12:30:43 +0000 (14:30 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 17 Dec 2019 14:43:20 +0000 (16:43 +0200)
commitfb6c7ab8718eb2543695d77ad8302ff81e8e1e32
treeb510e8a99655a013176b3874c8f95d1ca0f05186
parent9212f8ee412012252d4d7c93ea262b415ced00e7
drm/print: introduce new struct drm_device based logging macros

Add new struct drm_device based logging macros modeled after the core
kernel device based logging macros. These would be preferred over the
drm printk and struct device based macros in drm code, where possible.

We have existing drm specific struct device based logging functions, but
they are too verbose to use for two main reasons:

 * The names are unnecessarily long, for example DRM_DEV_DEBUG_KMS().

 * The use of struct device over struct drm_device is too generic for
   most users, leading to an extra dereference.

For example:

DRM_DEV_DEBUG_KMS(drm->dev, "Hello, world\n");

vs.

drm_dbg_kms(drm, "Hello, world\n");

It's a matter of taste, but the SHOUTING UPPERCASE has been argued to be
less readable than lowercase.

Some names are changed from old DRM names to be based on the core kernel
logging functions. For example, NOTE -> notice, ERROR -> err, DEBUG ->
dbg.

Due to the conflation of DRM_DEBUG and DRM_DEBUG_DRIVER macro use
(DRM_DEBUG is used widely in drivers though it's supposed to be a core
debugging category), they are named as drm_dbg_core and drm_dbg,
respectively.

The drm_err and _once/_ratelimited variants no longer include the
function name in order to be able to use the core device based logging
macros. Arguably this is not a significant change; error messages should
not be so common to be only distinguishable by the function name.

Ratelimited debug logging macros are to be added later.

Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Sean Paul <sean@poorly.run>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210123050.8799-1-jani.nikula@intel.com
include/drm/drm_print.h