Lines Matching +full:next +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
2 /* -----------------------------------------------------------------------
6 * ----------------------------------------------------------------------- */
29 u32 mode; member
38 static bool parse_modenum(char *option, char **next) in parse_modenum() argument
42 if (!strstarts(option, "mode=")) in parse_modenum()
44 option += strlen("mode="); in parse_modenum()
49 cmdline.mode = m; in parse_modenum()
51 *next = option; in parse_modenum()
55 static bool parse_res(char *option, char **next) in parse_res() argument
58 int pf = -1; in parse_res()
66 if (*option == '-') { in parse_res()
87 *next = option; in parse_res()
91 static bool parse_auto(char *option, char **next) in parse_auto() argument
100 *next = option; in parse_auto()
104 static bool parse_list(char *option, char **next) in parse_list() argument
113 *next = option; in parse_list()
138 efi_graphics_output_protocol_mode_t *mode; in choose_mode_modenum() local
145 mode = efi_table_attr(gop, mode); in choose_mode_modenum()
147 cur_mode = efi_table_attr(mode, mode); in choose_mode_modenum()
148 if (cmdline.mode == cur_mode) in choose_mode_modenum()
151 max_mode = efi_table_attr(mode, max_mode); in choose_mode_modenum()
152 if (cmdline.mode >= max_mode) { in choose_mode_modenum()
153 efi_err("Requested mode is invalid\n"); in choose_mode_modenum()
157 status = efi_call_proto(gop, query_mode, cmdline.mode, in choose_mode_modenum()
160 efi_err("Couldn't get mode information\n"); in choose_mode_modenum()
164 pf = info->pixel_format; in choose_mode_modenum()
173 return cmdline.mode; in choose_mode_modenum()
183 return __fls(mask) - __ffs(mask) + 1; in pixel_bpp()
192 efi_graphics_output_protocol_mode_t *mode; in choose_mode_res() local
201 mode = efi_table_attr(gop, mode); in choose_mode_res()
203 cur_mode = efi_table_attr(mode, mode); in choose_mode_res()
204 info = efi_table_attr(mode, info); in choose_mode_res()
205 pf = info->pixel_format; in choose_mode_res()
206 pi = info->pixel_information; in choose_mode_res()
207 w = info->horizontal_resolution; in choose_mode_res()
208 h = info->vertical_resolution; in choose_mode_res()
215 max_mode = efi_table_attr(mode, max_mode); in choose_mode_res()
226 pf = info->pixel_format; in choose_mode_res()
227 pi = info->pixel_information; in choose_mode_res()
228 w = info->horizontal_resolution; in choose_mode_res()
229 h = info->vertical_resolution; in choose_mode_res()
241 efi_err("Couldn't find requested mode\n"); in choose_mode_res()
250 efi_graphics_output_protocol_mode_t *mode; in choose_mode_auto() local
261 mode = efi_table_attr(gop, mode); in choose_mode_auto()
263 cur_mode = efi_table_attr(mode, mode); in choose_mode_auto()
264 max_mode = efi_table_attr(mode, max_mode); in choose_mode_auto()
266 info = efi_table_attr(mode, info); in choose_mode_auto()
268 pf = info->pixel_format; in choose_mode_auto()
269 pi = info->pixel_information; in choose_mode_auto()
270 w = info->horizontal_resolution; in choose_mode_auto()
271 h = info->vertical_resolution; in choose_mode_auto()
286 pf = info->pixel_format; in choose_mode_auto()
287 pi = info->pixel_information; in choose_mode_auto()
288 w = info->horizontal_resolution; in choose_mode_auto()
289 h = info->vertical_resolution; in choose_mode_auto()
313 efi_graphics_output_protocol_mode_t *mode; in choose_mode_list() local
326 mode = efi_table_attr(gop, mode); in choose_mode_list()
328 cur_mode = efi_table_attr(mode, mode); in choose_mode_list()
329 max_mode = efi_table_attr(mode, max_mode); in choose_mode_list()
331 efi_printk("Available graphics modes are 0-%u\n", max_mode-1); in choose_mode_list()
332 efi_puts(" * = current mode\n" in choose_mode_list()
333 " - = unusable mode\n"); in choose_mode_list()
340 pf = info->pixel_format; in choose_mode_list()
341 pi = info->pixel_information; in choose_mode_list()
342 w = info->horizontal_resolution; in choose_mode_list()
343 h = info->vertical_resolution; in choose_mode_list()
368 efi_printk("Mode %3u %c%c: Resolution %ux%u-%s%.0hhu\n", in choose_mode_list()
371 !valid ? '-' : ' ', in choose_mode_list()
387 efi_graphics_output_protocol_mode_t *mode; in set_mode() local
407 mode = efi_table_attr(gop, mode); in set_mode()
408 cur_mode = efi_table_attr(mode, mode); in set_mode()
414 efi_err("Failed to set requested mode\n"); in set_mode()
426 *size = __fls(mask) - *pos + 1; in find_bits()
435 &si->red_pos, &si->red_size); in setup_pixel_info()
437 &si->green_pos, &si->green_size); in setup_pixel_info()
439 &si->blue_pos, &si->blue_size); in setup_pixel_info()
441 &si->rsvd_pos, &si->rsvd_size); in setup_pixel_info()
442 si->lfb_depth = si->red_size + si->green_size + in setup_pixel_info()
443 si->blue_size + si->rsvd_size; in setup_pixel_info()
444 si->lfb_linelength = (pixels_per_scan_line * si->lfb_depth) / 8; in setup_pixel_info()
447 si->red_pos = 0; in setup_pixel_info()
448 si->blue_pos = 16; in setup_pixel_info()
450 si->blue_pos = 0; in setup_pixel_info()
451 si->red_pos = 16; in setup_pixel_info()
454 si->green_pos = 8; in setup_pixel_info()
455 si->rsvd_pos = 24; in setup_pixel_info()
456 si->red_size = si->green_size = in setup_pixel_info()
457 si->blue_size = si->rsvd_size = 8; in setup_pixel_info()
459 si->lfb_depth = 32; in setup_pixel_info()
460 si->lfb_linelength = pixels_per_scan_line * 4; in setup_pixel_info()
477 efi_graphics_output_protocol_mode_t *mode; in find_gop() local
487 mode = efi_table_attr(gop, mode); in find_gop()
488 info = efi_table_attr(mode, info); in find_gop()
489 if (info->pixel_format == PIXEL_BLT_ONLY || in find_gop()
490 info->pixel_format >= PIXEL_FORMAT_MAX) in find_gop()
518 efi_graphics_output_protocol_mode_t *mode; in setup_gop() local
527 /* Change mode if requested */ in setup_gop()
531 mode = efi_table_attr(gop, mode); in setup_gop()
532 info = efi_table_attr(mode, info); in setup_gop()
534 si->orig_video_isVGA = VIDEO_TYPE_EFI; in setup_gop()
536 si->lfb_width = info->horizontal_resolution; in setup_gop()
537 si->lfb_height = info->vertical_resolution; in setup_gop()
539 efi_set_u64_split(efi_table_attr(mode, frame_buffer_base), in setup_gop()
540 &si->lfb_base, &si->ext_lfb_base); in setup_gop()
541 if (si->ext_lfb_base) in setup_gop()
542 si->capabilities |= VIDEO_CAPABILITY_64BIT_BASE; in setup_gop()
544 si->pages = 1; in setup_gop()
546 setup_pixel_info(si, info->pixels_per_scan_line, in setup_gop()
547 info->pixel_information, info->pixel_format); in setup_gop()
549 si->lfb_size = si->lfb_linelength * si->lfb_height; in setup_gop()
551 si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS; in setup_gop()