[PATCH 3/3] drm/ast: Use per-device logging macros

Sam Ravnborg sam at ravnborg.org
Fri Jun 12 07:01:37 UTC 2020


Hi Thomas

On Fri, Jun 12, 2020 at 08:28:40AM +0200, Thomas Zimmermann wrote:
> Hi Sam
> 
> Am 11.06.20 um 21:24 schrieb Sam Ravnborg:
> > Hi Thomas.
> > On Thu, Jun 11, 2020 at 10:28:09AM +0200, Thomas Zimmermann wrote:
> >> Converts the ast driver to drm_info() and drm_err(). No functional
> >> changes are made.
> >>
> >> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> > Acked-by: Sam Ravnborg <sam at ravnborg.org>
> > 
> > I hope you will later follow-up with a patch that introduces drm_WARN_*.
> 
> I only found DRM_INFO and DRM_ERROR calls. Did I miss any other warning
> macros?

The following:
ast_mode.c:     if (WARN_ON_ONCE(gpu_addr < 0))
ast_mode.c:     if (WARN_ON_ONCE(fb->width > AST_MAX_HWC_WIDTH) ||
ast_mode.c:         WARN_ON_ONCE(fb->height > AST_MAX_HWC_HEIGHT))
ast_mode.c:             if (WARN_ON_ONCE(off < 0))
ast_mode.c:     if (WARN_ON(!crtc->state))

can benefit from:

/*
 * 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*
 */

...

#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) ")")


Also from drm/drm_print.h

	Sam


More information about the dri-devel mailing list