summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@jbarnes-t61.(none)>2008-06-18 14:01:47 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-06-18 14:01:47 -0700
commit241ff808b0f7368e3988d51d2ea3775adb75b6f4 (patch)
tree3fa8046616db8f3ba73f7133619c7b672e8a497d /linux-core
parent4a2e29bf9982165deeeabb5c585fc0a8a659f380 (diff)
parent7010d500072977f63a0bac08f2141d69dbd19595 (diff)
Merge branch 'modesetting-101' into modesetting-gem
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/intel_fb.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/linux-core/intel_fb.c b/linux-core/intel_fb.c
index d53b22ff..b082080c 100644
--- a/linux-core/intel_fb.c
+++ b/linux-core/intel_fb.c
@@ -581,6 +581,22 @@ int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc)
}
EXPORT_SYMBOL(intelfb_resize);
+static struct drm_mode_set panic_mode;
+
+int intelfb_panic(struct notifier_block *n, unsigned long ununsed,
+ void *panic_str)
+{
+ DRM_ERROR("panic occurred, switching back to text console\n");
+ drm_crtc_helper_set_config(&panic_mode);
+
+ return 0;
+}
+EXPORT_SYMBOL(intelfb_panic);
+
+static struct notifier_block paniced = {
+ .notifier_call = intelfb_panic,
+};
+
int intelfb_create(struct drm_device *dev, uint32_t fb_width, uint32_t fb_height,
uint32_t surface_width, uint32_t surface_height,
struct intel_framebuffer **intel_fb_p)
@@ -844,6 +860,12 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc *
printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
info->fix.id);
+
+ /* Switch back to kernel console on panic */
+ panic_mode = *modeset;
+ atomic_notifier_chain_register(&panic_notifier_list, &paniced);
+ printk(KERN_INFO "registered panic notifier\n");
+
return 0;
}
@@ -965,6 +987,12 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
info->fix.id);
+
+ /* Switch back to kernel console on panic */
+ panic_mode = *modeset;
+ atomic_notifier_chain_register(&panic_notifier_list, &paniced);
+ printk(KERN_INFO "registered panic notifier\n");
+
return 0;
}
@@ -1020,6 +1048,9 @@ int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb)
mutex_unlock(&dev->struct_mutex);
framebuffer_release(info);
}
+
+ atomic_notifier_chain_unregister(&panic_notifier_list, &paniced);
+ memset(&panic_mode, 0, sizeof(struct drm_mode_set));
return 0;
}
EXPORT_SYMBOL(intelfb_remove);