public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH 06/10] lib/gpgpu_fill/tgl: Implement gpgpu_fillfunc for TGL
Date: Mon, 15 Jul 2019 14:51:32 -0700	[thread overview]
Message-ID: <20190715215136.21744-7-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20190715215136.21744-1-lucas.demarchi@intel.com>

From: Katarzyna Dec <katarzyna.dec@intel.com>

Adding gen12p1_gpgpu_fillfunc to have gpgpu_fill running on TGL.
Gpgpu shader was generated using IGA (Intel Graphics Assembler)
based on Gen11 binary adding necessary SWSB dependencies and
changes in SEND instruction.

Shader source code and array containing its assembled version
have same names now to avoid ambiguity.

Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/gpgpu_fill.c                              | 22 +++++++++++++++++++
 lib/gpgpu_fill.h                              |  7 ++++++
 lib/i915/shaders/README                       |  2 ++
 .../shaders/gpgpu/gen12p1_gpgpu_kernel.asm    | 12 ++++++++++
 lib/intel_batchbuffer.c                       |  2 ++
 5 files changed, 45 insertions(+)
 create mode 100644 lib/i915/shaders/gpgpu/gen12p1_gpgpu_kernel.asm

diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index 003f4616..ec7204b8 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -87,6 +87,19 @@ static const uint32_t gen11_gpgpu_kernel[][4] = {
 	{ 0x07800031, 0x20000a40, 0x06000e00, 0x82000010 },
 };
 
+static const uint32_t gen12p1_gpgpu_kernel[][4] = {
+	{ 0x00020061, 0x01050000, 0x00000104, 0x00000000 },
+	{ 0x00000069, 0x02058220, 0x02000024, 0x00000004 },
+	{ 0x00000061, 0x02250220, 0x000000c4, 0x00000000 },
+	{ 0x00030061, 0x04050220, 0x00460005, 0x00000000 },
+	{ 0x00010261, 0x04050220, 0x00220205, 0x00000000 },
+	{ 0x00000061, 0x04454220, 0x00000000, 0x0000000f },
+	{ 0x00040661, 0x05050220, 0x00000104, 0x00000000 },
+	{ 0x00049031, 0x00000000, 0xc0000414, 0x02a00000 },
+	{ 0x00030061, 0x70050220, 0x00460005, 0x00000000 },
+	{ 0x00040131, 0x00000004, 0x7020700c, 0x10000000 },
+};
+
 /*
  * This sets up the gpgpu pipeline,
  *
@@ -282,3 +295,12 @@ void gen11_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
 			      gen11_gpgpu_kernel, sizeof(gen11_gpgpu_kernel));
 }
+void gen12p1_gpgpu_fillfunc(struct intel_batchbuffer *batch,
+			  const struct igt_buf *dst,
+			  unsigned int x, unsigned int y,
+			  unsigned int width, unsigned int height,
+			  uint8_t color)
+{
+	__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
+			      gen12p1_gpgpu_kernel, sizeof(gen12p1_gpgpu_kernel));
+}
diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
index e405df3e..91c7ef71 100644
--- a/lib/gpgpu_fill.h
+++ b/lib/gpgpu_fill.h
@@ -57,4 +57,11 @@ gen11_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 		     unsigned int width, unsigned int height,
 		     uint8_t color);
 
+void
+gen12p1_gpgpu_fillfunc(struct intel_batchbuffer *batch,
+		       const struct igt_buf *dst,
+		       unsigned int x, unsigned int y,
+		       unsigned int width, unsigned int height,
+		       uint8_t color);
+
 #endif /* GPGPU_FILL_H */
diff --git a/lib/i915/shaders/README b/lib/i915/shaders/README
index 06b9883c..6f80111b 100644
--- a/lib/i915/shaders/README
+++ b/lib/i915/shaders/README
@@ -23,3 +23,5 @@ Commands used to generate the shader on gen8
 $> m4 media_fill.gxa > media_fill.gxm
 $> intel-gen4asm -g 8 -o <output> media_fill.gxm
 
+Gen11+ shader is generated using IGA (Intel Graphics Assembler).
+Binary can no longer be generated using intel-gen4asm.
diff --git a/lib/i915/shaders/gpgpu/gen12p1_gpgpu_kernel.asm b/lib/i915/shaders/gpgpu/gen12p1_gpgpu_kernel.asm
new file mode 100644
index 00000000..ede87a05
--- /dev/null
+++ b/lib/i915/shaders/gpgpu/gen12p1_gpgpu_kernel.asm
@@ -0,0 +1,12 @@
+L0:
+         mov (4|M0)               r1.0<1>:ub    r1.0<0;1,0>:ub
+         shl (1|M0)               r2.0<1>:ud    r0.1<0;1,0>:ud    0x4:ud
+         mov (1|M0)               r2.1<1>:ud    r0.6<0;1,0>:ud
+         mov (8|M0)               r4.0<1>:ud    r0.0<8;8,1>:ud
+         mov (2|M0)               r4.0<1>:ud    r2.0<2;2,1>:ud                   {@2}
+         mov (1|M0)               r4.2<1>:ud    0xF:ud
+         mov (16|M0)              r5.0<1>:ud    r1.0<0;1,0>:ud                   {@6}
+         send.dc1 (16|M0)         null     r4      null    0x0         0x40A8000  {@1, $0} //    wr:2h+0, rd:0, Media Block Write msc:0, to #0
+         mov (8|M0)               r112.0<1>:ud  r0.0<8;8,1>:ud
+         send.ts (16|M0)          null     r112    null    0x10000000  0x2000010  {EOT, @1} //    wr:1+0, rd:0, fc: 0x10
+L160:
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 07de5cbb..7fac25b8 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -901,6 +901,8 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid)
 		fill = gen9_gpgpu_fillfunc;
 	else if (IS_GEN11(devid))
 		fill = gen11_gpgpu_fillfunc;
+	else if (IS_TIGERLAKE(devid))
+		fill = gen12p1_gpgpu_fillfunc;
 
 	return fill;
 }
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-07-15 21:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 21:51 [igt-dev] [PATCH 00/10] Add support for Tiger Lake Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 01/10] lib: sync i915_pciids.h with kernel Lucas De Marchi
2019-07-19  6:20   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 02/10] lib/tgl: Add Tigerlake platform definition Lucas De Marchi
2019-07-19  6:21   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 03/10] gem_ctx_isolation.c/tgl - Gen12 enabling for context isolation test Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 04/10] lib/tgl: Add TGL PCI IDs to match table Lucas De Marchi
2019-07-19  6:21   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 05/10] lib/instdone.c/tgl: Add Gen12 support Lucas De Marchi
2019-07-15 21:51 ` Lucas De Marchi [this message]
2019-07-15 21:51 ` [igt-dev] [PATCH 07/10] lib/media_fill/tgl: Implement media_fillfunc for TGL Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 08/10] tests/fb/tgl: Yf tiling does not exist on gen-12 Lucas De Marchi
2019-07-19 12:27   ` Ville Syrjälä
2019-07-15 21:51 ` [igt-dev] [PATCH 09/10] tests/kms_plane_multiple/tgl: PCU messaging test Lucas De Marchi
2019-07-19 12:54   ` Ville Syrjälä
2019-07-22  8:37     ` B S, Karthik
2019-07-22 16:46       ` Lucas De Marchi
2019-07-23  2:44         ` B S, Karthik
2019-08-02 10:43   ` Kahola, Mika
2019-07-15 21:51 ` [igt-dev] [PATCH 10/10] tests/kms_plane_multiple/tgl: Set highest mode for " Lucas De Marchi
2019-08-02 10:44   ` Kahola, Mika
2019-07-15 22:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add support for Tiger Lake Patchwork

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=20190715215136.21744-7-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --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