Merge 4.7-rc6 into tty-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2016 15:17:08 +0000 (08:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2016 15:17:08 +0000 (08:17 -0700)
We want the tty/serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1  2 
MAINTAINERS
drivers/tty/vt/vt.c

diff --combined MAINTAINERS
index 51447a517095bed6d63905207d4056338287a01f,1209323b7e43f372b65d0b1db48c0cfc0f6a9973..8beb8c98f72bf2514a542164eeecd663c718b812
@@@ -595,6 -595,10 +595,10 @@@ S:       Odd Fixe
  L:    linux-alpha@vger.kernel.org
  F:    arch/alpha/
  
+ ALPS PS/2 TOUCHPAD DRIVER
+ R:    Pali Rohár <pali.rohar@gmail.com>
+ F:    drivers/input/mouse/alps.*
  ALTERA MAILBOX DRIVER
  M:    Ley Foon Tan <lftan@altera.com>
  L:    nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
@@@ -2776,9 -2780,9 +2780,9 @@@ F:      include/net/caif
  F:    net/caif/
  
  CALGARY x86-64 IOMMU
- M:    Muli Ben-Yehuda <muli@il.ibm.com>
- M:    "Jon D. Mason" <jdmason@kudzu.us>
- L:    discuss@x86-64.org
+ M:    Muli Ben-Yehuda <mulix@mulix.org>
+ M:    Jon Mason <jdmason@kudzu.us>
+ L:    iommu@lists.linux-foundation.org
  S:    Maintained
  F:    arch/x86/kernel/pci-calgary_64.c
  F:    arch/x86/kernel/tce_64.c
@@@ -7420,7 -7424,7 +7424,7 @@@ F:      drivers/scsi/megaraid.
  F:    drivers/scsi/megaraid/
  
  MELLANOX ETHERNET DRIVER (mlx4_en)
- M:    Eugenia Emantayev <eugenia@mellanox.com>
+ M:    Tariq Toukan <tariqt@mellanox.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  W:    http://www.mellanox.com
@@@ -8959,6 -8963,7 +8963,7 @@@ L:      linux-gpio@vger.kernel.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
  S:    Maintained
  F:    Documentation/devicetree/bindings/pinctrl/
+ F:    Documentation/pinctrl.txt
  F:    drivers/pinctrl/
  F:    include/linux/pinctrl/
  
@@@ -9996,7 -10001,6 +10001,7 @@@ SERIAL DRIVER
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/serial/
  F:    drivers/tty/serial/
  
  SYNOPSYS DESIGNWARE DMAC DRIVER
diff --combined drivers/tty/vt/vt.c
index 213ce24060b549b3be2cd26e65097097e12bf0d2,5b0fe97c46ca9fb0bff6b66e0638226bf1b5781d..2705ca960e92ea89075b3849839c31202077a276
@@@ -277,15 -277,13 +277,15 @@@ static void notify_update(struct vc_dat
   *    Low-Level Functions
   */
  
 -#define IS_FG(vc)     ((vc)->vc_num == fg_console)
 +static inline bool con_is_fg(const struct vc_data *vc)
 +{
 +      return vc->vc_num == fg_console;
 +}
  
 -#ifdef VT_BUF_VRAM_ONLY
 -#define DO_UPDATE(vc) 0
 -#else
 -#define DO_UPDATE(vc) (CON_IS_VISIBLE(vc) && !console_blanked)
 -#endif
 +static inline bool con_should_update(const struct vc_data *vc)
 +{
 +      return con_is_visible(vc) && !console_blanked;
 +}
  
  static inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed)
  {
@@@ -323,7 -321,7 +323,7 @@@ static void scrup(struct vc_data *vc, u
                nr = b - t - 1;
        if (b > vc->vc_rows || t >= b || nr < 1)
                return;
 -      if (CON_IS_VISIBLE(vc) && vc->vc_sw->con_scroll(vc, t, b, SM_UP, nr))
 +      if (con_is_visible(vc) && vc->vc_sw->con_scroll(vc, t, b, SM_UP, nr))
                return;
        d = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
        s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * (t + nr));
@@@ -341,7 -339,7 +341,7 @@@ static void scrdown(struct vc_data *vc
                nr = b - t - 1;
        if (b > vc->vc_rows || t >= b || nr < 1)
                return;
 -      if (CON_IS_VISIBLE(vc) && vc->vc_sw->con_scroll(vc, t, b, SM_DOWN, nr))
 +      if (con_is_visible(vc) && vc->vc_sw->con_scroll(vc, t, b, SM_DOWN, nr))
                return;
        s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
        step = vc->vc_cols * nr;
  
  static void do_update_region(struct vc_data *vc, unsigned long start, int count)
  {
 -#ifndef VT_BUF_VRAM_ONLY
        unsigned int xx, yy, offset;
        u16 *p;
  
                        start = vc->vc_sw->con_getxy(vc, start, NULL, NULL);
                }
        }
 -#endif
  }
  
  void update_region(struct vc_data *vc, unsigned long start, int count)
  {
        WARN_CONSOLE_UNLOCKED();
  
 -      if (DO_UPDATE(vc)) {
 +      if (con_should_update(vc)) {
                hide_cursor(vc);
                do_update_region(vc, start, count);
                set_cursor(vc);
@@@ -413,6 -413,7 +413,6 @@@ static u8 build_attr(struct vc_data *vc
                return vc->vc_sw->con_build_attr(vc, _color, _intensity,
                       _blink, _underline, _reverse, _italic);
  
 -#ifndef VT_BUF_VRAM_ONLY
  /*
   * ++roman: I completely changed the attribute format for monochrome
   * mode (!can_do_color). The formerly used MDA (monochrome display
                a <<= 1;
        return a;
        }
 -#else
 -      return 0;
 -#endif
  }
  
  static void update_attr(struct vc_data *vc)
@@@ -466,9 -470,10 +466,9 @@@ void invert_screen(struct vc_data *vc, 
  
        count /= 2;
        p = screenpos(vc, offset, viewed);
 -      if (vc->vc_sw->con_invert_region)
 +      if (vc->vc_sw->con_invert_region) {
                vc->vc_sw->con_invert_region(vc, p, count);
 -#ifndef VT_BUF_VRAM_ONLY
 -      else {
 +      } else {
                u16 *q = p;
                int cnt = count;
                u16 a;
                        }
                }
        }
 -#endif
 -      if (DO_UPDATE(vc))
 +
 +      if (con_should_update(vc))
                do_update_region(vc, (unsigned long) p, count);
        notify_update(vc);
  }
@@@ -514,7 -519,7 +514,7 @@@ void complement_pos(struct vc_data *vc
        if (old_offset != -1 && old_offset >= 0 &&
            old_offset < vc->vc_screenbuf_size) {
                scr_writew(old, screenpos(vc, old_offset, 1));
 -              if (DO_UPDATE(vc))
 +              if (con_should_update(vc))
                        vc->vc_sw->con_putc(vc, old, oldy, oldx);
                notify_update(vc);
        }
                old = scr_readw(p);
                new = old ^ vc->vc_complement_mask;
                scr_writew(new, p);
 -              if (DO_UPDATE(vc)) {
 +              if (con_should_update(vc)) {
                        oldx = (offset >> 1) % vc->vc_cols;
                        oldy = (offset >> 1) / vc->vc_cols;
                        vc->vc_sw->con_putc(vc, new, oldy, oldx);
@@@ -545,7 -550,7 +545,7 @@@ static void insert_char(struct vc_data 
        scr_memmovew(p + nr, p, (vc->vc_cols - vc->vc_x - nr) * 2);
        scr_memsetw(p, vc->vc_video_erase_char, nr * 2);
        vc->vc_need_wrap = 0;
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                do_update_region(vc, (unsigned long) p,
                        vc->vc_cols - vc->vc_x);
  }
@@@ -558,7 -563,7 +558,7 @@@ static void delete_char(struct vc_data 
        scr_memsetw(p + vc->vc_cols - vc->vc_x - nr, vc->vc_video_erase_char,
                        nr * 2);
        vc->vc_need_wrap = 0;
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                do_update_region(vc, (unsigned long) p,
                        vc->vc_cols - vc->vc_x);
  }
@@@ -578,7 -583,7 +578,7 @@@ static void add_softcursor(struct vc_da
        if ((type & 0x20) && ((softcursor_original & 0x7000) == (i & 0x7000))) i ^= 0x7000;
        if ((type & 0x40) && ((i & 0x700) == ((i & 0x7000) >> 4))) i ^= 0x0700;
        scr_writew(i, (u16 *) vc->vc_pos);
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                vc->vc_sw->con_putc(vc, i, vc->vc_y, vc->vc_x);
  }
  
@@@ -586,7 -591,7 +586,7 @@@ static void hide_softcursor(struct vc_d
  {
        if (softcursor_original != -1) {
                scr_writew(softcursor_original, (u16 *)vc->vc_pos);
 -              if (DO_UPDATE(vc))
 +              if (con_should_update(vc))
                        vc->vc_sw->con_putc(vc, softcursor_original,
                                        vc->vc_y, vc->vc_x);
                softcursor_original = -1;
@@@ -603,7 -608,8 +603,7 @@@ static void hide_cursor(struct vc_data 
  
  static void set_cursor(struct vc_data *vc)
  {
 -      if (!IS_FG(vc) || console_blanked ||
 -          vc->vc_mode == KD_GRAPHICS)
 +      if (!con_is_fg(vc) || console_blanked || vc->vc_mode == KD_GRAPHICS)
                return;
        if (vc->vc_deccm) {
                if (vc == sel_cons)
@@@ -619,7 -625,7 +619,7 @@@ static void set_origin(struct vc_data *
  {
        WARN_CONSOLE_UNLOCKED();
  
 -      if (!CON_IS_VISIBLE(vc) ||
 +      if (!con_is_visible(vc) ||
            !vc->vc_sw->con_set_origin ||
            !vc->vc_sw->con_set_origin(vc))
                vc->vc_origin = (unsigned long)vc->vc_screenbuf;
@@@ -667,12 -673,12 +667,12 @@@ void redraw_screen(struct vc_data *vc, 
                struct vc_data *old_vc = vc_cons[fg_console].d;
                if (old_vc == vc)
                        return;
 -              if (!CON_IS_VISIBLE(vc))
 +              if (!con_is_visible(vc))
                        redraw = 1;
                *vc->vc_display_fg = vc;
                fg_console = vc->vc_num;
                hide_cursor(old_vc);
 -              if (!CON_IS_VISIBLE(old_vc)) {
 +              if (!con_is_visible(old_vc)) {
                        save_screen(old_vc);
                        set_origin(old_vc);
                }
@@@ -744,6 -750,7 +744,7 @@@ static void visual_init(struct vc_data 
        vc->vc_complement_mask = 0;
        vc->vc_can_do_color = 0;
        vc->vc_panic_force_write = false;
+       vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
        vc->vc_sw->con_init(vc, init);
        if (!vc->vc_complement_mask)
                vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
@@@ -947,7 -954,7 +948,7 @@@ static int vc_do_resize(struct tty_stru
                tty_do_resize(tty, &ws);
        }
  
 -      if (CON_IS_VISIBLE(vc))
 +      if (con_is_visible(vc))
                update_screen(vc);
        vt_event_post(VT_EVENT_RESIZE, vc->vc_num, vc->vc_num);
        return err;
@@@ -1096,9 -1103,11 +1097,9 @@@ static void gotoxay(struct vc_data *vc
        gotoxy(vc, new_x, vc->vc_decom ? (vc->vc_top + new_y) : new_y);
  }
  
 -void scrollback(struct vc_data *vc, int lines)
 +void scrollback(struct vc_data *vc)
  {
 -      if (!lines)
 -              lines = vc->vc_rows / 2;
 -      scrolldelta(-lines);
 +      scrolldelta(-(vc->vc_rows / 2));
  }
  
  void scrollfront(struct vc_data *vc, int lines)
@@@ -1177,7 -1186,7 +1178,7 @@@ static void csi_J(struct vc_data *vc, i
                        scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
                                    vc->vc_screenbuf_size >> 1);
                        set_origin(vc);
 -                      if (CON_IS_VISIBLE(vc))
 +                      if (con_is_visible(vc))
                                update_screen(vc);
                        /* fall through */
                case 2: /* erase whole display */
                        return;
        }
        scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                do_update_region(vc, (unsigned long) start, count);
        vc->vc_need_wrap = 0;
  }
@@@ -1216,7 -1225,7 +1217,7 @@@ static void csi_K(struct vc_data *vc, i
        }
        scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
        vc->vc_need_wrap = 0;
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                do_update_region(vc, (unsigned long) start, count);
  }
  
@@@ -1229,7 -1238,7 +1230,7 @@@ static void csi_X(struct vc_data *vc, i
        count = (vpar > vc->vc_cols - vc->vc_x) ? (vc->vc_cols - vc->vc_x) : vpar;
  
        scr_memsetw((unsigned short *)vc->vc_pos, vc->vc_video_erase_char, 2 * count);
 -      if (DO_UPDATE(vc))
 +      if (con_should_update(vc))
                vc->vc_sw->con_clear(vc, vc->vc_y, vc->vc_x, 1, count);
        vc->vc_need_wrap = 0;
  }
@@@ -1246,87 -1255,48 +1247,87 @@@ static void default_attr(struct vc_dat
  
  struct rgb { u8 r; u8 g; u8 b; };
  
 -static struct rgb rgb_from_256(int i)
 +static void rgb_from_256(int i, struct rgb *c)
  {
 -      struct rgb c;
        if (i < 8) {            /* Standard colours. */
 -              c.r = i&1 ? 0xaa : 0x00;
 -              c.g = i&2 ? 0xaa : 0x00;
 -              c.b = i&4 ? 0xaa : 0x00;
 +              c->r = i&1 ? 0xaa : 0x00;
 +              c->g = i&2 ? 0xaa : 0x00;
 +              c->b = i&4 ? 0xaa : 0x00;
        } else if (i < 16) {
 -              c.r = i&1 ? 0xff : 0x55;
 -              c.g = i&2 ? 0xff : 0x55;
 -              c.b = i&4 ? 0xff : 0x55;
 +              c->r = i&1 ? 0xff : 0x55;
 +              c->g = i&2 ? 0xff : 0x55;
 +              c->b = i&4 ? 0xff : 0x55;
        } else if (i < 232) {   /* 6x6x6 colour cube. */
 -              c.r = (i - 16) / 36 * 85 / 2;
 -              c.g = (i - 16) / 6 % 6 * 85 / 2;
 -              c.b = (i - 16) % 6 * 85 / 2;
 +              c->r = (i - 16) / 36 * 85 / 2;
 +              c->g = (i - 16) / 6 % 6 * 85 / 2;
 +              c->b = (i - 16) % 6 * 85 / 2;
        } else                  /* Grayscale ramp. */
 -              c.r = c.g = c.b = i * 10 - 2312;
 -      return c;
 -}
 -
 -static void rgb_foreground(struct vc_data *vc, struct rgb c)
 -{
 -      u8 hue, max = c.r;
 -      if (c.g > max)
 -              max = c.g;
 -      if (c.b > max)
 -              max = c.b;
 -      hue = (c.r > max/2 ? 4 : 0)
 -          | (c.g > max/2 ? 2 : 0)
 -          | (c.b > max/2 ? 1 : 0);
 -      if (hue == 7 && max <= 0x55)
 -              hue = 0, vc->vc_intensity = 2;
 +              c->r = c->g = c->b = i * 10 - 2312;
 +}
 +
 +static void rgb_foreground(struct vc_data *vc, const struct rgb *c)
 +{
 +      u8 hue = 0, max = max3(c->r, c->g, c->b);
 +
 +      if (c->r > max / 2)
 +              hue |= 4;
 +      if (c->g > max / 2)
 +              hue |= 2;
 +      if (c->b > max / 2)
 +              hue |= 1;
 +
 +      if (hue == 7 && max <= 0x55) {
 +              hue = 0;
 +              vc->vc_intensity = 2;
 +      } else if (max > 0xaa)
 +              vc->vc_intensity = 2;
        else
 -              vc->vc_intensity = (max > 0xaa) + 1;
 +              vc->vc_intensity = 1;
 +
        vc->vc_color = (vc->vc_color & 0xf0) | hue;
  }
  
 -static void rgb_background(struct vc_data *vc, struct rgb c)
 +static void rgb_background(struct vc_data *vc, const struct rgb *c)
  {
        /* For backgrounds, err on the dark side. */
        vc->vc_color = (vc->vc_color & 0x0f)
 -              | (c.r&0x80) >> 1 | (c.g&0x80) >> 2 | (c.b&0x80) >> 3;
 +              | (c->r&0x80) >> 1 | (c->g&0x80) >> 2 | (c->b&0x80) >> 3;
 +}
 +
 +/*
 + * ITU T.416 Higher colour modes. They break the usual properties of SGR codes
 + * and thus need to be detected and ignored by hand. Strictly speaking, that
 + * standard also wants : rather than ; as separators, contrary to ECMA-48, but
 + * no one produces such codes and almost no one accepts them.
 + *
 + * Subcommands 3 (CMY) and 4 (CMYK) are so insane there's no point in
 + * supporting them.
 + */
 +static int vc_t416_color(struct vc_data *vc, int i,
 +              void(*set_color)(struct vc_data *vc, const struct rgb *c))
 +{
 +      struct rgb c;
 +
 +      i++;
 +      if (i > vc->vc_npar)
 +              return i;
 +
 +      if (vc->vc_par[i] == 5 && i < vc->vc_npar) {
 +              /* 256 colours -- ubiquitous */
 +              i++;
 +              rgb_from_256(vc->vc_par[i], &c);
 +      } else if (vc->vc_par[i] == 2 && i <= vc->vc_npar + 3) {
 +              /* 24 bit -- extremely rare */
 +              c.r = vc->vc_par[i + 1];
 +              c.g = vc->vc_par[i + 2];
 +              c.b = vc->vc_par[i + 3];
 +              i += 3;
 +      } else
 +              return i;
 +
 +      set_color(vc, &c);
 +
 +      return i;
  }
  
  /* console_lock is held */
@@@ -1336,91 -1306,135 +1337,91 @@@ static void csi_m(struct vc_data *vc
  
        for (i = 0; i <= vc->vc_npar; i++)
                switch (vc->vc_par[i]) {
 -                      case 0: /* all attributes off */
 -                              default_attr(vc);
 -                              break;
 -                      case 1:
 -                              vc->vc_intensity = 2;
 -                              break;
 -                      case 2:
 -                              vc->vc_intensity = 0;
 -                              break;
 -                      case 3:
 -                              vc->vc_italic = 1;
 -                              break;
 -                      case 4:
 -                              vc->vc_underline = 1;
 -                              break;
 -                      case 5:
 -                              vc->vc_blink = 1;
 -                              break;
 -                      case 7:
 -                              vc->vc_reverse = 1;
 -                              break;
 -                      case 10: /* ANSI X3.64-1979 (SCO-ish?)
 -                                * Select primary font, don't display
 -                                * control chars if defined, don't set
 -                                * bit 8 on output.
 -                                */
 -                              vc->vc_translate = set_translate(vc->vc_charset == 0
 -                                              ? vc->vc_G0_charset
 -                                              : vc->vc_G1_charset, vc);
 -                              vc->vc_disp_ctrl = 0;
 -                              vc->vc_toggle_meta = 0;
 -                              break;
 -                      case 11: /* ANSI X3.64-1979 (SCO-ish?)
 -                                * Select first alternate font, lets
 -                                * chars < 32 be displayed as ROM chars.
 -                                */
 -                              vc->vc_translate = set_translate(IBMPC_MAP, vc);
 -                              vc->vc_disp_ctrl = 1;
 -                              vc->vc_toggle_meta = 0;
 -                              break;
 -                      case 12: /* ANSI X3.64-1979 (SCO-ish?)
 -                                * Select second alternate font, toggle
 -                                * high bit before displaying as ROM char.
 -                                */
 -                              vc->vc_translate = set_translate(IBMPC_MAP, vc);
 -                              vc->vc_disp_ctrl = 1;
 -                              vc->vc_toggle_meta = 1;
 -                              break;
 -                      case 21:
 -                      case 22:
 -                              vc->vc_intensity = 1;
 -                              break;
 -                      case 23:
 -                              vc->vc_italic = 0;
 -                              break;
 -                      case 24:
 -                              vc->vc_underline = 0;
 -                              break;
 -                      case 25:
 -                              vc->vc_blink = 0;
 -                              break;
 -                      case 27:
 -                              vc->vc_reverse = 0;
 -                              break;
 -                      case 38: /* ITU T.416
 -                                * Higher colour modes.
 -                                * They break the usual properties of SGR codes
 -                                * and thus need to be detected and ignored by
 -                                * hand.  Strictly speaking, that standard also
 -                                * wants : rather than ; as separators, contrary
 -                                * to ECMA-48, but no one produces such codes
 -                                * and almost no one accepts them.
 -                                */
 -                              i++;
 -                              if (i > vc->vc_npar)
 -                                      break;
 -                              if (vc->vc_par[i] == 5 &&  /* 256 colours */
 -                                  i < vc->vc_npar) {     /* ubiquitous */
 -                                      i++;
 -                                      rgb_foreground(vc,
 -                                              rgb_from_256(vc->vc_par[i]));
 -                              } else if (vc->vc_par[i] == 2 &&  /* 24 bit */
 -                                         i <= vc->vc_npar + 3) {/* extremely rare */
 -                                      struct rgb c = {
 -                                              .r = vc->vc_par[i + 1],
 -                                              .g = vc->vc_par[i + 2],
 -                                              .b = vc->vc_par[i + 3],
 -                                      };
 -                                      rgb_foreground(vc, c);
 -                                      i += 3;
 -                              }
 -                              /* Subcommands 3 (CMY) and 4 (CMYK) are so insane
 -                               * there's no point in supporting them.
 -                               */
 -                              break;
 -                      case 48:
 -                              i++;
 -                              if (i > vc->vc_npar)
 -                                      break;
 -                              if (vc->vc_par[i] == 5 &&  /* 256 colours */
 -                                  i < vc->vc_npar) {
 -                                      i++;
 -                                      rgb_background(vc,
 -                                              rgb_from_256(vc->vc_par[i]));
 -                              } else if (vc->vc_par[i] == 2 && /* 24 bit */
 -                                         i <= vc->vc_npar + 3) {
 -                                      struct rgb c = {
 -                                              .r = vc->vc_par[i + 1],
 -                                              .g = vc->vc_par[i + 2],
 -                                              .b = vc->vc_par[i + 3],
 -                                      };
 -                                      rgb_background(vc, c);
 -                                      i += 3;
 -                              }
 -                              break;
 -                      case 39:
 -                              vc->vc_color = (vc->vc_def_color & 0x0f) | (vc->vc_color & 0xf0);
 -                              break;
 -                      case 49:
 -                              vc->vc_color = (vc->vc_def_color & 0xf0) | (vc->vc_color & 0x0f);
 -                              break;
 -                      default:
 -                              if (vc->vc_par[i] >= 30 && vc->vc_par[i] <= 37)
 -                                      vc->vc_color = color_table[vc->vc_par[i] - 30]
 -                                              | (vc->vc_color & 0xf0);
 -                              else if (vc->vc_par[i] >= 40 && vc->vc_par[i] <= 47)
 -                                      vc->vc_color = (color_table[vc->vc_par[i] - 40] << 4)
 -                                              | (vc->vc_color & 0x0f);
 -                              break;
 +              case 0: /* all attributes off */
 +                      default_attr(vc);
 +                      break;
 +              case 1:
 +                      vc->vc_intensity = 2;
 +                      break;
 +              case 2:
 +                      vc->vc_intensity = 0;
 +                      break;
 +              case 3:
 +                      vc->vc_italic = 1;
 +                      break;
 +              case 4:
 +                      vc->vc_underline = 1;
 +                      break;
 +              case 5:
 +                      vc->vc_blink = 1;
 +                      break;
 +              case 7:
 +                      vc->vc_reverse = 1;
 +                      break;
 +              case 10: /* ANSI X3.64-1979 (SCO-ish?)
 +                        * Select primary font, don't display control chars if
 +                        * defined, don't set bit 8 on output.
 +                        */
 +                      vc->vc_translate = set_translate(vc->vc_charset == 0
 +                                      ? vc->vc_G0_charset
 +                                      : vc->vc_G1_charset, vc);
 +                      vc->vc_disp_ctrl = 0;
 +                      vc->vc_toggle_meta = 0;
 +                      break;
 +              case 11: /* ANSI X3.64-1979 (SCO-ish?)
 +                        * Select first alternate font, lets chars < 32 be
 +                        * displayed as ROM chars.
 +                        */
 +                      vc->vc_translate = set_translate(IBMPC_MAP, vc);
 +                      vc->vc_disp_ctrl = 1;
 +                      vc->vc_toggle_meta = 0;
 +                      break;
 +              case 12: /* ANSI X3.64-1979 (SCO-ish?)
 +                        * Select second alternate font, toggle high bit
 +                        * before displaying as ROM char.
 +                        */
 +                      vc->vc_translate = set_translate(IBMPC_MAP, vc);
 +                      vc->vc_disp_ctrl = 1;
 +                      vc->vc_toggle_meta = 1;
 +                      break;
 +              case 21:
 +              case 22:
 +                      vc->vc_intensity = 1;
 +                      break;
 +              case 23:
 +                      vc->vc_italic = 0;
 +                      break;
 +              case 24:
 +                      vc->vc_underline = 0;
 +                      break;
 +              case 25:
 +                      vc->vc_blink = 0;
 +                      break;
 +              case 27:
 +                      vc->vc_reverse = 0;
 +                      break;
 +              case 38:
 +                      i = vc_t416_color(vc, i, rgb_foreground);
 +                      break;
 +              case 48:
 +                      i = vc_t416_color(vc, i, rgb_background);
 +                      break;
 +              case 39:
 +                      vc->vc_color = (vc->vc_def_color & 0x0f) |
 +                              (vc->vc_color & 0xf0);
 +                      break;
 +              case 49:
 +                      vc->vc_color = (vc->vc_def_color & 0xf0) |
 +                              (vc->vc_color & 0x0f);
 +                      break;
 +              default:
 +                      if (vc->vc_par[i] >= 30 && vc->vc_par[i] <= 37)
 +                              vc->vc_color = color_table[vc->vc_par[i] - 30]
 +                                      | (vc->vc_color & 0xf0);
 +                      else if (vc->vc_par[i] >= 40 && vc->vc_par[i] <= 47)
 +                              vc->vc_color = (color_table[vc->vc_par[i] - 40] << 4)
 +                                      | (vc->vc_color & 0x0f);
 +                      break;
                }
        update_attr(vc);
  }
@@@ -1482,6 -1496,7 +1483,6 @@@ static void set_mode(struct vc_data *vc
                                        clr_kbd(vc, decckm);
                                break;
                        case 3: /* 80/132 mode switch unimplemented */
 -                              vc->vc_deccolm = on_off;
  #if 0
                                vc_resize(deccolm ? 132 : 80, vc->vc_rows);
                                /* this alone does not suffice; some user mode
@@@ -2163,20 -2178,18 +2164,20 @@@ static int is_double_width(uint32_t ucs
        return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1);
  }
  
 +static void con_flush(struct vc_data *vc, unsigned long draw_from,
 +              unsigned long draw_to, int *draw_x)
 +{
 +      if (*draw_x < 0)
 +              return;
 +
 +      vc->vc_sw->con_putcs(vc, (u16 *)draw_from,
 +                      (u16 *)draw_to - (u16 *)draw_from, vc->vc_y, *draw_x);
 +      *draw_x = -1;
 +}
 +
  /* acquires console_lock */
  static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count)
  {
 -#ifdef VT_BUF_VRAM_ONLY
 -#define FLUSH do { } while(0);
 -#else
 -#define FLUSH if (draw_x >= 0) { \
 -      vc->vc_sw->con_putcs(vc, (u16 *)draw_from, (u16 *)draw_to - (u16 *)draw_from, vc->vc_y, draw_x); \
 -      draw_x = -1; \
 -      }
 -#endif
 -
        int c, tc, ok, n = 0, draw_x = -1;
        unsigned int currcons;
        unsigned long draw_from = 0, draw_to = 0;
        charmask = himask ? 0x1ff : 0xff;
  
        /* undraw cursor first */
 -      if (IS_FG(vc))
 +      if (con_is_fg(vc))
                hide_cursor(vc);
  
        param.vc = vc;
@@@ -2368,13 -2381,12 +2369,13 @@@ rescan_last_byte
                                } else {
                                        vc_attr = ((vc->vc_attr) & 0x88) | (((vc->vc_attr) & 0x70) >> 4) | (((vc->vc_attr) & 0x07) << 4);
                                }
 -                              FLUSH
 +                              con_flush(vc, draw_from, draw_to, &draw_x);
                        }
  
                        while (1) {
                                if (vc->vc_need_wrap || vc->vc_decim)
 -                                      FLUSH
 +                                      con_flush(vc, draw_from, draw_to,
 +                                                      &draw_x);
                                if (vc->vc_need_wrap) {
                                        cr(vc);
                                        lf(vc);
                                             ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) :
                                             (vc_attr << 8) + tc,
                                           (u16 *) vc->vc_pos);
 -                              if (DO_UPDATE(vc) && draw_x < 0) {
 +                              if (con_should_update(vc) && draw_x < 0) {
                                        draw_x = vc->vc_x;
                                        draw_from = vc->vc_pos;
                                }
                        }
                        notify_write(vc, c);
  
 -                      if (inverse) {
 -                              FLUSH
 -                      }
 +                      if (inverse)
 +                              con_flush(vc, draw_from, draw_to, &draw_x);
  
                        if (rescan) {
                                rescan = 0;
                        }
                        continue;
                }
 -              FLUSH
 +              con_flush(vc, draw_from, draw_to, &draw_x);
                do_con_trol(tty, vc, orig);
        }
 -      FLUSH
 +      con_flush(vc, draw_from, draw_to, &draw_x);
        console_conditional_schedule();
        console_unlock();
        notify_update(vc);
        return n;
 -#undef FLUSH
  }
  
  /*
@@@ -2457,7 -2471,7 +2458,7 @@@ static void console_callback(struct wor
        if (scrollback_delta) {
                struct vc_data *vc = vc_cons[fg_console].d;
                clear_selection();
 -              if (vc->vc_mode == KD_TEXT)
 +              if (vc->vc_mode == KD_TEXT && vc->vc_sw->con_scrolldelta)
                        vc->vc_sw->con_scrolldelta(vc, scrollback_delta);
                scrollback_delta = 0;
        }
@@@ -2569,7 -2583,7 +2570,7 @@@ static void vt_console_print(struct con
                goto quit;
  
        /* undraw cursor first */
 -      if (IS_FG(vc))
 +      if (con_is_fg(vc))
                hide_cursor(vc);
  
        start = (ushort *)vc->vc_pos;
                c = *b++;
                if (c == 10 || c == 13 || c == 8 || vc->vc_need_wrap) {
                        if (cnt > 0) {
 -                              if (CON_IS_VISIBLE(vc))
 +                              if (con_is_visible(vc))
                                        vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, vc->vc_x);
                                vc->vc_x += cnt;
                                if (vc->vc_need_wrap)
                myx++;
        }
        if (cnt > 0) {
 -              if (CON_IS_VISIBLE(vc))
 +              if (con_is_visible(vc))
                        vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, vc->vc_x);
                vc->vc_x += cnt;
                if (vc->vc_x == vc->vc_cols) {
@@@ -3159,7 -3173,7 +3160,7 @@@ static int do_bind_con_driver(const str
  
                j = i;
  
 -              if (CON_IS_VISIBLE(vc)) {
 +              if (con_is_visible(vc)) {
                        k = i;
                        save_screen(vc);
                }
@@@ -3967,7 -3981,7 +3968,7 @@@ static void set_palette(struct vc_data 
  {
        WARN_CONSOLE_UNLOCKED();
  
 -      if (vc->vc_mode != KD_GRAPHICS)
 +      if (vc->vc_mode != KD_GRAPHICS && vc->vc_sw->con_set_palette)
                vc->vc_sw->con_set_palette(vc, color_table);
  }
  
This page took 0.094994 seconds and 5 git commands to generate.