aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2018-12-20 13:13:07 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-12-20 13:13:07 -0500
commitf75df8d4b4fabfad7e3cba2debfad12741c6fde7 (patch)
tree83873c05c5625bac04bdb8326d55f07e1c0b58ed /drivers/video/fbdev
parentfdac751355cd76e049f628afe6acb8ff4b1399f7 (diff)
fbdev: fbmem: behave better with small rotated displays and many CPUs
Blitting an image with "negative" offsets is not working since there is no clipping. It hopefully just crashes. For the bootup logo, there is protection so that blitting does not happen as the image is drawn further and further to the right (ROTATE_UR) or further and further down (ROTATE_CW). There is however no protection when drawing in the opposite directions (ROTATE_UD and ROTATE_CCW). Add back this protection. The regression is 20-odd years old but the mindless warning-killing mentality displayed in commit 34bdb666f4b2 ("fbdev: fbmem: remove positive test on unsigned values") is also to blame, methinks. Fixes: 448d479747b8 ("fbdev: fb_do_show_logo() updates") Signed-off-by: Peter Rosin <peda@axentia.se> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Fabian Frederick <ffrederick@users.sourceforge.net> Cc: Geert Uytterhoeven <geert+renesas@glider.be> cc: Geoff Levand <geoff@infradead.org> Cc: James Simmons <jsimmons@users.sf.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/core/fbmem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 861bf8081619..7dd6924feaa8 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -436,7 +436,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
436 image->dx += image->width + 8; 436 image->dx += image->width + 8;
437 } 437 }
438 } else if (rotate == FB_ROTATE_UD) { 438 } else if (rotate == FB_ROTATE_UD) {
439 for (x = 0; x < num; x++) { 439 u32 dx = image->dx;
440
441 for (x = 0; x < num && image->dx <= dx; x++) {
440 info->fbops->fb_imageblit(info, image); 442 info->fbops->fb_imageblit(info, image);
441 image->dx -= image->width + 8; 443 image->dx -= image->width + 8;
442 } 444 }
@@ -448,7 +450,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
448 image->dy += image->height + 8; 450 image->dy += image->height + 8;
449 } 451 }
450 } else if (rotate == FB_ROTATE_CCW) { 452 } else if (rotate == FB_ROTATE_CCW) {
451 for (x = 0; x < num; x++) { 453 u32 dy = image->dy;
454
455 for (x = 0; x < num && image->dy <= dy; x++) {
452 info->fbops->fb_imageblit(info, image); 456 info->fbops->fb_imageblit(info, image);
453 image->dy -= image->height + 8; 457 image->dy -= image->height + 8;
454 } 458 }