Lines Matching +full:y +full:- +full:rp

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
59 * palette array for 8-bit indexed colors. In this case, cmap does store
108 if (strcasecmp(res->name, cmp) == 0) in vbe_resolution_compare()
110 if (res->alias != NULL && strcasecmp(res->alias, cmp) == 0) in vbe_resolution_compare()
132 *width = res->width; in vbe_get_max_resolution()
133 *height = res->height; in vbe_get_max_resolution()
243 return ((vbe->Capabilities & VBE_CAP_NONVGA) == 0); in vbe_is_vga()
252 if (vbe->Capabilities & VBE_CAP_DAC8) { in bios_set_text_mode()
257 * 6 bits, but apparently some systems do fail with 8-bit in bios_set_text_mode()
258 * palette, so we switch to 6-bit here. in bios_set_text_mode()
278 gfx_state.tg_fb.fb_mask_red = (1 << palette_format) - 1 << 16; in bios_set_text_mode()
279 gfx_state.tg_fb.fb_mask_green = (1 << palette_format) - 1 << 8; in bios_set_text_mode()
280 gfx_state.tg_fb.fb_mask_blue = (1 << palette_format) - 1 << 0; in bios_set_text_mode()
285 /* Function 00h - Return VBE Controller Information */
301 memcpy(rvbe->VbeSignature, "VBE2", 4); in biosvbe_info()
314 if (memcmp(rvbe->VbeSignature, "VESA", 4) != 0) { in biosvbe_info()
324 /* Function 01h - Return VBE Mode Information */
352 /* Function 02h - Set VBE Mode */
358 if (vbe->Capabilities & VBE_CAP_DAC8) { in biosvbe_set_mode()
363 * 6 bits, but apparently some systems do fail with 8-bit in biosvbe_set_mode()
364 * palette, so we switch to 6-bit here. in biosvbe_set_mode()
378 if (vbe->Capabilities & VBE_CAP_DAC8) { in biosvbe_set_mode()
381 /* Switch to 8-bits per primary color. */ in biosvbe_set_mode()
390 /* Function 03h - Get VBE Mode */
398 *mode = v86.ebx & 0x3fff; /* Bits 0-13 */ in biosvbe_get_mode()
402 /* Function 08h - Set/Get DAC Palette Format */
415 /* Function 09h - Set/Get Palette Data */
432 * Function 15h BL=00h - Report VBE/DDC Capabilities
453 /* Function 11h BL=01h - Flat Panel status */
467 /* Function 15h BL=01h - Read EDID */
486 if ((mi->ModeAttributes & 0x01) == 0) in vbe_mode_is_supported()
488 if ((mi->ModeAttributes & 0x08) == 0) in vbe_mode_is_supported()
490 if ((mi->ModeAttributes & 0x10) == 0) in vbe_mode_is_supported()
492 if (mi->NumberOfPlanes != 1) in vbe_mode_is_supported()
494 if (mi->MemoryModel != 0x04 /* Packed pixel */ && in vbe_mode_is_supported()
495 mi->MemoryModel != 0x06 /* Direct Color */) in vbe_mode_is_supported()
516 if (strcmp(ev->ev_name, "screen.textmode") == 0) { in mode_set()
536 } else if (strcmp(ev->ev_name, "vbe_max_resolution") == 0) { in mode_set()
602 p = ml = vbe_farptr(vbe->VideoModePtr); in vbe_init()
606 vbe_mode_list_size = (uintptr_t)p - (uintptr_t)ml; in vbe_init()
620 vbe->VideoModePtr = 0; in vbe_init()
637 if (!vbe_check() || (vbe->Capabilities & VBE_CAP_DAC8) == 0) in vbe_set_palette()
644 pe.Blue = entry->Blue; in vbe_set_palette()
645 pe.Green = entry->Green; in vbe_set_palette()
646 pe.Red = entry->Red; in vbe_set_palette()
647 pe.Reserved = entry->Reserved; in vbe_set_palette()
649 if (vbe->Capabilities & VBE_CAP_SNOW) in vbe_set_palette()
731 #define COLOR_MASK(size, pos) (((1 << size) - 1) << pos) in vbe_set_mode()
736 } else if (vbe->VbeVersion >= 0x300) { in vbe_set_mode()
755 if (vbe->VbeVersion >= 0x300) in vbe_set_mode()
771 vbe_find_mode_xydm(int x, int y, int depth, int m) in vbe_find_mode_xydm() argument
782 if (m != -1) in vbe_find_mode_xydm()
784 else if (depth == -1) in vbe_find_mode_xydm()
804 if (m != -1) { in vbe_find_mode_xydm()
812 mi.YResolution == y && in vbe_find_mode_xydm()
816 if (depth != -1) in vbe_find_mode_xydm()
819 i -= 8; in vbe_find_mode_xydm()
828 int x, y, depth; in vbe_find_mode() local
830 if (!gfx_parse_mode_str(str, &x, &y, &depth)) in vbe_find_mode()
833 return (vbe_find_mode_xydm(x, y, depth, -1)); in vbe_find_mode()
840 mi->XResolution, mi->YResolution, mi->BitsPerPixel); in vbe_dump_mode()
871 if (edidp->header.version != 1) in vbe_get_edid()
897 *pwidth = fp_info->HSize; in vbe_get_flatpanel()
898 *pheight = fp_info->VSize; in vbe_get_flatpanel()
928 if (vbep->OemStringPtr != 0) in vbe_print_vbe_info()
929 oemstring = vbe_farptr(vbep->OemStringPtr); in vbe_print_vbe_info()
931 if (vbep->OemVendorNamePtr != 0) in vbe_print_vbe_info()
932 oemvendor = vbe_farptr(vbep->OemVendorNamePtr); in vbe_print_vbe_info()
934 if (vbep->OemProductNamePtr != 0) in vbe_print_vbe_info()
935 oemproductname = vbe_farptr(vbep->OemProductNamePtr); in vbe_print_vbe_info()
937 if (vbep->OemProductRevPtr != 0) in vbe_print_vbe_info()
938 oemproductrev = vbe_farptr(vbep->OemProductRevPtr); in vbe_print_vbe_info()
940 printf("VESA VBE Version %d.%d\n%s\n", vbep->VbeVersion >> 8, in vbe_print_vbe_info()
941 vbep->VbeVersion & 0xF, oemstring); in vbe_print_vbe_info()
943 if (vbep->OemSoftwareRev != 0) { in vbe_print_vbe_info()
945 vbep->OemSoftwareRev >> 8, vbep->OemSoftwareRev & 0xF, in vbe_print_vbe_info()
948 vbe_print_memory(vbep->TotalMemory << 16); in vbe_print_vbe_info()
949 printf("Number of Image Pages: %d\n", vbe_mode->LinNumberOfImagePages); in vbe_print_vbe_info()
952 /* List available modes, filter by depth. If depth is -1, list all. */
963 struct resolution *rp; in vbe_modelist() local
980 while ((rp = TAILQ_FIRST(&res)) != NULL) { in vbe_modelist()
981 printf(" %dx%d", rp->width, rp->height); in vbe_modelist()
982 TAILQ_REMOVE(&res, rp, next); in vbe_modelist()
983 free(rp); in vbe_modelist()
996 memcpy(vbe->VbeSignature, "VBE2", 4); in vbe_modelist()
999 if (memcmp(vbe->VbeSignature, "VESA", 4) != 0) in vbe_modelist()
1019 if (depth != -1 && mi.BitsPerPixel != depth) in vbe_modelist()
1075 if (vbe_mode->MemoryModel == 0x6) { in vbe_print_mode()
1084 ffs(gfx_state.tg_fb.fb_mask_red) - 1, in vbe_print_mode()
1086 ffs(gfx_state.tg_fb.fb_mask_green) - 1, in vbe_print_mode()
1088 ffs(gfx_state.tg_fb.fb_mask_blue) - 1, cmap[i]); in vbe_print_mode()
1124 struct resolution *rp; in vbe_default_mode() local
1131 modenum = vbe_find_mode_xydm(width, height, -1, -1); in vbe_default_mode()
1135 while ((rp = TAILQ_FIRST(&res)) != NULL) { in vbe_default_mode()
1138 rp->width, rp->height, -1, -1); in vbe_default_mode()
1140 TAILQ_REMOVE(&res, rp, next); in vbe_default_mode()
1141 free(rp); in vbe_default_mode()
1147 modenum = vbe_find_mode_xydm(width, height, -1, -1); in vbe_default_mode()
1162 int modenum = -1, n; in command_vesa()
1171 n = -1; in command_vesa()
1194 if (argc > 3 || strcmp(argv[2], "-v") != 0) in command_vesa()