forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/video/console/vgacon.c
....@@ -113,9 +113,9 @@
113113 {
114114 vgacon_text_mode_force = true;
115115
116
- pr_warning("You have booted with nomodeset. This means your GPU drivers are DISABLED\n");
117
- pr_warning("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n");
118
- pr_warning("Unless you actually understand what nomodeset does, you should reboot without enabling it\n");
116
+ pr_warn("You have booted with nomodeset. This means your GPU drivers are DISABLED\n");
117
+ pr_warn("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n");
118
+ pr_warn("Unless you actually understand what nomodeset does, you should reboot without enabling it\n");
119119
120120 return 1;
121121 }
....@@ -421,8 +421,10 @@
421421 con_set_default_unimap(c);
422422 }
423423
424
-static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
425
- u8 blink, u8 underline, u8 reverse, u8 italic)
424
+static u8 vgacon_build_attr(struct vc_data *c, u8 color,
425
+ enum vc_intensity intensity,
426
+ bool blink, bool underline, bool reverse,
427
+ bool italic)
426428 {
427429 u8 attr = color;
428430
....@@ -431,7 +433,7 @@
431433 attr = (attr & 0xF0) | c->vc_itcolor;
432434 else if (underline)
433435 attr = (attr & 0xf0) | c->vc_ulcolor;
434
- else if (intensity == 0)
436
+ else if (intensity == VCI_HALF_BRIGHT)
435437 attr = (attr & 0xf0) | c->vc_halfcolor;
436438 }
437439 if (reverse)
....@@ -440,14 +442,14 @@
440442 0x77);
441443 if (blink)
442444 attr ^= 0x80;
443
- if (intensity == 2)
445
+ if (intensity == VCI_BOLD)
444446 attr ^= 0x08;
445447 if (!vga_can_do_color) {
446448 if (italic)
447449 attr = (attr & 0xF8) | 0x02;
448450 else if (underline)
449451 attr = (attr & 0xf8) | 0x01;
450
- else if (intensity == 0)
452
+ else if (intensity == VCI_HALF_BRIGHT)
451453 attr = (attr & 0xf0) | 0x08;
452454 }
453455 return attr;
....@@ -510,17 +512,17 @@
510512 case CM_ERASE:
511513 write_vga(14, (c->vc_pos - vga_vram_base) / 2);
512514 if (vga_video_type >= VIDEO_TYPE_VGAC)
513
- vgacon_set_cursor_size(c->vc_x, 31, 30);
515
+ vgacon_set_cursor_size(c->state.x, 31, 30);
514516 else
515
- vgacon_set_cursor_size(c->vc_x, 31, 31);
517
+ vgacon_set_cursor_size(c->state.x, 31, 31);
516518 break;
517519
518520 case CM_MOVE:
519521 case CM_DRAW:
520522 write_vga(14, (c->vc_pos - vga_vram_base) / 2);
521
- switch (c->vc_cursor_type & 0x0f) {
523
+ switch (CUR_SIZE(c->vc_cursor_type)) {
522524 case CUR_UNDERLINE:
523
- vgacon_set_cursor_size(c->vc_x,
525
+ vgacon_set_cursor_size(c->state.x,
524526 c->vc_cell_height -
525527 (c->vc_cell_height <
526528 10 ? 2 : 3),
....@@ -529,21 +531,21 @@
529531 10 ? 1 : 2));
530532 break;
531533 case CUR_TWO_THIRDS:
532
- vgacon_set_cursor_size(c->vc_x,
534
+ vgacon_set_cursor_size(c->state.x,
533535 c->vc_cell_height / 3,
534536 c->vc_cell_height -
535537 (c->vc_cell_height <
536538 10 ? 1 : 2));
537539 break;
538540 case CUR_LOWER_THIRD:
539
- vgacon_set_cursor_size(c->vc_x,
541
+ vgacon_set_cursor_size(c->state.x,
540542 (c->vc_cell_height * 2) / 3,
541543 c->vc_cell_height -
542544 (c->vc_cell_height <
543545 10 ? 1 : 2));
544546 break;
545547 case CUR_LOWER_HALF:
546
- vgacon_set_cursor_size(c->vc_x,
548
+ vgacon_set_cursor_size(c->state.x,
547549 c->vc_cell_height / 2,
548550 c->vc_cell_height -
549551 (c->vc_cell_height <
....@@ -551,12 +553,12 @@
551553 break;
552554 case CUR_NONE:
553555 if (vga_video_type >= VIDEO_TYPE_VGAC)
554
- vgacon_set_cursor_size(c->vc_x, 31, 30);
556
+ vgacon_set_cursor_size(c->state.x, 31, 30);
555557 else
556
- vgacon_set_cursor_size(c->vc_x, 31, 31);
558
+ vgacon_set_cursor_size(c->state.x, 31, 31);
557559 break;
558560 default:
559
- vgacon_set_cursor_size(c->vc_x, 1,
561
+ vgacon_set_cursor_size(c->state.x, 1,
560562 c->vc_cell_height);
561563 break;
562564 }
....@@ -1151,8 +1153,8 @@
11511153 * console initialization routines.
11521154 */
11531155 vga_bootup_console = 1;
1154
- c->vc_x = screen_info.orig_x;
1155
- c->vc_y = screen_info.orig_y;
1156
+ c->state.x = screen_info.orig_x;
1157
+ c->state.y = screen_info.orig_y;
11561158 }
11571159
11581160 /* We can't copy in more than the size of the video buffer,