Date: Wed, 31 Mar 2010 16:01:48 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r205985 - stable/8/usr.sbin/vidcontrol Message-ID: <201003311601.o2VG1mkR054432@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Wed Mar 31 16:01:48 2010 New Revision: 205985 URL: http://svn.freebsd.org/changeset/base/205985 Log: MFC: r205855 Print memory model of the video mode except for planar memory model. 'P', 'D', 'C', 'H', and 'V' mean packed pixel, direct color, CGA, Hercules, and VGA X memory models respectively where they have fixed number of planes. Modified: stable/8/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: stable/8/usr.sbin/vidcontrol/ (props changed) Modified: stable/8/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- stable/8/usr.sbin/vidcontrol/vidcontrol.c Wed Mar 31 15:49:10 2010 (r205984) +++ stable/8/usr.sbin/vidcontrol/vidcontrol.c Wed Mar 31 16:01:48 2010 (r205985) @@ -950,10 +950,11 @@ show_adapter_info(void) static void show_mode_info(void) { - struct video_info _info; char buf[80]; - int mode; + struct video_info _info; int c; + int mm; + int mode; printf(" mode# flags type size " "font window linear buffer\n"); @@ -972,9 +973,35 @@ show_mode_info(void) if (_info.vi_flags & V_INFO_GRAPHICS) { c = 'G'; - snprintf(buf, sizeof(buf), "%dx%dx%d %d", - _info.vi_width, _info.vi_height, - _info.vi_depth, _info.vi_planes); + if (_info.vi_mem_model == V_INFO_MM_PLANAR) + snprintf(buf, sizeof(buf), "%dx%dx%d %d", + _info.vi_width, _info.vi_height, + _info.vi_depth, _info.vi_planes); + else { + switch (_info.vi_mem_model) { + case V_INFO_MM_PACKED: + mm = 'P'; + break; + case V_INFO_MM_DIRECT: + mm = 'D'; + break; + case V_INFO_MM_CGA: + mm = 'C'; + break; + case V_INFO_MM_HGC: + mm = 'H'; + break; + case V_INFO_MM_VGAX: + mm = 'V'; + break; + default: + mm = ' '; + break; + } + snprintf(buf, sizeof(buf), "%dx%dx%d %c", + _info.vi_width, _info.vi_height, + _info.vi_depth, mm); + } } else { c = 'T';
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003311601.o2VG1mkR054432>