xf86-video-intel: configure.ac src/sna/kgem.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue Mar 26 13:18:58 PDT 2013
configure.ac | 2 +-
src/sna/kgem.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 3dddb01005274376c8cdc5eecad36d4e0723004a
Author: Mark Kettenis <kettenis at openbsd.org>
Date: Tue Mar 26 20:50:53 2013 +0100
sna: Use a more portable way to determine total RAM size
The sysinfo function is Linux-specific. sysconf(_SC_PHYS_PAGES), while
not truly portable, is available on many more systems, including Linux,
Solaris, NetBSD, FreeBSD and OpenBSD. So use that instead. Verified
that this results in the same value as the sysinfo call on a handful of
Linux systems.
Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
diff --git a/configure.ac b/configure.ac
index de3990d..8b12d01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -200,12 +200,12 @@ AC_ARG_ENABLE(sna,
[SNA="$enableval"],
[SNA=auto])
-AC_CHECK_HEADERS([sys/sysinfo.h], , SNA=no)
if test "x$SNA" = "xauto" && pkg-config --exists "xorg-server >= 1.10"; then
SNA=yes
fi
if test "x$SNA" != "xno"; then
AC_DEFINE(USE_SNA, 1, [Enable SNA support])
+ AC_CHECK_HEADERS([sys/sysinfo.h])
fi
AC_MSG_CHECKING([whether to include SNA support])
AM_CONDITIONAL(SNA, test x$SNA != xno)
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index c6ed114..231dc8e 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -647,6 +647,10 @@ total_ram_size(void)
return info.totalram * info.mem_unit;
#endif
+#ifdef _SC_PHYS_PAGES
+ return sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
+#endif
+
return 0;
}
More information about the xorg-commit
mailing list