From owner-svn-src-head@FreeBSD.ORG Wed Aug 28 23:43:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FC6C703; Wed, 28 Aug 2013 23:43:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC452130; Wed, 28 Aug 2013 23:43:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7SNhSjo075319; Wed, 28 Aug 2013 23:43:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7SNhSRS075318; Wed, 28 Aug 2013 23:43:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308282343.r7SNhSRS075318@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Aug 2013 23:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255012 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2013 23:43:28 -0000 Author: jkim Date: Wed Aug 28 23:43:28 2013 New Revision: 255012 URL: http://svnweb.freebsd.org/changeset/base/255012 Log: Fix a compiler warning and add couple of VM map types. Modified: head/sys/dev/drm2/drm_sysctl.c Modified: head/sys/dev/drm2/drm_sysctl.c ============================================================================== --- head/sys/dev/drm2/drm_sysctl.c Wed Aug 28 23:15:05 2013 (r255011) +++ head/sys/dev/drm2/drm_sysctl.c Wed Aug 28 23:43:28 2013 (r255012) @@ -177,7 +177,15 @@ static int drm_vm_info DRM_SYSCTL_HANDLE { struct drm_device *dev = arg1; drm_local_map_t *map, *tempmaps; - const char *types[] = { "FB", "REG", "SHM", "AGP", "SG" }; + const char *types[] = { + [_DRM_FRAME_BUFFER] = "FB", + [_DRM_REGISTERS] = "REG", + [_DRM_SHM] = "SHM", + [_DRM_AGP] = "AGP", + [_DRM_SCATTER_GATHER] = "SG", + [_DRM_CONSISTENT] = "CONS", + [_DRM_GEM] = "GEM" + }; const char *type, *yesno; int i, mapcount; char buf[128]; @@ -211,10 +219,20 @@ static int drm_vm_info DRM_SYSCTL_HANDLE for (i = 0; i < mapcount; i++) { map = &tempmaps[i]; - if (map->type < 0 || map->type > 4) + switch(map->type) { + default: type = "??"; - else + break; + case _DRM_FRAME_BUFFER: + case _DRM_REGISTERS: + case _DRM_SHM: + case _DRM_AGP: + case _DRM_SCATTER_GATHER: + case _DRM_CONSISTENT: + case _DRM_GEM: type = types[map->type]; + break; + } if (!map->mtrr) yesno = "no";