From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 1/5] drm/i915: Round up object allocations Date: Sat, 25 Jan 2014 21:49:57 -0800 Message-ID: <20140126054957.GA1926@bwidawsk.net> References: <1390533674-18402-1-git-send-email-benjamin.widawsky@intel.com> <1390533674-18402-2-git-send-email-benjamin.widawsky@intel.com> <20140125202824.GM9772@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 4066AFA610 for ; Sat, 25 Jan 2014 21:50:14 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140125202824.GM9772@phenom.ffwll.local> 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: Daniel Vetter Cc: Intel GFX , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org On Sat, Jan 25, 2014 at 09:28:24PM +0100, Daniel Vetter wrote: > 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 Why? -- Ben Widawsky, Intel Open Source Technology Center