<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 6:05 AM Toni Lönnberg <<a href="mailto:toni.lonnberg@intel.com">toni.lonnberg@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Nov 02, 2018 at 12:09:54AM -0500, Jason Ekstrand wrote:<br>
> On Thu, Nov 1, 2018 at 5:51 AM Toni Lönnberg <<a href="mailto:toni.lonnberg@intel.com" target="_blank">toni.lonnberg@intel.com</a>><br>
> wrote:<br>
> <br>
> > On Wed, Oct 31, 2018 at 01:18:11PM -0500, Jason Ekstrand wrote:<br>
> > > On Wed, Oct 31, 2018 at 11:10 AM Toni Lönnberg <<a href="mailto:toni.lonnberg@intel.com" target="_blank">toni.lonnberg@intel.com</a>><br>
> > > wrote:<br>
> > ><br>
> > > > When we debug media or 3d+media workloads, we'd like to be able to see<br>
> > > > what is<br>
> > > > in the aub dumps for those workloads. At the moment the decoder can't<br>
> > > > distinguish instructions which share the same opcode between the render<br>
> > > > and<br>
> > > > video pipe, and thus aubinator outputs garbage on media instructions.<br>
> > > ><br>
> > > > I was reluctant to make these changes into Mesa in the first place<br>
> > since<br>
> > > > the<br>
> > > > work is related to media, not 3d, but as aubinator is now located here,<br>
> > > > here we<br>
> > > > are.<br>
> > > ><br>
> > ><br>
> > > That's fine.  It's fine if these changres live in mesa.<br>
> > ><br>
> > ><br>
> > > > As far as I can see, these are the options:<br>
> > > ><br>
> > > > 1. Put these in Mesa as aubinator now resides here instead of IGT.<br>
> > > >    a) Put all instruction definitions in the current genxml files, be<br>
> > it<br>
> > > > with a<br>
> > > >       tag or an attribute, both methods have their advantages and<br>
> > > > disadvantages.<br>
> > > >    b) Separate genxml files into common, render and video (and<br>
> > blitter?)<br>
> > > ><br>
> > > > 2. Fork aubinator tools and related genxml infra to a completely<br>
> > separate<br>
> > > >    project.<br>
> > > ><br>
> > > > If I have missed an option, feel free to suggest.<br>
> > > ><br>
> > ><br>
> > > I wasn't suggesting we fork the tools and the XML.  I was just wondering<br>
> > > whether we wanted to do separate sections or an attribute.  I think it<br>
> > > should land in mesa either way.<br>
> ><br>
> > I'm not really a fan of any of the methods to be honest as each of them<br>
> > have<br>
> > disadvantages.<br>
> ><br>
> > Using the attribute makes it easier to add instructions which should be<br>
> > handled<br>
> > by a set of engines and not others but requires each instruction to have<br>
> > one,<br>
> > except the common ones that are always shared which can be made to default<br>
> > to<br>
> > all engines like in my version.<br>
> ><br>
> > The tag makes it easier to group things nicely but adds a new level to the<br>
> > xml<br>
> > and requires duplicate definitions of the instruction if more than one<br>
> > engine<br>
> > uses that instruction but some engine doesn't.<br>
> ><br>
> <br>
> Yeah, I think I'm convinced.<br>
> <br>
> <br>
> > Splitting the genxml files into different ones for each engine also<br>
> > organizes<br>
> > the instructions nicely but has the same problem as the tag and requires<br>
> > loading<br>
> > and parsing of multiple xml files.<br>
> ><br>
> <br>
> I also experimented with splitting up the XML files.  There are times when<br>
> this is convenient but I'm not sure it's actually all that useful.  If we<br>
> were to split it, we'd probably want to split it across other logical lines<br>
> like "MI" commands vs. "3DSTATE" commands and maybe a separate file for<br>
> registers.  At least for now, we may as well keep it all together.<br>
<br>
Splitting the files seems convenient but coherence is important because we don't <br>
want to end up with hundreds of xml files just for the sake of splitting stuff. <br>
So I'd keep them as they are unless at some point we find a convincing reason to <br>
split them apart.<br>
<br>
> > To make things more icky, there are the instructions, like MI_FLUSH_DW,<br>
> > which<br>
> > are shared between engines but might use some of the bits for different<br>
> > things.<br>
> ><br>
> <br>
> Yeah.  When you mentioned this, I briefly considered the idea of putting<br>
> engine tags on individual fields in that case.  That may be getting a bit<br>
> nuts; I certainly don't want to recreate the insanity that is the bxml.<br>
<br>
I haven't checked how many instructions there are that are shared but have some <br>
bits enabled for some engines and not for others, can't be that many. If there <br>
were a lot of those, it might make more sense adding an engine-attribute to <br>
fields but as of now, that's a bit overkill. And I'm with you here about bspec <br>
:)<br>
<br>
> > In the end, I just went with how Lionel saw it because it was as good of<br>
> > an<br>
> > option as any, and pretty straight forward to implement, so.. mehhh. I<br>
> > don't<br>
> > know if you'd prefer one way or the other.<br>
> ><br>
> <br>
> Works for me.  I just wanted to make sure we'd thought it through before<br>
> adding it.  I know I certainly hadn't given it all that much thought in my<br>
> brief experiments.  I think the attributes is the best solution for now.<br>
<br>
So we're good to go with the reviews?<br></blockquote><div><br></div><div>Yes, if I understand the question correctly.  That doesn't mean I have reviewed it; I haven't really looked at the patches in any detail whatsoever.  It does mean that I'm happy with it in principal and all that's really left is someone to thoroughly double-check everything and make sure the right instructions got the right tags.</div><div><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> --Jason<br>
> <br>
> <br>
> <br>
> > ><br>
> > > --Jason<br>
> > ><br>
> > ><br>
> > > > On Wed, Oct 31, 2018 at 09:20:39AM -0500, Jason Ekstrand wrote:<br>
> > > > > Toni,<br>
> > > > ><br>
> > > > > I'm a bit curious where you're going with this.  I started on a<br>
> > similar<br>
> > > > > project a couple of years ago:<br>
> > > > ><br>
> > > > ><br>
> > <a href="https://gitlab.freedesktop.org/jekstrand/mesa/commits/wip/genxml-engines" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/jekstrand/mesa/commits/wip/genxml-engines</a><br>
> > > > ><br>
> > > > > Mine took a different (not necessarily better) approach of<br>
> > surrounding<br>
> > > > the<br>
> > > > > instructions in an <engine> tag.  I'm not sure if that's any better<br>
> > or<br>
> > > > > worse than an attribute.<br>
> > > > ><br>
> > > > > At the time, I was planning to port over the blitter code to genxml<br>
> > and<br>
> > > > get<br>
> > > > > aubinator decoding blit streams.  I canned the project because there<br>
> > are<br>
> > > > > few enough differences in hardware generations for the blitter to be<br>
> > > > worth<br>
> > > > > the re-compilation and I had better things to do.  I've always<br>
> > thought it<br>
> > > > > would be good to support other engines for no other reason than to<br>
> > make<br>
> > > > > aubinator for blits.  It would also likely be useful to have if we<br>
> > wanted<br>
> > > > > to start doing media in mesa for some reason.  What's your<br>
> > motivation?  I<br>
> > > > > ask because I can't really have an opinion on the approach unless I<br>
> > know<br>
> > > > > where it's headed.<br>
> > > > ><br>
> > > > > --Jason<br>
> > > > ><br>
> > > > > On Wed, Oct 31, 2018 at 8:12 AM Toni Lönnberg <<br>
> > <a href="mailto:toni.lonnberg@intel.com" target="_blank">toni.lonnberg@intel.com</a>><br>
> > > > > wrote:<br>
> > > > ><br>
> > > > > > These patches add an engine parameter to the instructions defined<br>
> > in<br>
> > > > the<br>
> > > > > > genxml<br>
> > > > > > files so that they can be distinguished when sending them to<br>
> > different<br>
> > > > > > engines.<br>
> > > > > > By default, an instruction is defined to be used by all engines<br>
> > and is<br>
> > > > > > defined<br>
> > > > > > for a specific engine by adding the parameter "engine" to the<br>
> > > > definition.<br>
> > > > > > Currently the supported engines are "render", "video" and<br>
> > "blitter".<br>
> > > > > ><br>
> > > > > > v2:<br>
> > > > > ><br>
> > > > > > * gen_engine enum removed and replaced with use of<br>
> > > > > > drm_i915_gem_engine_class<br>
> > > > > ><br>
> > > > > > * The current engine being used is now saved in the decoder context<br>
> > > > and is<br>
> > > > > > not<br>
> > > > > >   being passed through gen_print_batch().<br>
> > > > > ><br>
> > > > > > * Split the genxml changes into multiple patches<br>
> > > > > ><br>
> > > > > > Toni Lönnberg (13):<br>
> > > > > >   intel/decoder: tools: gen_engine to drm_i915_gem_engine_class<br>
> > > > > >   intel/decoder: Engine parameter for instructions<br>
> > > > > >   intel/decoder: tools: Use engine for decoding batch instructions<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen4)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen45)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen5)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen6)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen7)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen75)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen8)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen9)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen10)<br>
> > > > > >   intel/genxml: Add engine definition to render engine instructions<br>
> > > > > >     (gen11)<br>
> > > > > ><br>
> > > > > >  src/intel/common/gen_batch_decoder.c     |  25 ++-<br>
> > > > > >  src/intel/common/gen_decoder.c           |  18 +-<br>
> > > > > >  src/intel/common/gen_decoder.h           |  11 +-<br>
> > > > > >  src/intel/genxml/gen10.xml               | 206<br>
> > +++++++++++-----------<br>
> > > > > >  src/intel/genxml/gen11.xml               | 208<br>
> > +++++++++++------------<br>
> > > > > >  src/intel/genxml/gen4.xml                |  36 ++--<br>
> > > > > >  src/intel/genxml/gen45.xml               |  38 ++---<br>
> > > > > >  src/intel/genxml/gen5.xml                |  44 ++---<br>
> > > > > >  src/intel/genxml/gen6.xml                |  94 +++++-----<br>
> > > > > >  src/intel/genxml/gen7.xml                | 154 ++++++++---------<br>
> > > > > >  src/intel/genxml/gen75.xml               | 184<br>
> > ++++++++++----------<br>
> > > > > >  src/intel/genxml/gen8.xml                | 202<br>
> > +++++++++++-----------<br>
> > > > > >  src/intel/genxml/gen9.xml                | 208<br>
> > +++++++++++------------<br>
> > > > > >  src/intel/tools/aub_read.c               |  22 +--<br>
> > > > > >  src/intel/tools/aub_read.h               |  11 +-<br>
> > > > > >  src/intel/tools/aubinator.c              |   8 +-<br>
> > > > > >  src/intel/tools/aubinator_error_decode.c |  16 ++<br>
> > > > > >  17 files changed, 763 insertions(+), 722 deletions(-)<br>
> > > > > ><br>
> > > > > > --<br>
> > > > > > 2.17.1<br>
> > > > > ><br>
> > > > > > _______________________________________________<br>
> > > > > > mesa-dev mailing list<br>
> > > > > > <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> > > > > > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> > > > > ><br>
> > > ><br>
> ><br>
<br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<br>
</blockquote></div></div>