From 2e5d9c9899f6b7bc7cd8ce04496bba5f30508da4 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 11 Jan 2019 12:29:30 +0200 Subject: 10357 tem: do not restore image areas Reviewed by: Andy Fiddaman Approved by: Robert Mustacchi --- usr/src/uts/common/io/tem.c | 14 +++++++++++++- usr/src/uts/common/io/tem_safe.c | 12 ++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'usr/src/uts/common/io') 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; } } -- cgit v1.2.3