diff options
Diffstat (limited to '0010-bootsplash.patch')
-rw-r--r--[-rwxr-xr-x] | 0010-bootsplash.patch | 279 |
1 files changed, 73 insertions, 206 deletions
diff --git a/0010-bootsplash.patch b/0010-bootsplash.patch index 7eb54aff7e00..d6c6db659c56 100755..100644 --- a/0010-bootsplash.patch +++ b/0010-bootsplash.patch @@ -1,215 +1,82 @@ -diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c -index 8c09c306ff67..07e3a4eab811 100644 ---- a/drivers/video/fbdev/core/bootsplash_render.c -+++ b/drivers/video/fbdev/core/bootsplash_render.c -@@ -155,6 +155,7 @@ void bootsplash_do_render_pictures(struct fb_info *info, - for (i = 0; i < fp->header->num_pics; i++) { - struct splash_blob_priv *bp; - struct splash_pic_priv *pp = &fp->pics[i]; -+ const struct splash_pic_header *ph = pp->pic_header; - long dst_xoff, dst_yoff; +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c +index 2ebaba16f785..416735ab6dc1 100644 +--- a/drivers/tty/vt/vt.c ++++ b/drivers/tty/vt/vt.c +@@ -105,6 +105,7 @@ + #include <linux/ctype.h> + #include <linux/bsearch.h> + #include <linux/gcd.h> ++#include <linux/bootsplash.h> - if (pp->blobs_loaded < 1) -@@ -165,8 +166,139 @@ void bootsplash_do_render_pictures(struct fb_info *info, - if (!bp || bp->blob_header->type != 0) - continue; + #define MAX_NR_CON_DRIVER 16 -- dst_xoff = (info->var.xres - pp->pic_header->width) / 2; -- dst_yoff = (info->var.yres - pp->pic_header->height) / 2; -+ switch (ph->position) { -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP_LEFT: -+ dst_xoff = 0; -+ dst_yoff = 0; -+ -+ dst_xoff += ph->position_offset; -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = 0; -+ -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_yoff = 0; -+ -+ dst_xoff -= ph->position_offset; -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff -= ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ -+ dst_xoff -= ph->position_offset; -+ dst_yoff -= ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ -+ dst_yoff -= ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM_LEFT: -+ dst_xoff = 0 + ph->position_offset; -+ dst_yoff = info->var.yres - pp->pic_header->height -+ - ph->position_offset; -+ break; -+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_LEFT: -+ dst_xoff = 0; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff += ph->position_offset; -+ break; -+ -+ case SPLASH_CORNER_TOP_LEFT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff -= ph->position_offset; -+ dst_yoff -= ph->position_offset; -+ break; -+ case SPLASH_CORNER_TOP: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_yoff -= ph->position_offset; -+ break; -+ case SPLASH_CORNER_TOP_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff += ph->position_offset; -+ dst_yoff -= ph->position_offset; -+ break; -+ case SPLASH_CORNER_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff += ph->position_offset; -+ break; -+ case SPLASH_CORNER_BOTTOM_RIGHT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff += ph->position_offset; -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_CORNER_BOTTOM: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_CORNER_BOTTOM_LEFT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff -= ph->position_offset; -+ dst_yoff += ph->position_offset; -+ break; -+ case SPLASH_CORNER_LEFT: -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ -+ dst_xoff -= ph->position_offset; -+ break; -+ -+ default: -+ /* As a fallback, center the picture. */ -+ dst_xoff = info->var.xres - pp->pic_header->width; -+ dst_xoff /= 2; -+ dst_yoff = info->var.yres - pp->pic_header->height; -+ dst_yoff /= 2; -+ break; -+ } +@@ -4235,6 +4236,7 @@ void do_unblank_screen(int leaving_gfx) + } - if (dst_xoff < 0 - || dst_yoff < 0 -diff --git a/include/uapi/linux/bootsplash_file.h b/include/uapi/linux/bootsplash_file.h -index 89dc9cca8f0c..71cedcc68933 100644 ---- a/include/uapi/linux/bootsplash_file.h -+++ b/include/uapi/linux/bootsplash_file.h -@@ -91,7 +91,32 @@ struct splash_pic_header { - */ - uint8_t num_blobs; + console_blanked = 0; ++ bootsplash_mark_dirty(); + if (vc->vc_sw->con_blank(vc, 0, leaving_gfx)) + /* Low-level driver cannot restore -> do it ourselves */ + update_screen(vc); +diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c +index c8642142cfea..13fcaabbc2ca 100644 +--- a/drivers/video/fbdev/core/bootsplash.c ++++ b/drivers/video/fbdev/core/bootsplash.c +@@ -165,6 +165,13 @@ bool bootsplash_would_render_now(void) + && bootsplash_is_enabled(); + } -- uint8_t padding[27]; -+ /* -+ * Corner to move the picture to / from. -+ * 0x00 - Top left -+ * 0x01 - Top -+ * 0x02 - Top right -+ * 0x03 - Right -+ * 0x04 - Bottom right -+ * 0x05 - Bottom -+ * 0x06 - Bottom left -+ * 0x07 - Left -+ * -+ * Flags: -+ * 0x10 - Calculate offset from the corner towards the center, -+ * rather than from the center towards the corner -+ */ -+ uint8_t position; -+ -+ /* -+ * Pixel offset from the selected position. -+ * Example: If the picture is in the top right corner, it will -+ * be placed position_offset pixels from the top and -+ * position_offset pixels from the right margin. -+ */ -+ uint16_t position_offset; -+ -+ uint8_t padding[24]; - } __attribute__((__packed__)); ++void bootsplash_mark_dirty(void) ++{ ++ mutex_lock(&splash_state.data_lock); ++ splash_state.splash_fb = NULL; ++ mutex_unlock(&splash_state.data_lock); ++} ++ + bool bootsplash_is_enabled(void) + { + bool was_enabled; +@@ -206,9 +213,7 @@ void bootsplash_enable(void) + if (!was_enabled) { + /* Force a full redraw when the splash is re-activated */ +- mutex_lock(&splash_state.data_lock); +- splash_state.splash_fb = NULL; +- mutex_unlock(&splash_state.data_lock); ++ bootsplash_mark_dirty(); -@@ -115,4 +140,22 @@ struct splash_blob_header { - uint8_t padding[9]; - } __attribute__((__packed__)); + schedule_work(&splash_state.work_redraw_vc); + } +@@ -272,9 +277,7 @@ static int splash_resume(struct device *device) + * Force full redraw on resume since we've probably lost the + * framebuffer's contents meanwhile + */ +- mutex_lock(&splash_state.data_lock); +- splash_state.splash_fb = NULL; +- mutex_unlock(&splash_state.data_lock); ++ bootsplash_mark_dirty(); + if (bootsplash_would_render_now()) + schedule_work(&splash_state.work_redraw_vc); +diff --git a/include/linux/bootsplash.h b/include/linux/bootsplash.h +index c6dd0b43180d..4075098aaadd 100644 +--- a/include/linux/bootsplash.h ++++ b/include/linux/bootsplash.h +@@ -19,6 +19,8 @@ extern void bootsplash_render_full(struct fb_info *info); + + extern bool bootsplash_would_render_now(void); + ++extern void bootsplash_mark_dirty(void); + + extern bool bootsplash_is_enabled(void); + extern void bootsplash_disable(void); + extern void bootsplash_enable(void); +@@ -31,6 +33,8 @@ extern void bootsplash_init(void); + + #define bootsplash_would_render_now() (false) + ++#define bootsplash_mark_dirty() + -+ -+/* -+ * Enums for on-disk types -+ */ -+enum splash_position { -+ SPLASH_CORNER_TOP_LEFT = 0, -+ SPLASH_CORNER_TOP = 1, -+ SPLASH_CORNER_TOP_RIGHT = 2, -+ SPLASH_CORNER_RIGHT = 3, -+ SPLASH_CORNER_BOTTOM_RIGHT = 4, -+ SPLASH_CORNER_BOTTOM = 5, -+ SPLASH_CORNER_BOTTOM_LEFT = 6, -+ SPLASH_CORNER_LEFT = 7, -+ SPLASH_POS_FLAG_CORNER = 0x10, -+}; -+ - #endif + #define bootsplash_is_enabled() (false) + #define bootsplash_disable() + #define bootsplash_enable() |