Skip to content

Commit b93fdf5

Browse files
committed
video: bmp: Clamp position to axis end with BMP_ALIGN_END
Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
1 parent 05aa651 commit b93fdf5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/video/video_bmp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
305305
video_splash_align_axis(&y, priv->ysize, height);
306306
}
307307

308+
if (x == BMP_ALIGN_END)
309+
x = pwidth - width;
310+
if (y == BMP_ALIGN_END)
311+
y = priv->ysize - height;
312+
308313
if ((x + width) > pwidth)
309314
width = pwidth - x;
310315
if ((y + height) > priv->ysize)

include/splash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ void splash_get_pos(int *x, int *y);
6464
int splash_display(void);
6565

6666
#define BMP_ALIGN_CENTER 0x7FFF
67+
#define BMP_ALIGN_END 0x7FFE
6768

6869
#endif

0 commit comments

Comments
 (0)