From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Implement workaround for broken CS tlb on i830/845 Date: Mon, 17 Dec 2012 16:12:18 +0100 Message-ID: <20121217151218.GQ5737@phenom.ffwll.local> References: <1355697960-8063-1-git-send-email-chris@chris-wilson.co.uk> <6c3329$7mbtk2@orsmga002.jf.intel.com> <20121217134303.GO5737@phenom.ffwll.local> <20121217144617.GO29018@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by gabe.freedesktop.org (Postfix) with ESMTP id A781DE61A1 for ; Mon, 17 Dec 2012 07:10:45 -0800 (PST) Received: by mail-wg0-f45.google.com with SMTP id dq12so2611385wgb.12 for ; Mon, 17 Dec 2012 07:10:44 -0800 (PST) Content-Disposition: inline In-Reply-To: <20121217144617.GO29018@intel.com> 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: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Dec 17, 2012 at 04:46:17PM +0200, Ville Syrj=E4l=E4 wrote: > On Mon, Dec 17, 2012 at 02:43:03PM +0100, Daniel Vetter wrote: > > On Mon, Dec 17, 2012 at 01:33:01PM +0000, Chris Wilson wrote: > > > On Sun, 16 Dec 2012 22:46:00 +0000, Chris Wilson wrote: > > > > @@ -1087,6 +1087,9 @@ i915_error_first_batchbuffer(struct drm_i915_= private *dev_priv, > > > > if (!ring->get_seqno) > > > > return NULL; > > > > = > > > > + if (HAS_BROKEN_CS_TLB(dev_priv->dev)) > > > > + return i915_error_object_create(dev_priv, ring->private); > > > = > > > Hmm, this is complicated by userspace opting out of the CS w/a, and > > > imposes quite a burden upon our simple seq interface. > > = > > Right, I've written this without userspace being able to opt out in mind > > ... for the seq -ENOMEM, I guess it's just time to bite the bullet. Loa= ds > > of the error_states for the ilk fallout couldn't be dumped (but could be > > captured) by bug reporters already :( > = > Assuming you're talking about debugfs error_state returning -ENOMEM due > to seq_file's massive kmalloc(), I had a couple of ideas for fixing it > in seq_file itself. > = > 1) just use vmalloc() > = > 2) use multiple pages instead of one big allocation > = > seq_printf() { > try to print the line > if not enough space { > mark the end of valid data in current page > allocate a new page > print again > } > } > = > And adjust seq_read()/seq_lseek accordingly. > = > Of course then you can't print anything > PAGE_SIZE, > but that seems unlikely anyway, and if really needed > it could try to allocate something larger than a page > when needed. Afaik that's pretty much what the real seq_file interface does, we just need to port the error state dump code over from the simple_seq_file to the real one. But since seq_file is designed for more regular stuff, this will be a slight pain, so I've tried to avoid this ... It sounds like I'm running low on excuses ;-) -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch