drm_print: condense enum drm_debug_category
authorJim Cromie <jim.cromie@gmail.com>
Mon, 12 Sep 2022 05:28:44 +0000 (23:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2022 13:02:01 +0000 (15:02 +0200)
commit0406faf25fb12d29cb1823e641c6f3f3e2037735
tree3ab0605a3dbd20d26a2a091a0fcbbf93f1939c05
parent19029f3f47c7f2dd796cecd001619a37034d658a
drm_print: condense enum drm_debug_category

enum drm_debug_category has 10 categories, but is initialized with
bitmasks which require 10 bits of underlying storage.  By using
natural enumeration, and moving the BIT(cat) into drm_debug_enabled(),
the enum fits in 4 bits, allowing the category to be represented
directly in pr_debug callsites, via the ddebug.class_id field.

While this slightly pessimizes the bit-test in drm_debug_enabled(),
using dyndbg with JUMP_LABEL will avoid the function entirely.

NOTE: this change forecloses the possibility of doing:

  drm_dbg(DRM_UT_CORE|DRM_UT_KMS, "weird 2-cat experiment")

but thats already strongly implied by the use of the enum itself; its
not a normal enum if it can be 2 values simultaneously.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20220912052852.1123868-2-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/drm/drm_print.h