From: Katarzyna Dec <katarzyna.dec@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/2] shaders: Add assembler instructions and update README for shaders
Date: Fri, 15 Jun 2018 12:15:01 +0200 [thread overview]
Message-ID: <20180615101501.GI20459@kdec5-desk.ger.corp.intel.com> (raw)
In-Reply-To: <152905434299.18533.7269985157983773849@mail.alporthouse.com>
On Fri, Jun 15, 2018 at 10:19:02AM +0100, Chris Wilson wrote:
> Quoting Katarzyna Dec (2018-06-15 10:12:59)
> > We're not planning to work on assembler in igt anymore, since we can
> > reuse an existing project (IGA) that will do this work for us. The
> > only extra thing we need to do is convert the result binary to C-array,
> > simple python script.
> >
> > Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > Cc: Petri Latvala <petri.latvala@intel.com>
> > Cc: Kalamarz Lukasz <lukasz.kalamarz@intel.com>
> > Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> > ---
> > shaders/README | 37 +++++++++++++++++++++++++++++++++++++
> > shaders/gpgpu/README | 11 +++++++++++
> > shaders/gpgpu/gpgpu_fill_gen8.asm | 10 ++++++++++
> > shaders/gpgpu/gpgpu_fill_gen9.asm | 10 ++++++++++
> > shaders/media/README | 9 +++++++++
> > shaders/media/media_fill_gen8.asm | 11 +++++++++++
> > shaders/ps/README | 8 ++++++++
> > shaders/ps/blit_gen8.asm | 7 +++++++
> > shaders/ps/neg1_gen8.asm | 9 +++++++++
> > 9 files changed, 112 insertions(+)
> > create mode 100644 shaders/README
> > create mode 100644 shaders/gpgpu/gpgpu_fill_gen8.asm
> > create mode 100644 shaders/gpgpu/gpgpu_fill_gen9.asm
> > create mode 100644 shaders/media/media_fill_gen8.asm
> > create mode 100644 shaders/ps/blit_gen8.asm
> > create mode 100644 shaders/ps/neg1_gen8.asm
> >
> > diff --git a/shaders/README b/shaders/README
> > new file mode 100644
> > index 00000000..9e6bf410
> > --- /dev/null
> > +++ b/shaders/README
> > @@ -0,0 +1,37 @@
> > +This directory is for shaders used in media_fill, gpgpu_fill, rendercopy
> > +and media_spin libraries.
> > +
> > +Till Gen8 shaders were generated using intel-gen4asm script (implementation in
> > +assembler/ directory). From Gen8 it is possible to use Intel Graphics Assembler
> > +to generate binary from asm instructions
> > +https://github.com/intel/intel-graphics-compiler/tree/master/visa/iga
> > +Clone and build this project to use IGA.
> > +
> > +where to find IGA binary TODO: add path
> > +
> > +For maintaining compatibility with our tests there is a bin to hex converter
> > +written in python.
> > +Instructions how to build media, gpgpu or ps shaders included in their
> > +subdirectories.
> > +
> > +Converter:
> > +#!/usr/bin/env python2
> > +import struct
> > +import sys
> > +
> > +print "static const uint32_t kernel[][4] = {"
> > +
> > +with open(sys.argv[1], 'r') as f:
> > + fmt = '<LLLL'
> > + step = struct.calcsize(fmt)
> > + while True:
> > + buf = f.read(step)
> > + if not buf:
> > + break
> > + elif len(buf) < step:
> > + buf += '\x00' * (step - len(buf))
> > +
> > + val = struct.unpack('<LLLL', buf)
> > + print " {{ 0x{:08x}, 0x{:08x}, 0x{:08x}, 0x{:08x} }},".format(*val)
> > +
> > +print "};"
> > \ No newline at end of file
>
> How difficult is to make it into a pipe? converter.py < asm.obj > asm.c
> (As well as converter.py -i asm.obj -o asm.c)
>
> Rather than putting this in a README, save the cut'n'paste and include
> it as a .py.
> -Chris
I will add this converter as single file.
Kasia
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-06-15 10:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 9:12 [igt-dev] [PATCH i-g-t v2 0/2] Shaders documentation Katarzyna Dec
2018-06-15 9:12 ` [igt-dev] [PATCH i-g-t v2 1/2] shaders: Add assembler instructions and update README for shaders Katarzyna Dec
2018-06-15 9:19 ` Chris Wilson
2018-06-15 10:15 ` Katarzyna Dec [this message]
2018-06-15 9:13 ` [igt-dev] [PATCH i-g-t v2 2/2] lib/i915: Move shaders directory Katarzyna Dec
2018-06-15 9:20 ` Chris Wilson
2018-06-15 10:12 ` Katarzyna Dec
2018-06-15 10:15 ` Chris Wilson
2018-06-15 10:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Shaders documentation (rev2) Patchwork
2018-06-15 18:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-10-03 13:48 [igt-dev] [PATCH i-g-t v2 0/2] Shaders documentation RESENDING Katarzyna Dec
2018-10-03 13:48 ` [igt-dev] [PATCH i-g-t v2 1/2] shaders: Add assembler instructions and update README for shaders Katarzyna Dec
2018-10-04 7:53 ` Arkadiusz Hiler
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=20180615101501.GI20459@kdec5-desk.ger.corp.intel.com \
--to=katarzyna.dec@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@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