From d50863a3386bcb8b803fae99c4a1ef2fb668b618 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 5 May 2021 23:16:59 +0300 Subject: 13791 loader: gfx_fb_drawrect should use GfxFbBltVideoFill Reviewed by: Yuri Pankov Approved by: Robert Mustacchi --- usr/src/boot/Makefile.version | 2 +- usr/src/boot/sys/boot/common/gfx_fb.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 30c6982235..e8dcc2dd0b 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -34,4 +34,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2021.05.12.1 +BOOT_VERSION = $(LOADER_VERSION)-2021.05.16.1 diff --git a/usr/src/boot/sys/boot/common/gfx_fb.c b/usr/src/boot/sys/boot/common/gfx_fb.c index 09875a85f1..1e54a73630 100644 --- a/usr/src/boot/sys/boot/common/gfx_fb.c +++ b/usr/src/boot/sys/boot/common/gfx_fb.c @@ -1233,25 +1233,28 @@ gfx_fb_setpixel(uint32_t x, uint32_t y) /* * draw rectangle in framebuffer using gfx coordinates. - * The function is borrowed from fbsd vt_fb.c */ void gfx_fb_drawrect(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t fill) { - uint32_t x, y; + uint32_t c; + text_color_t fg, bg; if (plat_stdout_is_framebuffer() == 0) return; - for (y = y1; y <= y2; y++) { - if (fill || (y == y1) || (y == y2)) { - for (x = x1; x <= x2; x++) - gfx_fb_setpixel(x, y); - } else { - gfx_fb_setpixel(x1, y); - gfx_fb_setpixel(x2, y); - } + tem_get_colors((tem_vt_state_t)tems.ts_active, &fg, &bg); + c = gfx_fb_color_map(fg); + + if (fill != 0) { + gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, x2 - x1, + y2 - y1, 0); + } else { + gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, x2 - x1, 1, 0); + gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y2, x2 - x1, 1, 0); + gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, 1, y2 - y1, 0); + gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x2, y1, 1, y2 - y1, 0); } } -- cgit v1.2.3