[intel-gem] show total GTT space in /proc/dri/*/gem_objects

main
Keith Packard 2008-06-13 19:35:22 -07:00
parent 73bc18cad8
commit a7139cb851
3 changed files with 9 additions and 5 deletions

View File

@ -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 */
/*@} */

View File

@ -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;

View File

@ -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;