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/0003-bootsplash.patch
Views: 3959
1
diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
2
index 843c5400fefc..815b007f81ca 100644
3
--- a/drivers/video/fbdev/core/bootsplash.c
4
+++ b/drivers/video/fbdev/core/bootsplash.c
5
@@ -112,6 +112,8 @@ void bootsplash_render_full(struct fb_info *info)
6
7
bootsplash_do_render_pictures(info, splash_state.file);
8
9
+ bootsplash_do_render_flush(info);
10
+
11
out:
12
mutex_unlock(&splash_state.data_lock);
13
}
14
diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h
15
index 71e2a27ac0b8..0acb383aa4e3 100644
16
--- a/drivers/video/fbdev/core/bootsplash_internal.h
17
+++ b/drivers/video/fbdev/core/bootsplash_internal.h
18
@@ -89,6 +89,7 @@ void bootsplash_do_render_background(struct fb_info *info,
19
const struct splash_file_priv *fp);
20
void bootsplash_do_render_pictures(struct fb_info *info,
21
const struct splash_file_priv *fp);
22
+void bootsplash_do_render_flush(struct fb_info *info);
23
24
25
void bootsplash_free_file(struct splash_file_priv *fp);
26
diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
27
index 2ae36949d0e3..8c09c306ff67 100644
28
--- a/drivers/video/fbdev/core/bootsplash_render.c
29
+++ b/drivers/video/fbdev/core/bootsplash_render.c
30
@@ -186,3 +186,36 @@ void bootsplash_do_render_pictures(struct fb_info *info,
31
pp->pic_header->width, pp->pic_header->height);
32
}
33
}
34
+
35
+
36
+void bootsplash_do_render_flush(struct fb_info *info)
37
+{
38
+ /*
39
+ * FB drivers using deferred_io (such as Xen) need to sync the
40
+ * screen after modifying its contents. When the FB is mmap()ed
41
+ * from userspace, this happens via a dirty pages callback, but
42
+ * when modifying the FB from the kernel, there is no such thing.
43
+ *
44
+ * So let's issue a fake fb_copyarea (copying the FB onto itself)
45
+ * to trick the FB driver into syncing the screen.
46
+ *
47
+ * A few DRM drivers' FB implementations are broken by not using
48
+ * deferred_io when they really should - we match on the known
49
+ * bad ones manually for now.
50
+ */
51
+ if (info->fbdefio
52
+ || !strcmp(info->fix.id, "astdrmfb")
53
+ || !strcmp(info->fix.id, "cirrusdrmfb")
54
+ || !strcmp(info->fix.id, "mgadrmfb")) {
55
+ struct fb_copyarea area;
56
+
57
+ area.dx = 0;
58
+ area.dy = 0;
59
+ area.width = info->var.xres;
60
+ area.height = info->var.yres;
61
+ area.sx = 0;
62
+ area.sy = 0;
63
+
64
+ info->fbops->fb_copyarea(info, &area);
65
+ }
66
+}
67
68