vidcontrol.c (199174) | vidcontrol.c (205855) |
---|---|
1/*- 2 * Copyright (c) 1994-1996 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Portions of this software are based in part on the work of 6 * Sascha Wildner <saw@online.de> contributed to The DragonFly Project 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.10 2005/03/02 06:08:29 joerg Exp $ 32 */ 33 34#ifndef lint 35static const char rcsid[] = | 1/*- 2 * Copyright (c) 1994-1996 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Portions of this software are based in part on the work of 6 * Sascha Wildner <saw@online.de> contributed to The DragonFly Project 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.10 2005/03/02 06:08:29 joerg Exp $ 32 */ 33 34#ifndef lint 35static const char rcsid[] = |
36 "$FreeBSD: head/usr.sbin/vidcontrol/vidcontrol.c 199174 2009-11-11 08:39:57Z ed $"; | 36 "$FreeBSD: head/usr.sbin/vidcontrol/vidcontrol.c 205855 2010-03-29 20:12:44Z jkim $"; |
37#endif /* not lint */ 38 39#include <ctype.h> 40#include <err.h> 41#include <limits.h> 42#include <stdio.h> 43#include <stdlib.h> 44#include <string.h> --- 900 unchanged lines hidden (view full) --- 945 946/* 947 * Show video mode information. 948 */ 949 950static void 951show_mode_info(void) 952{ | 37#endif /* not lint */ 38 39#include <ctype.h> 40#include <err.h> 41#include <limits.h> 42#include <stdio.h> 43#include <stdlib.h> 44#include <string.h> --- 900 unchanged lines hidden (view full) --- 945 946/* 947 * Show video mode information. 948 */ 949 950static void 951show_mode_info(void) 952{ |
953 struct video_info _info; | |
954 char buf[80]; | 953 char buf[80]; |
955 int mode; | 954 struct video_info _info; |
956 int c; | 955 int c; |
956 int mm; 957 int mode; |
|
957 958 printf(" mode# flags type size " 959 "font window linear buffer\n"); 960 printf("---------------------------------------" 961 "---------------------------------------\n"); 962 963 for (mode = 0; mode < M_VESA_MODE_MAX; ++mode) { 964 _info.vi_mode = mode; 965 if (ioctl(0, CONS_MODEINFO, &_info)) 966 continue; 967 if (_info.vi_mode != mode) 968 continue; 969 970 printf("%3d (0x%03x)", mode, mode); 971 printf(" 0x%08x", _info.vi_flags); 972 if (_info.vi_flags & V_INFO_GRAPHICS) { 973 c = 'G'; 974 | 958 959 printf(" mode# flags type size " 960 "font window linear buffer\n"); 961 printf("---------------------------------------" 962 "---------------------------------------\n"); 963 964 for (mode = 0; mode < M_VESA_MODE_MAX; ++mode) { 965 _info.vi_mode = mode; 966 if (ioctl(0, CONS_MODEINFO, &_info)) 967 continue; 968 if (_info.vi_mode != mode) 969 continue; 970 971 printf("%3d (0x%03x)", mode, mode); 972 printf(" 0x%08x", _info.vi_flags); 973 if (_info.vi_flags & V_INFO_GRAPHICS) { 974 c = 'G'; 975 |
975 snprintf(buf, sizeof(buf), "%dx%dx%d %d", 976 _info.vi_width, _info.vi_height, 977 _info.vi_depth, _info.vi_planes); | 976 if (_info.vi_mem_model == V_INFO_MM_PLANAR) 977 snprintf(buf, sizeof(buf), "%dx%dx%d %d", 978 _info.vi_width, _info.vi_height, 979 _info.vi_depth, _info.vi_planes); 980 else { 981 switch (_info.vi_mem_model) { 982 case V_INFO_MM_PACKED: 983 mm = 'P'; 984 break; 985 case V_INFO_MM_DIRECT: 986 mm = 'D'; 987 break; 988 case V_INFO_MM_CGA: 989 mm = 'C'; 990 break; 991 case V_INFO_MM_HGC: 992 mm = 'H'; 993 break; 994 case V_INFO_MM_VGAX: 995 mm = 'V'; 996 break; 997 default: 998 mm = ' '; 999 break; 1000 } 1001 snprintf(buf, sizeof(buf), "%dx%dx%d %c", 1002 _info.vi_width, _info.vi_height, 1003 _info.vi_depth, mm); 1004 } |
978 } else { 979 c = 'T'; 980 981 snprintf(buf, sizeof(buf), "%dx%d", 982 _info.vi_width, _info.vi_height); 983 } 984 985 printf(" %c %-15s", c, buf); --- 319 unchanged lines hidden --- | 1005 } else { 1006 c = 'T'; 1007 1008 snprintf(buf, sizeof(buf), "%dx%d", 1009 _info.vi_width, _info.vi_height); 1010 } 1011 1012 printf(" %c %-15s", c, buf); --- 319 unchanged lines hidden --- |