diff mbox series

[RFC,1/2] drm/i915: Return mappable aperture size

Message ID 20190307191115.35336-1-antonio.argenziano@intel.com (mailing list archive)
State New, archived
Headers show
Series [RFC,1/2] drm/i915: Return mappable aperture size | expand

Commit Message

Antonio Argenziano March 7, 2019, 7:11 p.m. UTC
Extend the API to return the mappable aperture size directly in the
I915_GEM_GET_APERTURE IOCTL.

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 include/uapi/drm/i915_drm.h     | 5 +++++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0b23cf3be718..d109f6dbe992 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -221,6 +221,8 @@  i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
 	args->aper_size = ggtt->vm.total;
 	args->aper_available_size = args->aper_size - pinned;
 
+	args->mappable_aperture_size = ggtt->mappable_end;
+
 	return 0;
 }
 
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index aa2d4c73a97d..bcab66664579 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1284,6 +1284,11 @@  struct drm_i915_gem_get_aperture {
 	 * bytes
 	 */
 	__u64 aper_available_size;
+
+	/**
+	 * Total size of the mappable aperture.
+	 */
+	__u64 mappable_aperture_size;
 };
 
 struct drm_i915_get_pipe_from_crtc_id {