Date: Wed, 28 Aug 2013 23:43:28 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255012 - head/sys/dev/drm2 Message-ID: <201308282343.r7SNhSRS075318@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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";
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308282343.r7SNhSRS075318>