Lines Matching refs:c

85 static void vgacon_init(struct vc_data *c, int init);
86 static void vgacon_deinit(struct vc_data *c);
87 static void vgacon_cursor(struct vc_data *c, int mode);
88 static int vgacon_switch(struct vc_data *c);
89 static int vgacon_blank(struct vc_data *c, int blank);
90 static int vgacon_font_op(struct vc_data *c, struct console_font_op *op);
91 static int vgacon_set_palette(struct vc_data *c, unsigned char *table);
92 static int vgacon_scrolldelta(struct vc_data *c, int lines);
93 static int vgacon_set_origin(struct vc_data *c);
94 static void vgacon_save_screen(struct vc_data *c);
95 static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, int lines);
96 static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, u8 blink, u8 underline, u8 r…
97 static void vgacon_invert_region(struct vc_data *c, u16 *p, int count);
325 static void vgacon_init(struct vc_data *c, int init) in vgacon_init() argument
330 c->vc_can_do_color = vga_can_do_color; in vgacon_init()
331 c->vc_cols = vga_video_num_columns; in vgacon_init()
332 c->vc_rows = vga_video_num_lines; in vgacon_init()
333 c->vc_complement_mask = 0x7700; in vgacon_init()
334 p = *c->vc_uni_pagedir_loc; in vgacon_init()
335 if (c->vc_uni_pagedir_loc == &c->vc_uni_pagedir || in vgacon_init()
336 !--c->vc_uni_pagedir_loc[1]) in vgacon_init()
337 con_free_unimap(c->vc_num); in vgacon_init()
338 c->vc_uni_pagedir_loc = vgacon_uni_pagedir; in vgacon_init()
341 con_set_default_unimap(c->vc_num); in vgacon_init()
344 static inline void vga_set_mem_top(struct vc_data *c) in vga_set_mem_top() argument
346 write_vga(12, (c->vc_visible_origin-vga_vram_base)/2); in vga_set_mem_top()
349 static void vgacon_deinit(struct vc_data *c) in vgacon_deinit() argument
353 c->vc_visible_origin = vga_vram_base; in vgacon_deinit()
354 vga_set_mem_top(c); in vgacon_deinit()
355 con_free_unimap(c->vc_num); in vgacon_deinit()
357 c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; in vgacon_deinit()
358 con_set_default_unimap(c->vc_num); in vgacon_deinit()
361 static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, u8 blink, u8 underline, u8 r… in vgacon_build_attr() argument
367 attr = (attr & 0xf0) | c->vc_ulcolor; in vgacon_build_attr()
369 attr = (attr & 0xf0) | c->vc_halfcolor; in vgacon_build_attr()
386 static void vgacon_invert_region(struct vc_data *c, u16 *p, int count) in vgacon_invert_region() argument
429 static void vgacon_cursor(struct vc_data *c, int mode) in vgacon_cursor() argument
431 if (c->vc_origin != c->vc_visible_origin) in vgacon_cursor()
432 vgacon_scrolldelta(c, 0); in vgacon_cursor()
440 write_vga(14, (c->vc_pos-vga_vram_base)/2); in vgacon_cursor()
441 switch (c->vc_cursor_type & 0x0f) { in vgacon_cursor()
443 vgacon_set_cursor_size(c->vc_x, in vgacon_cursor()
448 vgacon_set_cursor_size(c->vc_x, in vgacon_cursor()
453 vgacon_set_cursor_size(c->vc_x, in vgacon_cursor()
458 vgacon_set_cursor_size(c->vc_x, in vgacon_cursor()
463 vgacon_set_cursor_size(c->vc_x, 31, 30); in vgacon_cursor()
466 vgacon_set_cursor_size(c->vc_x, 1, video_font_height); in vgacon_cursor()
473 static int vgacon_switch(struct vc_data *c) in vgacon_switch() argument
480 vga_video_num_columns = c->vc_cols; in vgacon_switch()
481 vga_video_num_lines = c->vc_rows; in vgacon_switch()
483 scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf, c->vc_screenbuf_size); in vgacon_switch()
487 static void vga_set_palette(struct vc_data *c, unsigned char *table) in vga_set_palette() argument
493 outb_p (c->vc_palette[j++]>>2, dac_val) ; in vga_set_palette()
494 outb_p (c->vc_palette[j++]>>2, dac_val) ; in vga_set_palette()
495 outb_p (c->vc_palette[j++]>>2, dac_val) ; in vga_set_palette()
499 static int vgacon_set_palette(struct vc_data *c, unsigned char *table) in vgacon_set_palette() argument
502 if (vga_video_type != VIDEO_TYPE_VGAC || vga_palette_blanked || !CON_IS_VISIBLE(c)) in vgacon_set_palette()
504 vga_set_palette(c, table); in vgacon_set_palette()
642 static int vgacon_blank(struct vc_data *c, int blank) in vgacon_blank() argument
651 vga_set_palette(c, color_table); in vgacon_blank()
664 vgacon_set_origin(c); in vgacon_blank()
665 scr_memsetw((void *)vga_vram_base, BLANK, c->vc_screenbuf_size); in vgacon_blank()
668 scr_memsetw((void *)vga_vram_base, BLANK, c->vc_screenbuf_size); in vgacon_blank()
816 struct vc_data *c = vc_cons[i].d; in vgacon_do_font_op() local
817 if (c && c->vc_sw == &vga_con) in vgacon_do_font_op()
818 c->vc_hi_font_mask = ch512 ? 0x0800 : 0; in vgacon_do_font_op()
888 static int vgacon_font_op(struct vc_data *c, struct console_font_op *op) in vgacon_font_op() argument
914 static int vgacon_font_op(struct vc_data *c, struct console_font_op *op) in vgacon_font_op() argument
921 static int vgacon_scrolldelta(struct vc_data *c, int lines) in vgacon_scrolldelta() argument
924 c->vc_visible_origin = c->vc_origin; in vgacon_scrolldelta()
927 int margin = c->vc_size_row * 4; in vgacon_scrolldelta()
930 if (vga_rolled_over > (c->vc_scr_end - vga_vram_base) + margin) { in vgacon_scrolldelta()
931 ul = c->vc_scr_end - vga_vram_base; in vgacon_scrolldelta()
932 we = vga_rolled_over + c->vc_size_row; in vgacon_scrolldelta()
937 p = (c->vc_visible_origin - vga_vram_base - ul + we) % we + lines * c->vc_size_row; in vgacon_scrolldelta()
938 st = (c->vc_origin - vga_vram_base - ul + we) % we; in vgacon_scrolldelta()
943 c->vc_visible_origin = vga_vram_base + (p + ul) % we; in vgacon_scrolldelta()
945 vga_set_mem_top(c); in vgacon_scrolldelta()
949 static int vgacon_set_origin(struct vc_data *c) in vgacon_set_origin() argument
954 c->vc_origin = c->vc_visible_origin = vga_vram_base; in vgacon_set_origin()
955 vga_set_mem_top(c); in vgacon_set_origin()
960 static void vgacon_save_screen(struct vc_data *c) in vgacon_save_screen() argument
970 c->vc_x = ORIG_X; in vgacon_save_screen()
971 c->vc_y = ORIG_Y; in vgacon_save_screen()
974 scr_memcpyw((u16 *) c->vc_screenbuf, (u16 *) c->vc_origin, c->vc_screenbuf_size); in vgacon_save_screen()
977 static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) in vgacon_scroll() argument
982 if (t || b != c->vc_rows || vga_is_gfx) in vgacon_scroll()
985 if (c->vc_origin != c->vc_visible_origin) in vgacon_scroll()
986 vgacon_scrolldelta(c, 0); in vgacon_scroll()
988 if (!vga_hardscroll_enabled || lines >= c->vc_rows/2) in vgacon_scroll()
991 oldo = c->vc_origin; in vgacon_scroll()
992 delta = lines * c->vc_size_row; in vgacon_scroll()
994 if (c->vc_scr_end + delta >= vga_vram_end) { in vgacon_scroll()
997 c->vc_screenbuf_size - delta); in vgacon_scroll()
998 c->vc_origin = vga_vram_base; in vgacon_scroll()
1001 c->vc_origin += delta; in vgacon_scroll()
1002 scr_memsetw((u16 *)(c->vc_origin + c->vc_screenbuf_size - delta), c->vc_video_erase_char, delta); in vgacon_scroll()
1005 scr_memmovew((u16 *)(vga_vram_end - c->vc_screenbuf_size + delta), in vgacon_scroll()
1007 c->vc_screenbuf_size - delta); in vgacon_scroll()
1008 c->vc_origin = vga_vram_end - c->vc_screenbuf_size; in vgacon_scroll()
1011 c->vc_origin -= delta; in vgacon_scroll()
1012 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; in vgacon_scroll()
1013 scr_memsetw((u16 *)(c->vc_origin), c->vc_video_erase_char, delta); in vgacon_scroll()
1015 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; in vgacon_scroll()
1016 c->vc_visible_origin = c->vc_origin; in vgacon_scroll()
1017 vga_set_mem_top(c); in vgacon_scroll()
1018 c->vc_pos = (c->vc_pos - oldo) + c->vc_origin; in vgacon_scroll()
1027 static int vgacon_dummy(struct vc_data *c) in vgacon_dummy() argument