From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] [v3] drm: pre allocate node for create_block Date: Fri, 5 Jul 2013 21:25:35 +0200 Message-ID: <20130705192535.GW18285@phenom.ffwll.local> References: <1372887926-1147-1-git-send-email-ben@bwidawsk.net> <1372968881-804-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by gabe.freedesktop.org (Postfix) with ESMTP id B66D2E5CE0 for ; Fri, 5 Jul 2013 12:25:37 -0700 (PDT) Received: by mail-ea0-f179.google.com with SMTP id b15so1658267eae.24 for ; Fri, 05 Jul 2013 12:25:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: David Herrmann Cc: Ben Widawsky , Intel GFX , "dri-devel@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org On Thu, Jul 04, 2013 at 10:32:27PM +0200, David Herrmann wrote: > Hi > > On Thu, Jul 4, 2013 at 10:14 PM, Ben Widawsky wrote: > > For an upcoming patch where we introduce the i915 VMA, it's ideal to > > have the drm_mm_node as part of the VMA struct (ie. it's pre-allocated). > > Part of the conversion to VMAs is to kill off obj->gtt_space. Doing this > > will break a bunch of code, but amongst them are 2 callers of > > drm_mm_create_block(), both related to stolen memory. > > > > It also allows us to embed the drm_mm_node into the object currently > > which provides a nice transition over to the new code. > > > > v2: Reordered to do before ripping out obj->gtt_offset. > > Some minor cleanups made available because of reordering. > > > > v3: s/continue/break on failed stolen node allocation (David) > > Set obj->gtt_space on failed node allocation (David) > > Only unref stolen (fix double free) on failed create_stolen (David) > > Free node, and NULL it in failed create_stolen (David) > > Add back accidentally removed newline (David) > > > > CC: > > CC: David Herrmann > > Signed-off-by: Ben Widawsky > > I already suspected that you'd embed drm_mm_node in a follow-up patch > but I am not subscribed to intel-gfx so I didn't get the other > patches. Looks good now. > > Reviewed-by: David Herrmann Ok, I've discussed this a bit with Dave on irc and he's a bit unhappy with the creat_block name. After a bit of chatting with Ben I think we should go with int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node); The start/size/color arguments would then be passed in through the drm_mm_node argument. Ben asked whether that's not too much poking around in drm_mm_node internals, but imo those three pieces of it are part of the public interface to drm_mm users. Also, the patch as-is conflicts a bit too badly with my current tree. So can you please apply the little bikeshed, rebase, and then rebase the other patches in this series that I haven't merged on top of this? Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch