From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Implement workaround for broken CS tlb on i830/845
Date: Mon, 17 Dec 2012 17:39:33 +0200 [thread overview]
Message-ID: <20121217153933.GP29018@intel.com> (raw)
In-Reply-To: <20121217151218.GQ5737@phenom.ffwll.local>
On Mon, Dec 17, 2012 at 04:12:18PM +0100, Daniel Vetter wrote:
> On Mon, Dec 17, 2012 at 04:46:17PM +0200, Ville Syrjälä 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 <chris@chris-wilson.co.uk> 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. Loads
> > > 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,
AFAICS it just starts w/ a buffer size of one page, and it just
retries in a loop calling ->show() and doubling the buffer size
every time seq_printf() indicated an overflow. So it wants to
print the whole thing into a single contiguous buffer.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2012-12-17 15:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-16 22:46 [PATCH] drm/i915: Implement workaround for broken CS tlb on i830/845 Chris Wilson
2012-12-17 13:33 ` Chris Wilson
2012-12-17 13:43 ` Daniel Vetter
2012-12-17 14:46 ` Ville Syrjälä
2012-12-17 15:12 ` Daniel Vetter
2012-12-17 15:39 ` Ville Syrjälä [this message]
2012-12-17 15:18 ` Chris Wilson
2012-12-17 15:23 ` Chris Wilson
2012-12-17 15:30 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2012-12-16 17:08 Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121217153933.GP29018@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox