CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/patch/misc/0001-bootsplash.patch
Views: 3959
1
diff --git a/MAINTAINERS b/MAINTAINERS
2
index a74227ad082e..b5633b56391e 100644
3
--- a/MAINTAINERS
4
+++ b/MAINTAINERS
5
@@ -2705,6 +2705,14 @@ S: Supported
6
F: drivers/net/bonding/
7
F: include/uapi/linux/if_bonding.h
8
9
+BOOTSPLASH
10
+M: Max Staudt <[email protected]>
11
+L: [email protected]
12
+S: Maintained
13
+F: drivers/video/fbdev/core/bootsplash*.*
14
+F: drivers/video/fbdev/core/dummycon.c
15
+F: include/linux/bootsplash.h
16
+
17
BPF (Safe dynamic programs and tools)
18
M: Alexei Starovoitov <[email protected]>
19
M: Daniel Borkmann <[email protected]>
20
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
21
index 7f1f1fbcef9e..f3ff976266fe 100644
22
--- a/drivers/video/console/Kconfig
23
+++ b/drivers/video/console/Kconfig
24
@@ -151,6 +151,30 @@ config FRAMEBUFFER_CONSOLE_ROTATION
25
such that other users of the framebuffer will remain normally
26
oriented.
27
28
+config BOOTSPLASH
29
+ bool "Bootup splash screen"
30
+ depends on FRAMEBUFFER_CONSOLE
31
+ ---help---
32
+ This option enables the Linux bootsplash screen.
33
+
34
+ The bootsplash is a full-screen logo or animation indicating a
35
+ booting system. It replaces the classic scrolling text with a
36
+ graphical alternative, similar to other systems.
37
+
38
+ Since this is technically implemented as a hook on top of fbcon,
39
+ it can only work if the FRAMEBUFFER_CONSOLE is enabled and a
40
+ framebuffer driver is active. Thus, to get a text-free boot,
41
+ the system needs to boot with vesafb, efifb, or similar.
42
+
43
+ Once built into the kernel, the bootsplash needs to be enabled
44
+ with bootsplash.enabled=1 and a splash file needs to be supplied.
45
+
46
+ Further documentation can be found in:
47
+ Documentation/fb/bootsplash.txt
48
+
49
+ If unsure, say N.
50
+ This is typically used by distributors and system integrators.
51
+
52
config STI_CONSOLE
53
bool "STI text console"
54
depends on PARISC
55
diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile
56
index 73493bbd7a15..66895321928e 100644
57
--- a/drivers/video/fbdev/core/Makefile
58
+++ b/drivers/video/fbdev/core/Makefile
59
@@ -29,3 +29,6 @@ obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimgblt.o
60
obj-$(CONFIG_FB_SYS_FOPS) += fb_sys_fops.o
61
obj-$(CONFIG_FB_SVGALIB) += svgalib.o
62
obj-$(CONFIG_FB_DDC) += fb_ddc.o
63
+
64
+obj-$(CONFIG_BOOTSPLASH) += bootsplash.o bootsplash_render.o \
65
+ dummyblit.o
66
diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
67
new file mode 100644
68
index 000000000000..e449755af268
69
--- /dev/null
70
+++ b/drivers/video/fbdev/core/bootsplash.c
71
@@ -0,0 +1,294 @@
72
+/*
73
+ * Kernel based bootsplash.
74
+ *
75
+ * (Main file: Glue code, workers, timer, PM, kernel and userland API)
76
+ *
77
+ * Authors:
78
+ * Max Staudt <[email protected]>
79
+ *
80
+ * SPDX-License-Identifier: GPL-2.0
81
+ */
82
+
83
+#define pr_fmt(fmt) "bootsplash: " fmt
84
+
85
+
86
+#include <linux/atomic.h>
87
+#include <linux/bootsplash.h>
88
+#include <linux/console.h>
89
+#include <linux/device.h> /* dev_warn() */
90
+#include <linux/fb.h>
91
+#include <linux/fs.h>
92
+#include <linux/kernel.h>
93
+#include <linux/jiffies.h>
94
+#include <linux/module.h>
95
+#include <linux/mutex.h>
96
+#include <linux/platform_device.h>
97
+#include <linux/printk.h>
98
+#include <linux/selection.h> /* console_blanked */
99
+#include <linux/stringify.h>
100
+#include <linux/types.h>
101
+#include <linux/vmalloc.h>
102
+#include <linux/vt_kern.h>
103
+#include <linux/workqueue.h>
104
+
105
+#include "bootsplash_internal.h"
106
+
107
+
108
+/*
109
+ * We only have one splash screen, so let's keep a single
110
+ * instance of the internal state.
111
+ */
112
+static struct splash_priv splash_state;
113
+
114
+
115
+static void splash_callback_redraw_vc(struct work_struct *ignored)
116
+{
117
+ if (console_blanked)
118
+ return;
119
+
120
+ console_lock();
121
+ if (vc_cons[fg_console].d)
122
+ update_screen(vc_cons[fg_console].d);
123
+ console_unlock();
124
+}
125
+
126
+
127
+static bool is_fb_compatible(const struct fb_info *info)
128
+{
129
+ if (!(info->flags & FBINFO_BE_MATH)
130
+ != !fb_be_math((struct fb_info *)info)) {
131
+ dev_warn(info->device,
132
+ "Can't draw on foreign endianness framebuffer.\n");
133
+
134
+ return false;
135
+ }
136
+
137
+ if (info->flags & FBINFO_MISC_TILEBLITTING) {
138
+ dev_warn(info->device,
139
+ "Can't draw splash on tiling framebuffer.\n");
140
+
141
+ return false;
142
+ }
143
+
144
+ if (info->fix.type != FB_TYPE_PACKED_PIXELS
145
+ || (info->fix.visual != FB_VISUAL_TRUECOLOR
146
+ && info->fix.visual != FB_VISUAL_DIRECTCOLOR)) {
147
+ dev_warn(info->device,
148
+ "Can't draw splash on non-packed or non-truecolor framebuffer.\n");
149
+
150
+ dev_warn(info->device,
151
+ " type: %u visual: %u\n",
152
+ info->fix.type, info->fix.visual);
153
+
154
+ return false;
155
+ }
156
+
157
+ if (info->var.bits_per_pixel != 16
158
+ && info->var.bits_per_pixel != 24
159
+ && info->var.bits_per_pixel != 32) {
160
+ dev_warn(info->device,
161
+ "We only support drawing on framebuffers with 16, 24, or 32 bpp, not %d.\n",
162
+ info->var.bits_per_pixel);
163
+
164
+ return false;
165
+ }
166
+
167
+ return true;
168
+}
169
+
170
+
171
+/*
172
+ * Called by fbcon_switch() when an instance is activated or refreshed.
173
+ */
174
+void bootsplash_render_full(struct fb_info *info)
175
+{
176
+ if (!is_fb_compatible(info))
177
+ return;
178
+
179
+ bootsplash_do_render_background(info);
180
+}
181
+
182
+
183
+/*
184
+ * External status enquiry and on/off switch
185
+ */
186
+bool bootsplash_would_render_now(void)
187
+{
188
+ return !oops_in_progress
189
+ && !console_blanked
190
+ && bootsplash_is_enabled();
191
+}
192
+
193
+bool bootsplash_is_enabled(void)
194
+{
195
+ bool was_enabled;
196
+
197
+ /* Make sure we have the newest state */
198
+ smp_rmb();
199
+
200
+ was_enabled = test_bit(0, &splash_state.enabled);
201
+
202
+ return was_enabled;
203
+}
204
+
205
+void bootsplash_disable(void)
206
+{
207
+ int was_enabled;
208
+
209
+ was_enabled = test_and_clear_bit(0, &splash_state.enabled);
210
+
211
+ if (was_enabled) {
212
+ if (oops_in_progress) {
213
+ /* Redraw screen now so we can see a panic */
214
+ if (vc_cons[fg_console].d)
215
+ update_screen(vc_cons[fg_console].d);
216
+ } else {
217
+ /* No urgency, redraw at next opportunity */
218
+ schedule_work(&splash_state.work_redraw_vc);
219
+ }
220
+ }
221
+}
222
+
223
+void bootsplash_enable(void)
224
+{
225
+ bool was_enabled;
226
+
227
+ if (oops_in_progress)
228
+ return;
229
+
230
+ was_enabled = test_and_set_bit(0, &splash_state.enabled);
231
+
232
+ if (!was_enabled)
233
+ schedule_work(&splash_state.work_redraw_vc);
234
+}
235
+
236
+
237
+/*
238
+ * Userland API via platform device in sysfs
239
+ */
240
+static ssize_t splash_show_enabled(struct device *dev,
241
+ struct device_attribute *attr, char *buf)
242
+{
243
+ return sprintf(buf, "%d\n", bootsplash_is_enabled());
244
+}
245
+
246
+static ssize_t splash_store_enabled(struct device *device,
247
+ struct device_attribute *attr,
248
+ const char *buf, size_t count)
249
+{
250
+ bool enable;
251
+ int err;
252
+
253
+ if (!buf || !count)
254
+ return -EFAULT;
255
+
256
+ err = kstrtobool(buf, &enable);
257
+ if (err)
258
+ return err;
259
+
260
+ if (enable)
261
+ bootsplash_enable();
262
+ else
263
+ bootsplash_disable();
264
+
265
+ return count;
266
+}
267
+
268
+static DEVICE_ATTR(enabled, 0644, splash_show_enabled, splash_store_enabled);
269
+
270
+
271
+static struct attribute *splash_dev_attrs[] = {
272
+ &dev_attr_enabled.attr,
273
+ NULL
274
+};
275
+
276
+ATTRIBUTE_GROUPS(splash_dev);
277
+
278
+
279
+
280
+
281
+/*
282
+ * Power management fixup via platform device
283
+ *
284
+ * When the system is woken from sleep or restored after hibernating, we
285
+ * cannot expect the screen contents to still be present in video RAM.
286
+ * Thus, we have to redraw the splash if we're currently active.
287
+ */
288
+static int splash_resume(struct device *device)
289
+{
290
+ if (bootsplash_would_render_now())
291
+ schedule_work(&splash_state.work_redraw_vc);
292
+
293
+ return 0;
294
+}
295
+
296
+static int splash_suspend(struct device *device)
297
+{
298
+ cancel_work_sync(&splash_state.work_redraw_vc);
299
+
300
+ return 0;
301
+}
302
+
303
+
304
+static const struct dev_pm_ops splash_pm_ops = {
305
+ .thaw = splash_resume,
306
+ .restore = splash_resume,
307
+ .resume = splash_resume,
308
+ .suspend = splash_suspend,
309
+ .freeze = splash_suspend,
310
+};
311
+
312
+static struct platform_driver splash_driver = {
313
+ .driver = {
314
+ .name = "bootsplash",
315
+ .pm = &splash_pm_ops,
316
+ },
317
+};
318
+
319
+
320
+/*
321
+ * Main init
322
+ */
323
+void bootsplash_init(void)
324
+{
325
+ int ret;
326
+
327
+ /* Initialized already? */
328
+ if (splash_state.splash_device)
329
+ return;
330
+
331
+
332
+ /* Register platform device to export user API */
333
+ ret = platform_driver_register(&splash_driver);
334
+ if (ret) {
335
+ pr_err("platform_driver_register() failed: %d\n", ret);
336
+ goto err;
337
+ }
338
+
339
+ splash_state.splash_device
340
+ = platform_device_alloc("bootsplash", 0);
341
+
342
+ if (!splash_state.splash_device)
343
+ goto err_driver;
344
+
345
+ splash_state.splash_device->dev.groups = splash_dev_groups;
346
+
347
+ ret = platform_device_add(splash_state.splash_device);
348
+ if (ret) {
349
+ pr_err("platform_device_add() failed: %d\n", ret);
350
+ goto err_device;
351
+ }
352
+
353
+
354
+ INIT_WORK(&splash_state.work_redraw_vc, splash_callback_redraw_vc);
355
+
356
+ return;
357
+
358
+err_device:
359
+ platform_device_put(splash_state.splash_device);
360
+ splash_state.splash_device = NULL;
361
+err_driver:
362
+ platform_driver_unregister(&splash_driver);
363
+err:
364
+ pr_err("Failed to initialize.\n");
365
+}
366
diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h
367
new file mode 100644
368
index 000000000000..b11da5cb90bf
369
--- /dev/null
370
+++ b/drivers/video/fbdev/core/bootsplash_internal.h
371
@@ -0,0 +1,55 @@
372
+/*
373
+ * Kernel based bootsplash.
374
+ *
375
+ * (Internal data structures used at runtime)
376
+ *
377
+ * Authors:
378
+ * Max Staudt <[email protected]>
379
+ *
380
+ * SPDX-License-Identifier: GPL-2.0
381
+ */
382
+
383
+#ifndef __BOOTSPLASH_INTERNAL_H
384
+#define __BOOTSPLASH_INTERNAL_H
385
+
386
+
387
+#include <linux/types.h>
388
+#include <linux/fb.h>
389
+#include <linux/kernel.h>
390
+#include <linux/mutex.h>
391
+#include <linux/spinlock.h>
392
+
393
+
394
+/*
395
+ * Runtime types
396
+ */
397
+struct splash_priv {
398
+ /*
399
+ * Enabled/disabled state, to be used with atomic bit operations.
400
+ * Bit 0: 0 = Splash hidden
401
+ * 1 = Splash shown
402
+ *
403
+ * Note: fbcon.c uses this twice, by calling
404
+ * bootsplash_would_render_now() in set_blitting_type() and
405
+ * in fbcon_switch().
406
+ * This is racy, but eventually consistent: Turning the
407
+ * splash on/off will cause a redraw, which calls
408
+ * fbcon_switch(), which calls set_blitting_type().
409
+ * So the last on/off toggle will make things consistent.
410
+ */
411
+ unsigned long enabled;
412
+
413
+ /* Our gateway to userland via sysfs */
414
+ struct platform_device *splash_device;
415
+
416
+ struct work_struct work_redraw_vc;
417
+};
418
+
419
+
420
+
421
+/*
422
+ * Rendering functions
423
+ */
424
+void bootsplash_do_render_background(struct fb_info *info);
425
+
426
+#endif
427
diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
428
new file mode 100644
429
index 000000000000..4d7e0117f653
430
--- /dev/null
431
+++ b/drivers/video/fbdev/core/bootsplash_render.c
432
@@ -0,0 +1,93 @@
433
+/*
434
+ * Kernel based bootsplash.
435
+ *
436
+ * (Rendering functions)
437
+ *
438
+ * Authors:
439
+ * Max Staudt <[email protected]>
440
+ *
441
+ * SPDX-License-Identifier: GPL-2.0
442
+ */
443
+
444
+#define pr_fmt(fmt) "bootsplash: " fmt
445
+
446
+
447
+#include <linux/bootsplash.h>
448
+#include <linux/fb.h>
449
+#include <linux/kernel.h>
450
+#include <linux/printk.h>
451
+#include <linux/types.h>
452
+
453
+#include "bootsplash_internal.h"
454
+
455
+
456
+
457
+
458
+/*
459
+ * Rendering: Internal drawing routines
460
+ */
461
+
462
+
463
+/*
464
+ * Pack pixel into target format and do Big/Little Endian handling.
465
+ * This would be a good place to handle endianness conversion if necessary.
466
+ */
467
+static inline u32 pack_pixel(const struct fb_var_screeninfo *dst_var,
468
+ u8 red, u8 green, u8 blue)
469
+{
470
+ u32 dstpix;
471
+
472
+ /* Quantize pixel */
473
+ red = red >> (8 - dst_var->red.length);
474
+ green = green >> (8 - dst_var->green.length);
475
+ blue = blue >> (8 - dst_var->blue.length);
476
+
477
+ /* Pack pixel */
478
+ dstpix = red << (dst_var->red.offset)
479
+ | green << (dst_var->green.offset)
480
+ | blue << (dst_var->blue.offset);
481
+
482
+ /*
483
+ * Move packed pixel to the beginning of the memory cell,
484
+ * so we can memcpy() it out easily
485
+ */
486
+#ifdef __BIG_ENDIAN
487
+ switch (dst_var->bits_per_pixel) {
488
+ case 16:
489
+ dstpix <<= 16;
490
+ break;
491
+ case 24:
492
+ dstpix <<= 8;
493
+ break;
494
+ case 32:
495
+ break;
496
+ }
497
+#else
498
+ /* This is intrinsically unnecessary on Little Endian */
499
+#endif
500
+
501
+ return dstpix;
502
+}
503
+
504
+
505
+void bootsplash_do_render_background(struct fb_info *info)
506
+{
507
+ unsigned int x, y;
508
+ u32 dstpix;
509
+ u32 dst_octpp = info->var.bits_per_pixel / 8;
510
+
511
+ dstpix = pack_pixel(&info->var,
512
+ 0,
513
+ 0,
514
+ 0);
515
+
516
+ for (y = 0; y < info->var.yres_virtual; y++) {
517
+ u8 *dstline = info->screen_buffer + (y * info->fix.line_length);
518
+
519
+ for (x = 0; x < info->var.xres_virtual; x++) {
520
+ memcpy(dstline, &dstpix, dst_octpp);
521
+
522
+ dstline += dst_octpp;
523
+ }
524
+ }
525
+}
526
diff --git a/drivers/video/fbdev/core/dummyblit.c b/drivers/video/fbdev/core/dummyblit.c
527
new file mode 100644
528
index 000000000000..8c22ff92ce24
529
--- /dev/null
530
+++ b/drivers/video/fbdev/core/dummyblit.c
531
@@ -0,0 +1,89 @@
532
+/*
533
+ * linux/drivers/video/fbdev/core/dummyblit.c -- Dummy Blitting Operation
534
+ *
535
+ * Authors:
536
+ * Max Staudt <[email protected]>
537
+ *
538
+ * These functions are used in place of blitblit/tileblit to suppress
539
+ * fbcon's text output while a splash is shown.
540
+ *
541
+ * Only suppressing actual rendering keeps the text buffer in the VC layer
542
+ * intact and makes it easy to switch back from the bootsplash to a full
543
+ * text console with a simple redraw (with the original functions in place).
544
+ *
545
+ * Based on linux/drivers/video/fbdev/core/bitblit.c
546
+ * and linux/drivers/video/fbdev/core/tileblit.c
547
+ *
548
+ * SPDX-License-Identifier: GPL-2.0
549
+ */
550
+
551
+#include <linux/module.h>
552
+#include <linux/fb.h>
553
+#include <linux/vt_kern.h>
554
+#include <linux/console.h>
555
+#include <asm/types.h>
556
+#include "fbcon.h"
557
+
558
+static void dummy_bmove(struct vc_data *vc, struct fb_info *info, int sy,
559
+ int sx, int dy, int dx, int height, int width)
560
+{
561
+ ;
562
+}
563
+
564
+static void dummy_clear(struct vc_data *vc, struct fb_info *info, int sy,
565
+ int sx, int height, int width)
566
+{
567
+ ;
568
+}
569
+
570
+static void dummy_putcs(struct vc_data *vc, struct fb_info *info,
571
+ const unsigned short *s, int count, int yy, int xx,
572
+ int fg, int bg)
573
+{
574
+ ;
575
+}
576
+
577
+static void dummy_clear_margins(struct vc_data *vc, struct fb_info *info,
578
+ int color, int bottom_only)
579
+{
580
+ ;
581
+}
582
+
583
+static void dummy_cursor(struct vc_data *vc, struct fb_info *info, int mode,
584
+ int softback_lines, int fg, int bg)
585
+{
586
+ ;
587
+}
588
+
589
+static int dummy_update_start(struct fb_info *info)
590
+{
591
+ /*
592
+ * Copied from bitblit.c and tileblit.c
593
+ *
594
+ * As of Linux 4.12, nobody seems to care about our return value.
595
+ */
596
+ struct fbcon_ops *ops = info->fbcon_par;
597
+ int err;
598
+
599
+ err = fb_pan_display(info, &ops->var);
600
+ ops->var.xoffset = info->var.xoffset;
601
+ ops->var.yoffset = info->var.yoffset;
602
+ ops->var.vmode = info->var.vmode;
603
+ return err;
604
+}
605
+
606
+void fbcon_set_dummyops(struct fbcon_ops *ops)
607
+{
608
+ ops->bmove = dummy_bmove;
609
+ ops->clear = dummy_clear;
610
+ ops->putcs = dummy_putcs;
611
+ ops->clear_margins = dummy_clear_margins;
612
+ ops->cursor = dummy_cursor;
613
+ ops->update_start = dummy_update_start;
614
+ ops->rotate_font = NULL;
615
+}
616
+EXPORT_SYMBOL_GPL(fbcon_set_dummyops);
617
+
618
+MODULE_AUTHOR("Max Staudt <[email protected]>");
619
+MODULE_DESCRIPTION("Dummy Blitting Operation");
620
+MODULE_LICENSE("GPL");
621
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
622
index 04612f938bab..9a39a6fcfe98 100644
623
--- a/drivers/video/fbdev/core/fbcon.c
624
+++ b/drivers/video/fbdev/core/fbcon.c
625
@@ -80,6 +80,7 @@
626
#include <asm/irq.h>
627
628
#include "fbcon.h"
629
+#include <linux/bootsplash.h>
630
631
#ifdef FBCONDEBUG
632
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
633
@@ -542,6 +543,8 @@ static int do_fbcon_takeover(int show_logo)
634
for (i = first_fb_vc; i <= last_fb_vc; i++)
635
con2fb_map[i] = info_idx;
636
637
+ bootsplash_init();
638
+
639
err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
640
fbcon_is_default);
641
642
@@ -661,6 +664,9 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
643
else {
644
fbcon_set_rotation(info);
645
fbcon_set_bitops(ops);
646
+
647
+ if (bootsplash_would_render_now())
648
+ fbcon_set_dummyops(ops);
649
}
650
}
651
652
@@ -683,6 +689,19 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
653
ops->p = &fb_display[vc->vc_num];
654
fbcon_set_rotation(info);
655
fbcon_set_bitops(ops);
656
+
657
+ /*
658
+ * Note:
659
+ * This is *eventually correct*.
660
+ * Setting the fbcon operations and drawing the splash happen at
661
+ * different points in time. If the splash is enabled/disabled
662
+ * in between, then bootsplash_{en,dis}able will schedule a
663
+ * redraw, which will again render the splash (or not) and set
664
+ * the correct fbcon ops.
665
+ * The last run will then be the right one.
666
+ */
667
+ if (bootsplash_would_render_now())
668
+ fbcon_set_dummyops(ops);
669
}
670
671
static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcount)
672
@@ -2184,6 +2203,9 @@ static int fbcon_switch(struct vc_data *vc)
673
info = registered_fb[con2fb_map[vc->vc_num]];
674
ops = info->fbcon_par;
675
676
+ if (bootsplash_would_render_now())
677
+ bootsplash_render_full(info);
678
+
679
if (softback_top) {
680
if (softback_lines)
681
fbcon_set_origin(vc);
682
diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
683
index 18f3ac144237..45f94347fe5e 100644
684
--- a/drivers/video/fbdev/core/fbcon.h
685
+++ b/drivers/video/fbdev/core/fbcon.h
686
@@ -214,6 +214,11 @@ static inline int attr_col_ec(int shift, struct vc_data *vc,
687
#define SCROLL_REDRAW 0x004
688
#define SCROLL_PAN_REDRAW 0x005
689
690
+#ifdef CONFIG_BOOTSPLASH
691
+extern void fbcon_set_dummyops(struct fbcon_ops *ops);
692
+#else /* CONFIG_BOOTSPLASH */
693
+#define fbcon_set_dummyops(x)
694
+#endif /* CONFIG_BOOTSPLASH */
695
#ifdef CONFIG_FB_TILEBLITTING
696
extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
697
#endif
698
diff --git a/include/linux/bootsplash.h b/include/linux/bootsplash.h
699
new file mode 100644
700
index 000000000000..c6dd0b43180d
701
--- /dev/null
702
+++ b/include/linux/bootsplash.h
703
@@ -0,0 +1,43 @@
704
+/*
705
+ * Kernel based bootsplash.
706
+ *
707
+ * Authors:
708
+ * Max Staudt <[email protected]>
709
+ *
710
+ * SPDX-License-Identifier: GPL-2.0
711
+ */
712
+
713
+#ifndef __LINUX_BOOTSPLASH_H
714
+#define __LINUX_BOOTSPLASH_H
715
+
716
+#include <linux/fb.h>
717
+
718
+
719
+#ifdef CONFIG_BOOTSPLASH
720
+
721
+extern void bootsplash_render_full(struct fb_info *info);
722
+
723
+extern bool bootsplash_would_render_now(void);
724
+
725
+extern bool bootsplash_is_enabled(void);
726
+extern void bootsplash_disable(void);
727
+extern void bootsplash_enable(void);
728
+
729
+extern void bootsplash_init(void);
730
+
731
+#else /* CONFIG_BOOTSPLASH */
732
+
733
+#define bootsplash_render_full(x)
734
+
735
+#define bootsplash_would_render_now() (false)
736
+
737
+#define bootsplash_is_enabled() (false)
738
+#define bootsplash_disable()
739
+#define bootsplash_enable()
740
+
741
+#define bootsplash_init()
742
+
743
+#endif /* CONFIG_BOOTSPLASH */
744
+
745
+
746
+#endif
747
748