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/0006-bootsplash.patch
Views: 3959
1
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
2
index 2ebaba16f785..416735ab6dc1 100644
3
--- a/drivers/tty/vt/vt.c
4
+++ b/drivers/tty/vt/vt.c
5
@@ -105,6 +105,7 @@
6
#include <linux/ctype.h>
7
#include <linux/bsearch.h>
8
#include <linux/gcd.h>
9
+#include <linux/bootsplash.h>
10
11
#define MAX_NR_CON_DRIVER 16
12
13
@@ -4235,6 +4236,7 @@ void do_unblank_screen(int leaving_gfx)
14
}
15
16
console_blanked = 0;
17
+ bootsplash_mark_dirty();
18
if (vc->vc_sw->con_blank(vc, 0, leaving_gfx))
19
/* Low-level driver cannot restore -> do it ourselves */
20
update_screen(vc);
21
diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
22
index c8642142cfea..13fcaabbc2ca 100644
23
--- a/drivers/video/fbdev/core/bootsplash.c
24
+++ b/drivers/video/fbdev/core/bootsplash.c
25
@@ -165,6 +165,13 @@ bool bootsplash_would_render_now(void)
26
&& bootsplash_is_enabled();
27
}
28
29
+void bootsplash_mark_dirty(void)
30
+{
31
+ mutex_lock(&splash_state.data_lock);
32
+ splash_state.splash_fb = NULL;
33
+ mutex_unlock(&splash_state.data_lock);
34
+}
35
+
36
bool bootsplash_is_enabled(void)
37
{
38
bool was_enabled;
39
@@ -206,9 +213,7 @@ void bootsplash_enable(void)
40
41
if (!was_enabled) {
42
/* Force a full redraw when the splash is re-activated */
43
- mutex_lock(&splash_state.data_lock);
44
- splash_state.splash_fb = NULL;
45
- mutex_unlock(&splash_state.data_lock);
46
+ bootsplash_mark_dirty();
47
48
schedule_work(&splash_state.work_redraw_vc);
49
}
50
@@ -272,9 +277,7 @@ static int splash_resume(struct device *device)
51
* Force full redraw on resume since we've probably lost the
52
* framebuffer's contents meanwhile
53
*/
54
- mutex_lock(&splash_state.data_lock);
55
- splash_state.splash_fb = NULL;
56
- mutex_unlock(&splash_state.data_lock);
57
+ bootsplash_mark_dirty();
58
59
if (bootsplash_would_render_now())
60
schedule_work(&splash_state.work_redraw_vc);
61
diff --git a/include/linux/bootsplash.h b/include/linux/bootsplash.h
62
index c6dd0b43180d..4075098aaadd 100644
63
--- a/include/linux/bootsplash.h
64
+++ b/include/linux/bootsplash.h
65
@@ -19,6 +19,8 @@ extern void bootsplash_render_full(struct fb_info *info);
66
67
extern bool bootsplash_would_render_now(void);
68
69
+extern void bootsplash_mark_dirty(void);
70
+
71
extern bool bootsplash_is_enabled(void);
72
extern void bootsplash_disable(void);
73
extern void bootsplash_enable(void);
74
@@ -31,6 +33,8 @@ extern void bootsplash_init(void);
75
76
#define bootsplash_would_render_now() (false)
77
78
+#define bootsplash_mark_dirty()
79
+
80
#define bootsplash_is_enabled() (false)
81
#define bootsplash_disable()
82
#define bootsplash_enable()
83
84