From: Daniel Vetter Subject: Re: [PATCH 1/5] drm/i915: Round up object allocations Date: Sat, 25 Jan 2014 21:28:24 +0100 Message-ID: <20140125202824.GM9772@phenom.ffwll.local> References: <1390533674-18402-1-git-send-email-benjamin.widawsky@intel.com> <1390533674-18402-2-git-send-email-benjamin.widawsky@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 760DCFA848 for ; Sat, 25 Jan 2014 12:28:28 -0800 (PST) Received: by mail-ee0-f53.google.com with SMTP id t10so1557007eei.40 for ; Sat, 25 Jan 2014 12:28:27 -0800 (PST) Content-Disposition: inline In-Reply-To: <1390533674-18402-2-git-send-email-benjamin.widawsky@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Ben Widawsky Cc: Intel GFX , Ben Widawsky , Internal GFX Development List-Id: intel-gfx@lists.freedesktop.org On Thu, Jan 23, 2014 at 07:21:10PM -0800, Ben Widawsky wrote: > 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 > --- > 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); > + Nope, if there's some code that doesn't do page-aligend bo allocations it needs to be fixed there. If you want throw a WARN_ON and early return in here. -Daniel > obj = i915_gem_object_alloc(dev); > if (obj == NULL) > return NULL; > -- > 1.8.5.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch