[Intel-gfx] [PATCH 3/3] drm/i915: extract gt interrupt handler

Daniel Vetter daniel at ffwll.ch
Sat Mar 31 11:38:43 CEST 2012


On Fri, Mar 30, 2012 at 09:31:27PM -0700, Ben Widawsky wrote:
> On Fri, 30 Mar 2012 11:28:40 -0700
> Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> 
> > On Fri, 30 Mar 2012 20:24:35 +0200
> > Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > 
> > > vlv, ivb and snb all share the gen6+ gt irq handling. 3 copies of
> > > the same stuff is a bit much, so extract it into a little helper.
> > > 
> > > Now ilk has a different gt irq handling than snb, but shares the
> > > same irq handler (due to the similar display block). So also
> > > extract the ilk gt irq handling to clearly separate these two
> > > things.
> > > 
> > > Nice side effect of this is that we can complete Ben Widawsky's
> > > gen6+ irq bit #define cleanup and call the render irq also with the
> > > GEN6 alias. Beforehand that code was shared with ilk, and neither
> > > option really made much sense.
> > > 
> > > As a bonus this enables the error interrupt handling lifted from the
> > > vlv code on snb and ivb, too.
> > > 
> > > Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > 
> > Nice cleanup.  Though I don't really like the IS_GEN5 branch in
> > ironlake_irq_handler... might be nicer to just bite the bullet and
> > have a mostly duplicate snb irq handler.
> > 
> > Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> > 
> 
> I agree with Jesse. Bite the bullet, you're already +LOC (see below),
> may as well give it a nice clean split.

I've already replied to Jesse idea on irc, so let me repeat it here: I
considered the ugliness and dropped the idea. If things like this get
common (i.e. reusing the display block, which dictates the master irq
controller, with a different gt render core) we could introduce a vfunc.
But I don't like splitting this up just for the sake of it, because the
display controller on ironlake and snb _is_ pretty much the same thing (at
least wrt interrupt handling), the thing that's different is the gt core.

> Personally, I'd like to give you crap about the fact that your
> "cleanup" had a +LOC, which came up recently regarding my ILK
> context stuff.

Meh, the +LOC argument was just bikeshed, my real argument is that you
screw up your context abstraction by trying to wrestle it into something
that it isn't suitable for.

> Antagonized-by: Ben Widawsky <ben at bwidawsk.net>

Cheers, Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list