From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: set ctx->initialized only after RCS Date: Fri, 10 Jan 2014 08:18:25 +0100 Message-ID: <20140110071825.GC4770@phenom.ffwll.local> References: <1388266309-1178-1-git-send-email-benjamin.widawsky@intel.com> <20140107071033.GB16015@phenom.ffwll.local> <20140107104718.GD8991@nuc-i3427.alporthouse.com> <20140109231725.GA4522@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id B8A781068C6 for ; Thu, 9 Jan 2014 23:17:08 -0800 (PST) Received: by mail-ee0-f41.google.com with SMTP id e49so11241eek.0 for ; Thu, 09 Jan 2014 23:17:07 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140109231725.GA4522@bwidawsk.net> 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 List-Id: intel-gfx@lists.freedesktop.org On Thu, Jan 09, 2014 at 03:17:25PM -0800, Ben Widawsky wrote: > On Tue, Jan 07, 2014 at 10:47:18AM +0000, Chris Wilson wrote: > > On Tue, Jan 07, 2014 at 08:10:33AM +0100, Daniel Vetter wrote: > > > On Sat, Dec 28, 2013 at 01:31:49PM -0800, Ben Widawsky wrote: > > > > The initialized flag is used to specify a context has been initialized > > > > and it's context is safe to load, ie. the 3d state is setup properly. > > > > With full PPGTT, we emit the address space loads during context switch > > > > and this currently marks a context as initialized. With full PPGTT > > > > patches, if a client first emits a batch to !RCS, then later, RCS, the > > > > code will mistake the context as initialized and try to reload an > > > > uninitialized context. > > > > > > > > 1. context 1 blit // context initialized > > > > 2. context 2 // saves context 1 random state > > > > 3. context 1 render // loads random state from step 2 > > > > > > > > It is really easy to hit this with a planned upcoming patch which makes > > > > default context reuse possible. > > > > > > > > NOTE: This should only effect full PPGTT branches, ie. current > > > > drm-intel-nightly. > > > > > > > > Thanks to Chris for helping me track this down. > > > > > > > > Cc: Chris Wilson > > > > Signed-off-by: Ben Widawsky > > > > > > Do we have a testcase for this or a bug report? > > > > Odd, since QA should have hit this... > > -Chris > > I was only able to hit it on one machine. The test case was 'startx.' I > think getting it to fail is somewhat dependent upon how the backing > pages for the context are initialized (at least, that is my theory). Well I've hoped we'd understand the fallout a bit better, but meh. Patch merged with the failure scenario in the commit message simplified as noted by Chris. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch