summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-06 14:56:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-06 14:56:11 -0700
commitd6efb3ac3e6c19ab722b28bdb9252bae0b9676b6 (patch)
treeb2f1f5995df54f57fefbdd9b7ef9739cbb107d24 /drivers/video
parentc0c419c04557117258d184876d94091d29bbd9a6 (diff)
parentf6c6eb2fe8223f8e64babcdaad2838ba6ede277d (diff)
Merge tag 'tty-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH: "Here is the large set of TTY and Serial driver patches for 5.9-rc1. Lots of bugfixes in here, thanks to syzbot fuzzing for serial and vt and console code. Other highlights include: - much needed vt/vc code cleanup from Jiri Slaby - 8250 driver fixes and additions - various serial driver updates and feature enhancements - locking cleanup for serial/console initializations - other minor cleanups All of these have been in linux-next with no reported issues" * tag 'tty-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (90 commits) MAINTAINERS: enlist Greg formally for console stuff vgacon: Fix for missing check in scrollback handling Revert "serial: 8250: Let serial core initialise spin lock" serial: 8250: Let serial core initialise spin lock tty: keyboard, do not speculate on func_table index serial: stm32: Add RS485 RTS GPIO control serial: 8250_dw: Fix common clocks usage race condition serial: 8250_dw: Pass the same rate to the clk round and set rate methods serial: 8250_dw: Simplify the ref clock rate setting procedure serial: 8250: Add 8250 port clock update method tty: serial: imx: add imx earlycon driver tty: serial: imx: enable imx serial console port as module tty/synclink: remove leftover bits of non-PCI card support tty: Use the preferred form for passing the size of a structure type tty: Fix identation issues in struct serial_struct32 tty: Avoid the use of one-element arrays serial: msm_serial: add sparse context annotation serial: pmac_zilog: add sparse context annotation newport_con: vc_color is now in state serial: imx: use hrtimers for rs485 delays ...
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console/mdacon.c20
-rw-r--r--drivers/video/console/newport_con.c10
-rw-r--r--drivers/video/console/sticon.c14
-rw-r--r--drivers/video/console/vgacon.c40
-rw-r--r--drivers/video/fbdev/core/bitblit.c10
-rw-r--r--drivers/video/fbdev/core/fbcon.c10
-rw-r--r--drivers/video/fbdev/core/fbcon_ccw.c8
-rw-r--r--drivers/video/fbdev/core/fbcon_cw.c8
-rw-r--r--drivers/video/fbdev/core/fbcon_ud.c8
-rw-r--r--drivers/video/fbdev/core/tileblit.c6
10 files changed, 72 insertions, 62 deletions
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index d0d427a2f1a3..ef29b321967f 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -394,8 +394,10 @@ static inline u16 mda_convert_attr(u16 ch)
(ch & 0x00ff) | attr;
}
-static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
- u8 blink, u8 underline, u8 reverse, u8 italic)
+static u8 mdacon_build_attr(struct vc_data *c, u8 color,
+ enum vc_intensity intensity,
+ bool blink, bool underline, bool reverse,
+ bool italic)
{
/* The attribute is just a bit vector:
*
@@ -405,11 +407,11 @@ static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
* Bit 7 : blink
*/
- return (intensity & 3) |
- ((underline & 1) << 2) |
- ((reverse & 1) << 3) |
- (!!italic << 4) |
- ((blink & 1) << 7);
+ return (intensity & VCI_MASK) |
+ (underline << 2) |
+ (reverse << 3) |
+ (italic << 4) |
+ (blink << 7);
}
static void mdacon_invert_region(struct vc_data *c, u16 *p, int count)
@@ -488,9 +490,9 @@ static void mdacon_cursor(struct vc_data *c, int mode)
return;
}
- mda_set_cursor(c->vc_y*mda_num_columns*2 + c->vc_x*2);
+ mda_set_cursor(c->state.y * mda_num_columns * 2 + c->state.x * 2);
- switch (c->vc_cursor_type & 0x0f) {
+ switch (CUR_SIZE(c->vc_cursor_type)) {
case CUR_LOWER_THIRD: mda_set_cursor_size(10, 13); break;
case CUR_LOWER_HALF: mda_set_cursor_size(7, 13); break;
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index df3c52d72159..72f146d047d9 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -362,12 +362,12 @@ static void newport_clear(struct vc_data *vc, int sy, int sx, int height,
if (ystart < yend) {
newport_clear_screen(sx << 3, ystart, xend, yend,
- (vc->vc_color & 0xf0) >> 4);
+ (vc->state.color & 0xf0) >> 4);
} else {
newport_clear_screen(sx << 3, ystart, xend, 1023,
- (vc->vc_color & 0xf0) >> 4);
+ (vc->state.color & 0xf0) >> 4);
newport_clear_screen(sx << 3, 0, xend, yend,
- (vc->vc_color & 0xf0) >> 4);
+ (vc->state.color & 0xf0) >> 4);
}
}
@@ -591,11 +591,11 @@ static bool newport_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
topscan = (topscan + (lines << 4)) & 0x3ff;
newport_clear_lines(vc->vc_rows - lines,
vc->vc_rows - 1,
- (vc->vc_color & 0xf0) >> 4);
+ (vc->state.color & 0xf0) >> 4);
} else {
topscan = (topscan + (-lines << 4)) & 0x3ff;
newport_clear_lines(0, lines - 1,
- (vc->vc_color & 0xf0) >> 4);
+ (vc->state.color & 0xf0) >> 4);
}
npregs->cset.topscan = (topscan - 1) & 0x3ff;
return false;
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 79c9bd8d3025..21a5c280c8c9 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -132,21 +132,21 @@ static void sticon_cursor(struct vc_data *conp, int mode)
{
unsigned short car1;
- car1 = conp->vc_screenbuf[conp->vc_x + conp->vc_y * conp->vc_cols];
+ car1 = conp->vc_screenbuf[conp->state.x + conp->state.y * conp->vc_cols];
switch (mode) {
case CM_ERASE:
- sti_putc(sticon_sti, car1, conp->vc_y, conp->vc_x);
+ sti_putc(sticon_sti, car1, conp->state.y, conp->state.x);
break;
case CM_MOVE:
case CM_DRAW:
- switch (conp->vc_cursor_type & 0x0f) {
+ switch (CUR_SIZE(conp->vc_cursor_type)) {
case CUR_UNDERLINE:
case CUR_LOWER_THIRD:
case CUR_LOWER_HALF:
case CUR_TWO_THIRDS:
case CUR_BLOCK:
sti_putc(sticon_sti, (car1 & 255) + (0 << 8) + (7 << 11),
- conp->vc_y, conp->vc_x);
+ conp->state.y, conp->state.x);
break;
}
break;
@@ -288,8 +288,10 @@ static unsigned long sticon_getxy(struct vc_data *conp, unsigned long pos,
return ret;
}
-static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens,
- u8 blink, u8 underline, u8 reverse, u8 italic)
+static u8 sticon_build_attr(struct vc_data *conp, u8 color,
+ enum vc_intensity intens,
+ bool blink, bool underline, bool reverse,
+ bool italic)
{
u8 attr = ((color & 0x70) >> 1) | ((color & 7));
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 998b0de1812f..a52bb3740073 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -251,6 +251,10 @@ static void vgacon_scrollback_update(struct vc_data *c, int t, int count)
p = (void *) (c->vc_origin + t * c->vc_size_row);
while (count--) {
+ if ((vgacon_scrollback_cur->tail + c->vc_size_row) >
+ vgacon_scrollback_cur->size)
+ vgacon_scrollback_cur->tail = 0;
+
scr_memcpyw(vgacon_scrollback_cur->data +
vgacon_scrollback_cur->tail,
p, c->vc_size_row);
@@ -629,8 +633,10 @@ static void vgacon_deinit(struct vc_data *c)
con_set_default_unimap(c);
}
-static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
- u8 blink, u8 underline, u8 reverse, u8 italic)
+static u8 vgacon_build_attr(struct vc_data *c, u8 color,
+ enum vc_intensity intensity,
+ bool blink, bool underline, bool reverse,
+ bool italic)
{
u8 attr = color;
@@ -639,7 +645,7 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
attr = (attr & 0xF0) | c->vc_itcolor;
else if (underline)
attr = (attr & 0xf0) | c->vc_ulcolor;
- else if (intensity == 0)
+ else if (intensity == VCI_HALF_BRIGHT)
attr = (attr & 0xf0) | c->vc_halfcolor;
}
if (reverse)
@@ -648,14 +654,14 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
0x77);
if (blink)
attr ^= 0x80;
- if (intensity == 2)
+ if (intensity == VCI_BOLD)
attr ^= 0x08;
if (!vga_can_do_color) {
if (italic)
attr = (attr & 0xF8) | 0x02;
else if (underline)
attr = (attr & 0xf8) | 0x01;
- else if (intensity == 0)
+ else if (intensity == VCI_HALF_BRIGHT)
attr = (attr & 0xf0) | 0x08;
}
return attr;
@@ -718,17 +724,17 @@ static void vgacon_cursor(struct vc_data *c, int mode)
case CM_ERASE:
write_vga(14, (c->vc_pos - vga_vram_base) / 2);
if (vga_video_type >= VIDEO_TYPE_VGAC)
- vgacon_set_cursor_size(c->vc_x, 31, 30);
+ vgacon_set_cursor_size(c->state.x, 31, 30);
else
- vgacon_set_cursor_size(c->vc_x, 31, 31);
+ vgacon_set_cursor_size(c->state.x, 31, 31);
break;
case CM_MOVE:
case CM_DRAW:
write_vga(14, (c->vc_pos - vga_vram_base) / 2);
- switch (c->vc_cursor_type & 0x0f) {
+ switch (CUR_SIZE(c->vc_cursor_type)) {
case CUR_UNDERLINE:
- vgacon_set_cursor_size(c->vc_x,
+ vgacon_set_cursor_size(c->state.x,
c->vc_font.height -
(c->vc_font.height <
10 ? 2 : 3),
@@ -737,21 +743,21 @@ static void vgacon_cursor(struct vc_data *c, int mode)
10 ? 1 : 2));
break;
case CUR_TWO_THIRDS:
- vgacon_set_cursor_size(c->vc_x,
+ vgacon_set_cursor_size(c->state.x,
c->vc_font.height / 3,
c->vc_font.height -
(c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_LOWER_THIRD:
- vgacon_set_cursor_size(c->vc_x,
+ vgacon_set_cursor_size(c->state.x,
(c->vc_font.height * 2) / 3,
c->vc_font.height -
(c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_LOWER_HALF:
- vgacon_set_cursor_size(c->vc_x,
+ vgacon_set_cursor_size(c->state.x,
c->vc_font.height / 2,
c->vc_font.height -
(c->vc_font.height <
@@ -759,12 +765,12 @@ static void vgacon_cursor(struct vc_data *c, int mode)
break;
case CUR_NONE:
if (vga_video_type >= VIDEO_TYPE_VGAC)
- vgacon_set_cursor_size(c->vc_x, 31, 30);
+ vgacon_set_cursor_size(c->state.x, 31, 30);
else
- vgacon_set_cursor_size(c->vc_x, 31, 31);
+ vgacon_set_cursor_size(c->state.x, 31, 31);
break;
default:
- vgacon_set_cursor_size(c->vc_x, 1,
+ vgacon_set_cursor_size(c->state.x, 1,
c->vc_font.height);
break;
}
@@ -1352,8 +1358,8 @@ static void vgacon_save_screen(struct vc_data *c)
* console initialization routines.
*/
vga_bootup_console = 1;
- c->vc_x = screen_info.orig_x;
- c->vc_y = screen_info.orig_y;
+ c->state.x = screen_info.orig_x;
+ c->state.y = screen_info.orig_y;
}
/* We can't copy in more than the size of the video buffer,
diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c
index 35ebeeccde4d..4e6cbc24346d 100644
--- a/drivers/video/fbdev/core/bitblit.c
+++ b/drivers/video/fbdev/core/bitblit.c
@@ -240,8 +240,8 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = DIV_ROUND_UP(vc->vc_font.width, 8), c;
- int y = real_y(ops->p, vc->vc_y);
- int attribute, use_sw = (vc->vc_cursor_type & 0x10);
+ int y = real_y(ops->p, vc->state.y);
+ int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
int err = 1;
char *src;
@@ -286,10 +286,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
cursor.set |= FB_CUR_SETCMAP;
}
- if ((ops->cursor_state.image.dx != (vc->vc_font.width * vc->vc_x)) ||
+ if ((ops->cursor_state.image.dx != (vc->vc_font.width * vc->state.x)) ||
(ops->cursor_state.image.dy != (vc->vc_font.height * y)) ||
ops->cursor_reset) {
- ops->cursor_state.image.dx = vc->vc_font.width * vc->vc_x;
+ ops->cursor_state.image.dx = vc->vc_font.width * vc->state.x;
ops->cursor_state.image.dy = vc->vc_font.height * y;
cursor.set |= FB_CUR_SETPOS;
}
@@ -325,7 +325,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE;
- switch (ops->p->cursor_shape & CUR_HWMASK) {
+ switch (CUR_SIZE(ops->p->cursor_shape)) {
case CUR_NONE:
cur_height = 0;
break;
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index af9f5ab96f74..8a31fc2b2258 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -655,11 +655,11 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
}
if (!save) {
int lines;
- if (vc->vc_y + logo_lines >= rows)
- lines = rows - vc->vc_y - 1;
+ if (vc->state.y + logo_lines >= rows)
+ lines = rows - vc->state.y - 1;
else
lines = logo_lines;
- vc->vc_y += lines;
+ vc->state.y += lines;
vc->vc_pos += lines * vc->vc_size_row;
}
}
@@ -677,7 +677,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
vc->vc_size_row *
rows);
scr_memcpyw(q, save, array3_size(logo_lines, new_cols, 2));
- vc->vc_y += logo_lines;
+ vc->state.y += logo_lines;
vc->vc_pos += logo_lines * vc->vc_size_row;
kfree(save);
}
@@ -1393,7 +1393,7 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
return;
- if (vc->vc_cursor_type & 0x10)
+ if (vc->vc_cursor_type & CUR_SW)
fbcon_del_cursor_timer(info);
else
fbcon_add_cursor_timer(info);
diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c
index 78f3a5621478..5b177131e062 100644
--- a/drivers/video/fbdev/core/fbcon_ccw.c
+++ b/drivers/video/fbdev/core/fbcon_ccw.c
@@ -225,8 +225,8 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.height + 7) >> 3, c;
- int y = real_y(ops->p, vc->vc_y);
- int attribute, use_sw = (vc->vc_cursor_type & 0x10);
+ int y = real_y(ops->p, vc->state.y);
+ int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
int err = 1, dx, dy;
char *src;
u32 vyres = GETVYRES(ops->p->scrollmode, info);
@@ -284,7 +284,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
}
dx = y * vc->vc_font.height;
- dy = vyres - ((vc->vc_x + 1) * vc->vc_font.width);
+ dy = vyres - ((vc->state.x + 1) * vc->vc_font.width);
if (ops->cursor_state.image.dx != dx ||
ops->cursor_state.image.dy != dy ||
@@ -325,7 +325,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE;
- switch (ops->p->cursor_shape & CUR_HWMASK) {
+ switch (CUR_SIZE(ops->p->cursor_shape)) {
case CUR_NONE:
cur_height = 0;
break;
diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core/fbcon_cw.c
index fd098ff17574..894d01a62f30 100644
--- a/drivers/video/fbdev/core/fbcon_cw.c
+++ b/drivers/video/fbdev/core/fbcon_cw.c
@@ -208,8 +208,8 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.height + 7) >> 3, c;
- int y = real_y(ops->p, vc->vc_y);
- int attribute, use_sw = (vc->vc_cursor_type & 0x10);
+ int y = real_y(ops->p, vc->state.y);
+ int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
int err = 1, dx, dy;
char *src;
u32 vxres = GETVXRES(ops->p->scrollmode, info);
@@ -267,7 +267,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
}
dx = vxres - ((y * vc->vc_font.height) + vc->vc_font.height);
- dy = vc->vc_x * vc->vc_font.width;
+ dy = vc->state.x * vc->vc_font.width;
if (ops->cursor_state.image.dx != dx ||
ops->cursor_state.image.dy != dy ||
@@ -308,7 +308,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE;
- switch (ops->p->cursor_shape & CUR_HWMASK) {
+ switch (CUR_SIZE(ops->p->cursor_shape)) {
case CUR_NONE:
cur_height = 0;
break;
diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core/fbcon_ud.c
index e165a3fad29a..01b87f278d79 100644
--- a/drivers/video/fbdev/core/fbcon_ud.c
+++ b/drivers/video/fbdev/core/fbcon_ud.c
@@ -255,8 +255,8 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.width + 7) >> 3, c;
- int y = real_y(ops->p, vc->vc_y);
- int attribute, use_sw = (vc->vc_cursor_type & 0x10);
+ int y = real_y(ops->p, vc->state.y);
+ int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
int err = 1, dx, dy;
char *src;
u32 vyres = GETVYRES(ops->p->scrollmode, info);
@@ -315,7 +315,7 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
}
dy = vyres - ((y * vc->vc_font.height) + vc->vc_font.height);
- dx = vxres - ((vc->vc_x * vc->vc_font.width) + vc->vc_font.width);
+ dx = vxres - ((vc->state.x * vc->vc_font.width) + vc->vc_font.width);
if (ops->cursor_state.image.dx != dx ||
ops->cursor_state.image.dy != dy ||
@@ -348,7 +348,7 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE;
- switch (ops->p->cursor_shape & CUR_HWMASK) {
+ switch (CUR_SIZE(ops->p->cursor_shape)) {
case CUR_NONE:
cur_height = 0;
break;
diff --git a/drivers/video/fbdev/core/tileblit.c b/drivers/video/fbdev/core/tileblit.c
index 93390312957f..1dfaff0881fb 100644
--- a/drivers/video/fbdev/core/tileblit.c
+++ b/drivers/video/fbdev/core/tileblit.c
@@ -83,10 +83,10 @@ static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode,
int softback_lines, int fg, int bg)
{
struct fb_tilecursor cursor;
- int use_sw = (vc->vc_cursor_type & 0x10);
+ int use_sw = vc->vc_cursor_type & CUR_SW;
- cursor.sx = vc->vc_x;
- cursor.sy = vc->vc_y;
+ cursor.sx = vc->state.x;
+ cursor.sy = vc->state.y;
cursor.mode = (mode == CM_ERASE || use_sw) ? 0 : 1;
cursor.fg = fg;
cursor.bg = bg;