diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-11 12:29:30 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-02-15 18:07:38 +0200 |
commit | 2e5d9c9899f6b7bc7cd8ce04496bba5f30508da4 (patch) | |
tree | da6d88d7228b47fa71489232a5a473ec2366db0f | |
parent | fefbffa8f453de002d65a4ac83d0b280acf23a73 (diff) | |
download | illumos-joyent-2e5d9c9899f6b7bc7cd8ce04496bba5f30508da4.tar.gz |
10357 tem: do not restore image areas
Reviewed by: Andy Fiddaman <af@citrus-it.net>
Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/tem.c | 14 | ||||
-rw-r--r-- | usr/src/uts/common/io/tem_safe.c | 12 | ||||
-rw-r--r-- | usr/src/uts/common/sys/tem_impl.h | 1 |
3 files changed, 24 insertions, 3 deletions
diff --git a/usr/src/uts/common/io/tem.c b/usr/src/uts/common/io/tem.c index 630c0fd68c..eeda8f375f 100644 --- a/usr/src/uts/common/io/tem.c +++ b/usr/src/uts/common/io/tem.c @@ -252,7 +252,6 @@ tem_internal_init(struct tem_vt_state *ptem, cred_t *credp, ptem->tvs_screen_rows[i][j].tc_bg_color = bg; ptem->tvs_screen_rows[i][j].tc_char = TEM_ATTR(attr) | ' '; - } } @@ -910,6 +909,19 @@ tem_pix_align(struct tem_vt_state *tem, cred_t *credp, tem->tvs_s_cursor.row = tem->tvs_c_cursor.row = (screen_pos_t)row; tem->tvs_s_cursor.col = tem->tvs_c_cursor.col = 0; + + /* + * When tem is starting up, part of the screen is filled + * with information from boot loader and early boot. + * For tem, the screen content above current cursor + * should be treated as image. + */ + for (; row > 0; row--) { + for (col = 0; col < tems.ts_c_dimension.width; col++) { + tem->tvs_screen_rows[row][col].tc_char = + TEM_ATTR(TEM_ATTR_IMAGE); + } + } } else { tem_safe_reset_display(tem, credp, called_from, B_TRUE, B_TRUE); } diff --git a/usr/src/uts/common/io/tem_safe.c b/usr/src/uts/common/io/tem_safe.c index 51d6ee4ce0..1742716e95 100644 --- a/usr/src/uts/common/io/tem_safe.c +++ b/usr/src/uts/common/io/tem_safe.c @@ -1335,6 +1335,11 @@ tem_copy_width(term_char_t *src, term_char_t *dst, int cols) int width = cols - 1; while (width >= 0) { + /* We can't compare images. */ + if (TEM_CHAR_ATTR(src[width].tc_char) == TEM_ATTR_IMAGE || + TEM_CHAR_ATTR(dst[width].tc_char) == TEM_ATTR_IMAGE) + break; + /* * Find difference on line, compare char with its attributes * and colors. @@ -1588,8 +1593,11 @@ tem_safe_pix_display(struct tem_vt_state *tem, da.col = (col * da.width) + tems.ts_p_offset.x; for (i = 0; i < count; i++) { - tem_safe_callback_bit2pix(tem, string[i]); - tems_safe_display(&da, credp, called_from); + /* Do not display image area */ + if (!TEM_ATTR_ISSET(string[i].tc_char, TEM_ATTR_IMAGE)) { + tem_safe_callback_bit2pix(tem, string[i]); + tems_safe_display(&da, credp, called_from); + } da.col += da.width; } } diff --git a/usr/src/uts/common/sys/tem_impl.h b/usr/src/uts/common/sys/tem_impl.h index d16280e840..eefc965fc0 100644 --- a/usr/src/uts/common/sys/tem_impl.h +++ b/usr/src/uts/common/sys/tem_impl.h @@ -95,6 +95,7 @@ extern "C" { #define TEM_ATTR_BRIGHT_FG 0x0020 #define TEM_ATTR_BRIGHT_BG 0x0040 #define TEM_ATTR_TRANSPARENT 0x0080 +#define TEM_ATTR_IMAGE 0x0100 #define ANSI_COLOR_BLACK 0 #define ANSI_COLOR_RED 1 |