From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v3] drm/i915: Add null state batch to active list Date: Wed, 21 May 2014 17:17:59 +0200 Message-ID: <20140521151759.GL14357@phenom.ffwll.local> References: <20140521130602.GA12436@nuc-i3427.alporthouse.com> <1400680976-19107-1-git-send-email-mika.kuoppala@intel.com> <20140521145455.GJ14357@phenom.ffwll.local> <20140521150040.GA28410@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com [74.125.83.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F2586EA6B for ; Wed, 21 May 2014 08:18:05 -0700 (PDT) Received: by mail-ee0-f46.google.com with SMTP id t10so1725237eei.19 for ; Wed, 21 May 2014 08:18:04 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140521150040.GA28410@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Daniel Vetter , Mika Kuoppala , intel-gfx@lists.freedesktop.org, miku@iki.fi List-Id: intel-gfx@lists.freedesktop.org On Wed, May 21, 2014 at 04:00:40PM +0100, Chris Wilson wrote: > On Wed, May 21, 2014 at 04:54:55PM +0200, Daniel Vetter wrote: > > On Wed, May 21, 2014 at 05:02:56PM +0300, Mika Kuoppala wrote: > > > for proper refcounting to take place as we use > > > i915_add_request() for it. > > > = > > > i915_add_request() also takes the context for the request > > > from ring->last_context so move the null state batch > > > submission after the ring context has been set. > > > = > > > v2: we need to check for correct ring now (Ville Syrj=E4l=E4) > > > v3: no need to expose i915_gem_move_object_to_active (Chris Wilson) > > > = > > > Cc: Ville Syrj=E4l=E4 > > > Cc: Chris Wilson > > > Cc: Damien Lespiau > > > Signed-off-by: Mika Kuoppala > > = > > Merged with Ville's irc r-b, thanks for the quick fix. > = > Pity, it still contains some code that I'd rather not start > cargo-culting. Using vmas more as first-class objects I support. Mika can you please resend? I'll keep v3 for now to avoid blocking people. -Daniel > > > - ret =3D i915_add_request(ring, &seqno); > > > + vma =3D i915_gem_obj_to_ggtt(so->obj); > > > + if (vma =3D=3D NULL) { > > > + ret =3D -ENOSPC; > > > + goto out; > > > + } > = > We use the GGTT vma much earlier, so this is suspect. > = > > > + > > > + i915_vma_move_to_active(vma, ring); > > > + > > > + ret =3D __i915_add_request(ring, NULL, so->obj, NULL); > > > + if (ret) > > > + i915_gem_object_move_to_inactive(so->obj); > = > As is move-to-inactive here. The only way add-request can fail is via an > EIO, and that will have triggered the move-to-inactive already - which > should nicely catch a BUG or two. > -Chris > = > -- = > Chris Wilson, Intel Open Source Technology Centre -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch