All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: RFC: i915 arch changes to better support new chipsets
Date: Tue, 20 Mar 2012 19:43:04 +0100	[thread overview]
Message-ID: <20120320184304.GC27231@phenom.ffwll.local> (raw)
In-Reply-To: <20120320111357.56093868@jbarnes-desktop>

On Tue, Mar 20, 2012 at 11:13:57AM -0700, Jesse Barnes wrote:
> I've been talking with some people offline about potential changes to
> our source structure to make it easier to add support for new chipsets,
> prevent breaking chipsets one doesn't intend to affect, and generally
> make the code more readable and maintainable.
> 
> I've got some new chipset code ready that's motivating some of this
> work, because it moved all the display regs around, added a new unit in
> low MMIO space, and generally affects gen7 paths with gen5 like
> behavior.
> 
> The question is, how far should we go?  At the very least, I'd like to
> propose the following:
>   intel_display.c -> pch_display.c, gmch_display.c, potentially with
>     additional sub-files for specific weirdness and power/drps
>     functionality

Yeah, that seems pretty sensible. I also think that splitting out some of
the less crtc_modeset related display functionality would be good, e.g.
pageflip, cursor stuff (like we've done for planes already). One big
monsters is the init code, which for added hilarity seems to be the place
to do all kinds of once-per-poweron workarounds. I don't have a clear idea
what we should do there.

>   i915_irq.c -> per chipset irq files (i9xx, ironlake, ivb at the very
>     least, with some additional duplication)

I'm not too sure about that one - we have i915_irq.c, i915_dma.c and
i915_drv.c with rather ill-defined use-cases for all kinds of things. And
tons of dri1 legacy stuff splattered all accross. We might want to pull
out a few functionalities out of these first before splitting it up
according to chipsets (e.g. pulling out the error handler and gpu reset
crap, which is currently splattered over a few files). After that, not
much might be left and it might make sense to just leave the irq stuff
together.

>   new, range specific i915_read/write routines, e.g. i915_read_gt,
>     i915_read_display to make forcewake and register block moves easier
>     to handle

I'm not convinced whether this is a great idea if applied all over the
code. For specific cases where a block moves it's imo better to just add a
mmio base for that (like we're doing with the ring ctrl regs, which move
around quite a bit over the various rings and generations). Obviously
adding a small helper is good, but imo we should name it a bit more
specific (if possible).

> I'm open to suggestions on how to fix i915_reg.h; it's becoming quite a
> beast.  Our goal to be to make it easy to add new definitions while
> also making it easy to not accidentally use old an incorrect
> definitions on a new platform.

Close your eyes and just keep on adding gunk. Imo i915_reg.h is pretty
much a write-once file, and cscope can still keep up with the definitions.
So not a pain point for me.

> Then obviously within those files there's lots of room for improvement,
> for example in i9xx mode setting we still have some pretty massive
> functions that need to be split (I have patches to do that).
> 
> Thoughts?  It may also make sense to split some of our port specific
> files where they differ enough from previous platforms.  E.g. g4x DP vs
> ironlake+...

I've just talked about this a bit with Eugeni in the context of Haswell,
and I think we might want to hold of for that code until we move output
stuff all over the place.

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

  reply	other threads:[~2012-03-20 18:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 18:13 RFC: i915 arch changes to better support new chipsets Jesse Barnes
2012-03-20 18:43 ` Daniel Vetter [this message]
2012-03-20 20:13   ` Jesse Barnes
2012-03-21 11:42     ` Eugeni Dodonov
2012-03-21 11:58       ` Chris Wilson
2012-03-21 20:41     ` Jesse Barnes
2012-03-28 19:35       ` Eric Anholt
2012-03-28 19:46         ` Jesse Barnes
2012-03-28 19:59           ` Eugeni Dodonov
2012-03-28 20:29             ` Eric Anholt
2012-03-28 20:37               ` Daniel Vetter
2012-03-29  1:02                 ` Eugeni Dodonov

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=20120320184304.GC27231@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.