|
@@ -26,6 +26,65 @@
|
|
|
#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
|
|
|
#endif
|
|
|
|
|
|
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
|
|
|
+/* These are both protected by the console_lock */
|
|
|
+static RAW_NOTIFIER_HEAD(dummycon_output_nh);
|
|
|
+static bool dummycon_putc_called;
|
|
|
+
|
|
|
+void dummycon_register_output_notifier(struct notifier_block *nb)
|
|
|
+{
|
|
|
+ raw_notifier_chain_register(&dummycon_output_nh, nb);
|
|
|
+
|
|
|
+ if (dummycon_putc_called)
|
|
|
+ nb->notifier_call(nb, 0, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+void dummycon_unregister_output_notifier(struct notifier_block *nb)
|
|
|
+{
|
|
|
+ raw_notifier_chain_unregister(&dummycon_output_nh, nb);
|
|
|
+}
|
|
|
+
|
|
|
+static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos)
|
|
|
+{
|
|
|
+ dummycon_putc_called = true;
|
|
|
+ raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
|
|
|
+ int count, int ypos, int xpos)
|
|
|
+{
|
|
|
+ int i;
|
|
|
+
|
|
|
+ if (!dummycon_putc_called) {
|
|
|
+ /* Ignore erases */
|
|
|
+ for (i = 0 ; i < count; i++) {
|
|
|
+ if (s[i] != vc->vc_video_erase_char)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (i == count)
|
|
|
+ return;
|
|
|
+
|
|
|
+ dummycon_putc_called = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
|
|
|
+{
|
|
|
+ /* Redraw, so that we get putc(s) for output done while blanked */
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+#else
|
|
|
+static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { }
|
|
|
+static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
|
|
|
+ int count, int ypos, int xpos) { }
|
|
|
+static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
static const char *dummycon_startup(void)
|
|
|
{
|
|
|
return "dummy device";
|
|
@@ -44,9 +103,6 @@ static void dummycon_init(struct vc_data *vc, int init)
|
|
|
static void dummycon_deinit(struct vc_data *vc) { }
|
|
|
static void dummycon_clear(struct vc_data *vc, int sy, int sx, int height,
|
|
|
int width) { }
|
|
|
-static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { }
|
|
|
-static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
|
|
|
- int count, int ypos, int xpos) { }
|
|
|
static void dummycon_cursor(struct vc_data *vc, int mode) { }
|
|
|
|
|
|
static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
|
|
@@ -61,11 +117,6 @@ static int dummycon_switch(struct vc_data *vc)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
|
|
|
-{
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
static int dummycon_font_set(struct vc_data *vc, struct console_font *font,
|
|
|
unsigned int flags)
|
|
|
{
|