• Douglas Anderson's avatar
    drm/print: Add deprecation notes to DRM_...() functions · 30658985
    Douglas Anderson authored
    It's hard for someone (like me) who's not following closely to know
    what the suggested best practices are for error printing in DRM
    drivers. Add some hints to the header file.
    
    In general, my understanding is that:
    * When possible we should be using a `struct drm_device` for logging
      and recent patches have tried to make it more possible to access a
      relevant `struct drm_device` in more places.
    * For most cases when we don't have a `struct drm_device`, we no
      longer bother with DRM-specific wrappers on the dev_...() functions
      or pr_...() functions and just encourage drivers to use the normal
      functions.
    * For debug-level functions where we might want filtering based on a
      category we'll still have DRM-specific wrappers, but we'll only
      support passing a `struct drm_device`, not a `struct
      device`. Presumably most of the cases where we want the filtering
      are messages that happen while the system is in a normal running
      state (AKA not during probe time) and we should have a `struct
      drm_device` then. If we absolutely can't get a `struct drm_device`
      then these functions begrudgingly accept NULL for the `struct
      drm_device` and hopefully the awkwardness of having to manually pass
      NULL will keep people from doing this unless absolutely necessary.
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Acked-by: default avatarLyude Paul <lyude@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210921082757.RFC.1.Ibd82d98145615fa55f604947dc6a696cc82e8e43@changeid
    30658985
drm_print.h 17.6 KB