[Intel-gfx] [RFC PATCH 2/2] drm/i915: Account for platform without mappable aperture when returning size

Antonio Argenziano antonio.argenziano at intel.com
Thu Mar 7 19:11:15 UTC 2019


Some devices will not expose a mappable aperture anymore so we need to
return an appropriate value in that case.

Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>

Cc: Matthew Auld <matthew.auld at intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d109f6dbe992..5125a5329100 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -221,7 +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;
+	args->mappable_aperture_size =
+			HAS_MAPPABLE_APERTURE(to_i915(dev)) ? ggtt->mappable_end : (__u64)-ENODEV;
 
 	return 0;
 }
-- 
2.20.1



More information about the Intel-gfx mailing list