AMD-GFX Archive on
 help / color / Atom feed
From: Nicholas Kazlauskas <>
To: <>
Cc: Leo Li <>,
	Bhawanpreet Lakha <>,
	Rodrigo Siqueira <>,
	Harry Wentland <>,
	Nicholas Kazlauskas <>
Subject: [PATCH] drm/amd/display: Make BREAK_TO_DEBUGGER() a debug print
Date: Fri, 22 May 2020 14:03:26 -0400
Message-ID: <> (raw)

Warnings in the kernel are generally treated as errors.

The BREAK_TO_DEBUGGER macro is not a critical error or warning, but
rather intended for developer use to help investigate behavior and
sequences for other issues.

We do still make use of DC_ERROR/ASSERT(0) in various places in the
code for things that are genuine issues.

Since most developers don't actually KGDB while debugging the kernel
these essentially would have no value on their own since the KGDB
breakpoint wouldn't trigger - ASSERT(0) was used as a shortcut to get
a stacktrace.

Turn it into a DRM_DEBUG_DRIVER print instead. We unfortunately lose
the stacktrace, but we still do retain some of the useful debug
information this offers by having at least the function and line
number loggable.

If KGDB is supported in the kernel this will still trigger a real
breakpoint as well.

Cc: Harry Wentland <>
Cc: Leo Li <>
Cc: Bhawanpreet Lakha <>
Cc: Rodrigo Siqueira <>
Signed-off-by: Nicholas Kazlauskas <>
 drivers/gpu/drm/amd/display/dc/os_types.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/os_types.h b/drivers/gpu/drm/amd/display/dc/os_types.h
index 6d7bca562eec..604ceb6c0375 100644
--- a/drivers/gpu/drm/amd/display/dc/os_types.h
+++ b/drivers/gpu/drm/amd/display/dc/os_types.h
@@ -111,7 +111,15 @@
 #define ASSERT(expr) WARN_ON_ONCE(!(expr))
+#if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB)
+#define BREAK_TO_DEBUGGER() \
+	do { \
+		DRM_DEBUG_DRIVER("%s():%d\n", __func__, __LINE__); \
+		kgdb_breakpoint(); \
+	} while (0)
+#define BREAK_TO_DEBUGGER() DRM_DEBUG_DRIVER("%s():%d\n", __func__, __LINE__)
 #define DC_ERR(...)  do { \
 	dm_error(__VA_ARGS__); \

amd-gfx mailing list

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 18:03 Nicholas Kazlauskas [this message]
2020-05-22 18:22 ` Harry Wentland
2020-05-25  9:13 ` Michel Dänzer

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

AMD-GFX Archive on

Archives are clonable:
	git clone --mirror amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ \
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone