summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-06-13 19:35:22 -0700
committerKeith Packard <keithp@keithp.com>2008-06-13 19:35:22 -0700
commita7139cb8511a9d31d9f79bcaae62020d30e09f90 (patch)
tree52d21e9cba96e5e5cdc2b6bb3aef3132320f712c /linux-core
parent73bc18cad8d1c6b4481a199cebf7f0a28d19c2bb (diff)
[intel-gem] show total GTT space in /proc/dri/*/gem_objects
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drmP.h1
-rw-r--r--linux-core/drm_proc.c11
-rw-r--r--linux-core/i915_gem.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index ba25f3a8..392d2ace 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -970,6 +970,7 @@ struct drm_device {
atomic_t pin_memory;
atomic_t gtt_count;
atomic_t gtt_memory;
+ uint32_t gtt_total;
uint32_t invalidate_domains; /* domains pending invalidation */
uint32_t flush_domains; /* domains pending flush */
/*@} */
diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c
index 71d55274..2bbe7eea 100644
--- a/linux-core/drm_proc.c
+++ b/linux-core/drm_proc.c
@@ -654,11 +654,12 @@ static int drm_gem_object_info(char *buf, char **start, off_t offset,
*start = &buf[offset];
*eof = 0;
- DRM_PROC_PRINT ("%d objects\n", atomic_read (&dev->object_count));
- DRM_PROC_PRINT ("%d object bytes\n", atomic_read (&dev->object_memory));
- DRM_PROC_PRINT ("%d pinned\n", atomic_read (&dev->pin_count));
- DRM_PROC_PRINT ("%d pin bytes\n", atomic_read (&dev->pin_memory));
- DRM_PROC_PRINT ("%d gtt bytes\n", atomic_read (&dev->gtt_memory));
+ DRM_PROC_PRINT("%d objects\n", atomic_read (&dev->object_count));
+ DRM_PROC_PRINT("%d object bytes\n", atomic_read (&dev->object_memory));
+ DRM_PROC_PRINT("%d pinned\n", atomic_read (&dev->pin_count));
+ DRM_PROC_PRINT("%d pin bytes\n", atomic_read (&dev->pin_memory));
+ DRM_PROC_PRINT("%d gtt bytes\n", atomic_read (&dev->gtt_memory));
+ DRM_PROC_PRINT("%d gtt total\n", dev->gtt_total);
if (len > request + offset)
return request;
*eof = 1;
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 0f037acf..e07cf1b9 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -65,6 +65,8 @@ i915_gem_init_ioctl(struct drm_device *dev, void *data,
drm_memrange_init(&dev_priv->mm.gtt_space, args->gtt_start,
args->gtt_end - args->gtt_start);
+ dev->gtt_total = (uint32_t) (args->gtt_end - args->gtt_start);
+
mutex_unlock(&dev->struct_mutex);
return 0;