Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/patch/misc/0003-bootsplash.patch
Views: 3959
diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c1index 843c5400fefc..815b007f81ca 1006442--- a/drivers/video/fbdev/core/bootsplash.c3+++ b/drivers/video/fbdev/core/bootsplash.c4@@ -112,6 +112,8 @@ void bootsplash_render_full(struct fb_info *info)56bootsplash_do_render_pictures(info, splash_state.file);78+ bootsplash_do_render_flush(info);9+10out:11mutex_unlock(&splash_state.data_lock);12}13diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h14index 71e2a27ac0b8..0acb383aa4e3 10064415--- a/drivers/video/fbdev/core/bootsplash_internal.h16+++ b/drivers/video/fbdev/core/bootsplash_internal.h17@@ -89,6 +89,7 @@ void bootsplash_do_render_background(struct fb_info *info,18const struct splash_file_priv *fp);19void bootsplash_do_render_pictures(struct fb_info *info,20const struct splash_file_priv *fp);21+void bootsplash_do_render_flush(struct fb_info *info);222324void bootsplash_free_file(struct splash_file_priv *fp);25diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c26index 2ae36949d0e3..8c09c306ff67 10064427--- a/drivers/video/fbdev/core/bootsplash_render.c28+++ b/drivers/video/fbdev/core/bootsplash_render.c29@@ -186,3 +186,36 @@ void bootsplash_do_render_pictures(struct fb_info *info,30pp->pic_header->width, pp->pic_header->height);31}32}33+34+35+void bootsplash_do_render_flush(struct fb_info *info)36+{37+ /*38+ * FB drivers using deferred_io (such as Xen) need to sync the39+ * screen after modifying its contents. When the FB is mmap()ed40+ * from userspace, this happens via a dirty pages callback, but41+ * when modifying the FB from the kernel, there is no such thing.42+ *43+ * So let's issue a fake fb_copyarea (copying the FB onto itself)44+ * to trick the FB driver into syncing the screen.45+ *46+ * A few DRM drivers' FB implementations are broken by not using47+ * deferred_io when they really should - we match on the known48+ * bad ones manually for now.49+ */50+ if (info->fbdefio51+ || !strcmp(info->fix.id, "astdrmfb")52+ || !strcmp(info->fix.id, "cirrusdrmfb")53+ || !strcmp(info->fix.id, "mgadrmfb")) {54+ struct fb_copyarea area;55+56+ area.dx = 0;57+ area.dy = 0;58+ area.width = info->var.xres;59+ area.height = info->var.yres;60+ area.sx = 0;61+ area.sy = 0;62+63+ info->fbops->fb_copyarea(info, &area);64+ }65+}666768