summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/i915/drm
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-08-14 20:11:32 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-08-15 17:42:46 +0100
commit5b9cb1329557cc17e1533aed7c63e1252658d74b (patch)
tree9cd1f7f10cd523590b5baa58cd6fdb1427e493b1 /src/gallium/winsys/i915/drm
parente9c43b1f01b10170f55acac66edc4e6d1b170260 (diff)
gallium/i915: handle query_renderer caps
Implementation based on the classic driver with the following changes: - Use auxiliarry function os_get_total_physical_memory to get the total amount of memory. - Move the libdrm_intel specific get_aperture_size to the winsys. Cc: Stephane Marchesin <stephane.marchesin@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/gallium/winsys/i915/drm')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
index 9e16f409cea..d4a2e013ae6 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
@@ -28,6 +28,17 @@ i915_drm_get_device_id(int fd, unsigned int *device_id)
assert(ret == 0);
}
+static int
+i915_drm_aperture_size(struct i915_winsys *iws)
+{
+ struct i915_drm_winsys *idws = i915_drm_winsys(iws);
+ size_t aper_size, mappable_size;
+
+ drm_intel_get_aperture_sizes(idws->fd, &mappable_size, &aper_size);
+
+ return aper_size >> 20;
+}
+
static void
i915_drm_winsys_destroy(struct i915_winsys *iws)
{
@@ -58,6 +69,7 @@ i915_drm_winsys_create(int drmFD)
idws->base.pci_id = deviceID;
idws->max_batch_size = 1 * 4096;
+ idws->base.aperture_size = i915_drm_aperture_size;
idws->base.destroy = i915_drm_winsys_destroy;
idws->gem_manager = drm_intel_bufmgr_gem_init(idws->fd, idws->max_batch_size);