[Intel-gfx] [PATCH 1/5] drm/i915: Round up object allocations

Ben Widawsky benjamin.widawsky at intel.com
Fri Jan 24 04:21:10 CET 2014


DRM gets very mad when you request an object which occupies a partial
page. As a DRM driver, i915 never really wants to anger DRM, and would
always just want the rounding done for us.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 024e454..8cd1134 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4168,6 +4168,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
 	struct address_space *mapping;
 	gfp_t mask;
 
+	size = round_up(size, PAGE_SIZE);
+
 	obj = i915_gem_object_alloc(dev);
 	if (obj == NULL)
 		return NULL;
-- 
1.8.5.3




More information about the Intel-gfx mailing list