Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, miku@iki.fi, "Lu,
	HuaX" <huax.lu@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Switch to fake context on older gens
Date: Fri, 14 Mar 2014 16:42:21 +0100	[thread overview]
Message-ID: <20140314154221.GX30571@phenom.ffwll.local> (raw)
In-Reply-To: <87d2ho264b.fsf@intel.com>

On Fri, Mar 14, 2014 at 04:43:16PM +0200, Jani Nikula wrote:
> On Fri, 14 Mar 2014, Mika Kuoppala <mika.kuoppala@linux.intel.com> wrote:
> > We used to have per file descriptor hang stats for the
> > i915_get_reset_stats_ioctl() and for default context banning.
> >
> > commit 0eea67eb26000657079b7fc41079097942339452
> > Author: Ben Widawsky <ben@bwidawsk.net>
> > Date:   Fri Dec 6 14:11:19 2013 -0800
> >
> >     drm/i915: Create a per file_priv default context
> >
> > made having separate hangstats in file_private redundant
> > as i915_hw_context already contained hangstats. So
> >
> > commit c482972a086e03e6a6d27e4f7af2d868bf659648
> > Author: Ben Widawsky <benjamin.widawsky@intel.com>
> > Date:   Fri Dec 6 14:11:20 2013 -0800
> >
> >     drm/i915: Piggy back hangstats off of contexts
> >
> > consolidated the hangstats and enabled further improvements.
> >
> > commit 44e2c0705a19e09d7b0f30a591f92e473e5ef89e
> > Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > Date:   Thu Jan 30 16:01:15 2014 +0200
> >
> >     drm/i915: Use i915_hw_context to set reset stats
> >
> > tried to reap full benefits of consolidation but fell short
> > as we never 'switch' to the fake private context on gens
> > that don't have hw_contexts, so request->ctx remained NULL
> > on those.
> >
> > Fix this by 'switching' to fake context so that when
> > request is submitted to ring, proper context gets assigned
> > to it.
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=76055
> 
> I'd say this still applies:
> 
> Tested-by: Lu Hua <huax.lu@intel.com>

Also if your patch intends to fix a bug, please use a Bugzilla: reference,
I tend to use References only when there's an issue seen in a report, but
it's not the main issue.
-Daniel

> 
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_context.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> > index ce41cff..b5a5837 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_context.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> > @@ -775,9 +775,11 @@ int i915_switch_context(struct intel_ring_buffer *ring,
> >  
> >  	BUG_ON(file && to == NULL);
> >  
> > -	/* We have the fake context, but don't supports switching. */
> > -	if (!HAS_HW_CONTEXTS(ring->dev))
> > +	/* We have the fake context */
> > +	if (!HAS_HW_CONTEXTS(ring->dev)) {
> > +		ring->last_context = to;
> >  		return 0;
> > +	}
> >  
> >  	return do_switch(ring, to);
> >  }
> > -- 
> > 1.7.9.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-03-14 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 14:22 [PATCH 1/2] drm/i915: Switch to fake context on older gens Mika Kuoppala
2014-03-14 14:22 ` [PATCH 2/2] drm/i915: Return -ENOENT for unknown contexts Mika Kuoppala
2014-03-14 15:38   ` Daniel Vetter
2014-03-17 17:09     ` [PATCH] tests/gem_reset_stats: run non hw context tests also on older gens Mika Kuoppala
2014-03-24 17:13       ` Daniel Vetter
2014-03-14 14:43 ` [PATCH 1/2] drm/i915: Switch to fake context " Jani Nikula
2014-03-14 15:42   ` Daniel Vetter [this message]
2014-03-14 15:46     ` 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=20140314154221.GX30571@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=huax.lu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=miku@iki.fi \
    /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