diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 16:00:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 16:00:44 -0700 |
commit | 9779714c8af09d57527f18d9aa2207dcc27a8687 (patch) | |
tree | 52182f2289d9b7a77fbe119f4cd5726ef6494e66 /drivers/serial | |
parent | 89a6c8cb9e6e11b6e3671dce7e037789b8f7cf62 (diff) | |
parent | 65b5ac1479840a3e87f086d68e5ef91f3002e8e2 (diff) | |
download | lwn-9779714c8af09d57527f18d9aa2207dcc27a8687.tar.gz lwn-9779714c8af09d57527f18d9aa2207dcc27a8687.zip |
Merge branch 'kms-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'kms-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
kgdb,docs: Update the kgdb docs to include kms
drm_fb_helper: Preserve capability to use atomic kms
i915: when kgdb is active display compression should be off
drm/i915: use new fb debug hooks
drm: add KGDB/KDB support
fb: add hooks to handle KDB enter/exit
kgdboc: Add call backs to allow kernel mode switching
vt,console,kdb: automatically set kdb LINES variable
vt,console,kdb: implement atomic console enter/leave functions
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/kgdboc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index a9a94ae72349..39f9a1adaa75 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c @@ -17,6 +17,7 @@ #include <linux/kdb.h> #include <linux/tty.h> #include <linux/console.h> +#include <linux/vt_kern.h> #define MAX_CONFIG_LEN 40 @@ -31,6 +32,7 @@ static struct kparam_string kps = { .maxlen = MAX_CONFIG_LEN, }; +static int kgdboc_use_kms; /* 1 if we use kernel mode switching */ static struct tty_driver *kgdb_tty_driver; static int kgdb_tty_line; @@ -104,6 +106,12 @@ static int configure_kgdboc(void) kgdboc_io_ops.is_console = 0; kgdb_tty_driver = NULL; + kgdboc_use_kms = 0; + if (strncmp(cptr, "kms,", 4) == 0) { + cptr += 4; + kgdboc_use_kms = 1; + } + if (kgdboc_register_kbd(&cptr)) goto do_register; @@ -201,8 +209,14 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) return configure_kgdboc(); } +static int dbg_restore_graphics; + static void kgdboc_pre_exp_handler(void) { + if (!dbg_restore_graphics && kgdboc_use_kms) { + dbg_restore_graphics = 1; + con_debug_enter(vc_cons[fg_console].d); + } /* Increment the module count when the debugger is active */ if (!kgdb_connected) try_module_get(THIS_MODULE); @@ -213,6 +227,10 @@ static void kgdboc_post_exp_handler(void) /* decrement the module count when the debugger detaches */ if (!kgdb_connected) module_put(THIS_MODULE); + if (kgdboc_use_kms && dbg_restore_graphics) { + dbg_restore_graphics = 0; + con_debug_leave(); + } } static struct kgdb_io kgdboc_io_ops = { |