Skip to contentSkip to conversation

skl: Add SKL PCI ids

PATCH In review Damien Lespiau 1 participant 27 messages Sep 26, 2014 – Sep 30, 2014 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/26 skl: Add SKL PCI ids

v2: Update to the latest PCI ids

---
 lib/intel_chipset.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 52 insertions(+), 6 deletions(-)
lib/intel_chipset.h +52 -6
index 404c632..e3ce603 100644
@@ -189,6 +189,22 @@ void intel_check_pch(void);
 #define PCI_CHIP_CHERRYVIEW_2		0x22b2
 #define PCI_CHIP_CHERRYVIEW_3		0x22b3
 
+#define PCI_CHIP_SKYLAKE_ULT_GT2	0x1916
+#define PCI_CHIP_SKYLAKE_ULT_GT1	0x1906
+#define PCI_CHIP_SKYLAKE_ULT_GT3	0x1926
+#define PCI_CHIP_SKYLAKE_ULT_GT2F	0x1921
+#define PCI_CHIP_SKYLAKE_ULX_GT1	0x190E
+#define PCI_CHIP_SKYLAKE_ULX_GT2	0x191E
+#define PCI_CHIP_SKYLAKE_DT_GT2		0x1912
+#define PCI_CHIP_SKYLAKE_DT_GT1		0x1902
+#define PCI_CHIP_SKYLAKE_HALO_GT2	0x191B
+#define PCI_CHIP_SKYLAKE_HALO_GT3	0x192B
+#define PCI_CHIP_SKYLAKE_HALO_GT1 	0x190B
+#define PCI_CHIP_SKYLAKE_SRV_GT2	0x191A
+#define PCI_CHIP_SKYLAKE_SRV_GT3	0x192A
+#define PCI_CHIP_SKYLAKE_SRV_GT1	0x190A
+#define PCI_CHIP_SKYLAKE_WKS_GT2 	0x191D
+
 #endif /* __GTK_DOC_IGNORE__ */
 
 #define IS_MOBILE(devid)	((devid) == PCI_CHIP_I855_GM || \
@@ -350,18 +366,44 @@ void intel_check_pch(void);
 #define IS_GEN8(devid)		(IS_BROADWELL(devid) || \
 				 IS_CHERRYVIEW(devid))
 
+#define IS_SKL_GT1(devid)	((devid) == PCI_CHIP_SKYLAKE_ULT_GT1	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_ULX_GT1	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_DT_GT1	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_HALO_GT1	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_SRV_GT1)
+
+#define IS_SKL_GT2(devid)	((devid) == PCI_CHIP_SKYLAKE_ULT_GT2	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_ULT_GT2F	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_ULX_GT2	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_DT_GT2	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_HALO_GT2	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_SRV_GT2	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_WKS_GT2)
+
+#define IS_SKL_GT3(devid)	((devid) == PCI_CHIP_SKYLAKE_ULT_GT3	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_HALO_GT3	|| \
+				 (devid) == PCI_CHIP_SKYLAKE_SRV_GT3)
+
+#define IS_SKYLAKE(devid)	(IS_SKL_GT1(devid) || \
+				 IS_SKL_GT2(devid) || \
+				 IS_SKL_GT3(devid))
+
+#define IS_GEN9(devid)		IS_SKYLAKE(devid)
+
 #define IS_965(devid)		(IS_GEN4(devid) || \
 				 IS_GEN5(devid) || \
 				 IS_GEN6(devid) || \
 				 IS_GEN7(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define IS_9XX(devid)		(IS_GEN3(devid) || \
 				 IS_GEN4(devid) || \
 				 IS_GEN5(devid) || \
 				 IS_GEN6(devid) || \
 				 IS_GEN7(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define IS_INTEL(devid)		(IS_GEN2(devid) || \
 				 IS_GEN3(devid) || \
@@ -369,21 +411,25 @@ void intel_check_pch(void);
 				 IS_GEN5(devid) || \
 				 IS_GEN6(devid) || \
 				 IS_GEN7(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define HAS_PCH_SPLIT(devid)	(IS_GEN5(devid) || \
 				 IS_GEN6(devid) || \
 				 IS_IVYBRIDGE(devid) || IS_HASWELL(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define HAS_BLT_RING(devid)	(IS_GEN6(devid) || \
 				 IS_GEN7(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define HAS_BSD_RING(devid)	(IS_GEN5(devid) || \
 				 IS_GEN6(devid) || \
 				 IS_GEN7(devid) || \
-				 IS_GEN8(devid))
+				 IS_GEN8(devid) || \
+				 IS_GEN9(devid))
 
 #define IS_BROADWATER(devid)	((devid) == PCI_CHIP_I946_GZ || \
 				 (devid) == PCI_CHIP_I965_G_1 || \
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/26 skl: Add gen9 to intel_gen()

---
 lib/intel_chipset.c | 2 ++
 1 file changed, 2 insertions(+)
lib/intel_chipset.c +2 -0
index 0828e44..fafd232 100644
@@ -172,6 +172,8 @@ int intel_gen(uint32_t devid)
 		return 7;
 	if (IS_GEN8(devid))
 		return 8;
+	if (IS_GEN9(devid))
+		return 9;
 
 	return -1;
 }
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 3/26 skl: initialize instdone bits for gen9

In reply to Damien Lespiau

gen9 uses the same bits as gen8.

---
 lib/instdone.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
lib/instdone.c +9 -1
index 51cdff9..fffb949 100644
@@ -417,10 +417,18 @@ init_gen8_instdone(void)
 	init_gen75_instdone();
 }
 
+static void
+init_gen9_instdone(void)
+{
+	init_gen8_instdone();
+}
+
 void
 init_instdone_definitions(uint32_t devid)
 {
-	if (IS_GEN8(devid)) {
+	if (IS_GEN9(devid)) {
+		init_gen9_instdone();
+	} else if (IS_GEN8(devid)) {
 		init_gen8_instdone();
 	} else if (IS_GEN7(devid)) {
 		init_gen7_instdone();
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 4/26 list-workarounds/skl: Add Skylake to the list of valid platorms

In reply to Damien Lespiau
---
 scripts/list-workarounds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/list-workarounds +1 -1
index 5a84ee8..620d02f 100755
@@ -18,7 +18,7 @@ def find_nth(haystack, needle, n):
 	return start
 
 valid_platforms = ('ctg', 'elk', 'ilk', 'snb', 'ivb', 'vlv', 'hsw', 'bdw',
-		   'chv')
+		   'chv', 'skl')
 def parse_platforms(p):
 	l =  p.split(',')
 	for p in l:
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 5/26 rendercopy/skl: Start the gen9 rendercopy from the gen8 version

In reply to Damien Lespiau

v2 (Ben): Rebased on:
commit ea11d103e0617e33bce6f11328521d15b13422b0

Author: Oscar Mateo <[email protected]>
Date:   Tue Nov 12 11:50:35 2013 +0000

build: list all test/tool/lib source files in their own Makefile.sources

v3: (Ben): Rebased on the doc/API rework. Probably needs review

---
 lib/Makefile.sources  |   2 +
 lib/gen9_render.h     |   7 +
 lib/rendercopy.h      |   4 +
 lib/rendercopy_gen9.c | 971 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 984 insertions(+)
 create mode 100644 lib/gen9_render.h
 create mode 100644 lib/rendercopy_gen9.c
lib/Makefile.sources +2 -0
index 242d2e0..82e306d 100644
@@ -33,9 +33,11 @@ libintel_tools_la_SOURCES = 	\
 	gen6_render.h		\
 	gen7_render.h		\
 	gen8_render.h		\
+	gen9_render.h		\
 	rendercopy_gen6.c	\
 	rendercopy_gen7.c	\
 	rendercopy_gen8.c	\
+	rendercopy_gen9.c	\
 	rendercopy.h		\
 	intel_reg_map.c		\
 	intel_iosf.c		\
lib/gen9_render.h new file +7 -0
new file mode 100644
index 0000000..170b1fc
@@ -0,0 +1,7 @@
+#ifndef GEN9_RENDER_H
+#define GEN9_RENDER_H
+
+#include "gen8_render.h"
+
+
+#endif
lib/rendercopy.h +4 -0
index 20619d6..f15df0e 100644
@@ -23,6 +23,10 @@ static inline void emit_vertex_normalized(struct intel_batchbuffer *batch,
 	OUT_BATCH(u.ui);
 }
 
+void gen9_render_copyfunc(struct intel_batchbuffer *batch,
+			  struct igt_buf *src, unsigned src_x, unsigned src_y,
+			  unsigned width, unsigned height,
+			  struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
 void gen8_render_copyfunc(struct intel_batchbuffer *batch,
 			  drm_intel_context *context,
 			  struct igt_buf *src, unsigned src_x, unsigned src_y,
lib/rendercopy_gen9.c new file +971 -0

971 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 6/26 rendercopy/skl: Set the 3DSTATE_VF state

In reply to Damien Lespiau

This is to ensure the "Component Packing Enable" bit is set to 0.

---
 lib/gen9_render.h     | 1 +
 lib/rendercopy_gen9.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
lib/gen9_render.h +1 -0
index 170b1fc..6de4a91 100644
@@ -3,5 +3,6 @@
 
 #include "gen8_render.h"
 
+#define GEN7_3DSTATE_VF				GEN6_3D(3, 0, 0x0c)
 
 #endif
lib/rendercopy_gen9.c +4 -1
index 97ed541..ae4893f 100644
@@ -19,7 +19,7 @@
 #include "intel_batchbuffer.h"
 #include "intel_io.h"
 #include "rendercopy.h"
-#include "gen8_render.h"
+#include "gen9_render.h"
 #include "intel_reg.h"
 #include "igt_aux.h"
 
@@ -821,6 +821,9 @@ static void gen8_emit_vf_topology(struct intel_batchbuffer *batch)
 /* Vertex elements MUST be defined before this according to spec */
 static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset)
 {
+	OUT_BATCH(GEN7_3DSTATE_VF | (2 - 2));
+	OUT_BATCH(0);
+
 	OUT_BATCH(GEN8_3DSTATE_VF_INSTANCING | (3 - 2));
 	OUT_BATCH(0);
 	OUT_BATCH(0);
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 7/26 rendercopy/skl: Update 3DSTATE_SBE

In reply to Damien Lespiau

SBE has now to be explicitely told which channels of which components are used by the pixel shader.

---
 lib/gen9_render.h     | 5 +++++
 lib/rendercopy_gen9.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)
lib/gen9_render.h +5 -0
index 6de4a91..8d6398c 100644
@@ -5,4 +5,9 @@
 
 #define GEN7_3DSTATE_VF				GEN6_3D(3, 0, 0x0c)
 
+#define GEN9_SBE_ACTIVE_COMPONENT_NONE		0
+#define GEN9_SBE_ACTIVE_COMPONENT_XY		1
+#define GEN9_SBE_ACTIVE_COMPONENT_XYZ		2
+#define GEN9_SBE_ACTIVE_COMPONENT_XYZW		3
+
 #endif
lib/rendercopy_gen9.c +3 -1
index ae4893f..01d5ef3 100644
@@ -706,7 +706,7 @@ gen8_emit_sf(struct intel_batchbuffer *batch)
 {
 	int i;
 
-	OUT_BATCH(GEN7_3DSTATE_SBE | (4 - 2));
+	OUT_BATCH(GEN7_3DSTATE_SBE | (6 - 2));
 	OUT_BATCH(1 << GEN7_SBE_NUM_OUTPUTS_SHIFT |
 		  GEN8_SBE_FORCE_URB_ENTRY_READ_LENGTH |
 		  GEN8_SBE_FORCE_URB_ENTRY_READ_OFFSET |
@@ -714,6 +714,8 @@ gen8_emit_sf(struct intel_batchbuffer *batch)
 		  1 << GEN8_SBE_URB_ENTRY_READ_OFFSET_SHIFT);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
+	OUT_BATCH(GEN9_SBE_ACTIVE_COMPONENT_XYZW << 0);
+	OUT_BATCH(0);
 
 	OUT_BATCH(GEN8_3DSTATE_SBE_SWIZ | (11 - 2));
 	for (i = 0; i < 8; i++)
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 8/26 rendercopy/skl: Pass the context to rendercopy function on SKL

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/rendercopy.h           |  1 +
 lib/rendercopy_gen9.c      | 12 +++++++-----
 tools/intel_error_decode.c |  1 +
 3 files changed, 9 insertions(+), 5 deletions(-)
lib/rendercopy.h +1 -0
index f15df0e..fdc3cab 100644
@@ -24,6 +24,7 @@ static inline void emit_vertex_normalized(struct intel_batchbuffer *batch,
 }
 
 void gen9_render_copyfunc(struct intel_batchbuffer *batch,
+			  drm_intel_context *context,
 			  struct igt_buf *src, unsigned src_x, unsigned src_y,
 			  unsigned width, unsigned height,
 			  struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
lib/rendercopy_gen9.c +7 -5
index 01d5ef3..40f1c6f 100644
@@ -166,14 +166,15 @@ batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint
 }
 
 static void
-gen6_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end)
+gen6_render_flush(struct intel_batchbuffer *batch,
+		  drm_intel_context *context, uint32_t batch_end)
 {
 	int ret;
 
 	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
 	if (ret == 0)
-		ret = drm_intel_bo_mrb_exec(batch->bo, batch_end,
-					    NULL, 0, 0, 0);
+		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
+						    batch_end, 0);
 	assert(ret == 0);
 }
 
@@ -872,6 +873,7 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset
 #define BATCH_STATE_SPLIT 2048
 
 void gen9_render_copyfunc(struct intel_batchbuffer *batch,
+			  drm_intel_context *context,
 			  struct igt_buf *src, unsigned src_x, unsigned src_y,
 			  unsigned width, unsigned height,
 			  struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
@@ -881,7 +883,7 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 	uint32_t vertex_buffer;
 	uint32_t batch_end;
 
-	intel_batchbuffer_flush(batch);
+	intel_batchbuffer_flush_with_context(batch, context);
 
 	batch_align(batch, 8);
 
@@ -971,6 +973,6 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 
 	annotation_flush(&aub_annotations, batch);
 
-	gen6_render_flush(batch, batch_end);
+	gen6_render_flush(batch, context, batch_end);
 	intel_batchbuffer_reset(batch);
 }
tools/intel_error_decode.c +1 -0
index 1eeff07..14589a3 100644
@@ -56,6 +56,7 @@
 #include "intel_io.h"
 #include "instdone.h"
 #include "intel_reg.h"
+#include "drmtest.h"
 
 static uint32_t
 print_head(unsigned int reg)
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 9/26 rendercopy/skl: update instruction length

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

This is ported from that on BDW.

v2: Only bump the prefix when we need to program the instruction differently with the previous generations.

---
 lib/rendercopy_gen9.c | 89 +++++++++++++++++++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 28 deletions(-)
lib/rendercopy_gen9.c +61 -28
index 40f1c6f..2c769bc 100644
@@ -490,8 +490,9 @@ gen6_create_scissor_rect(struct intel_batchbuffer *batch)
 }
 
 static void
-gen6_emit_sip(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN6_STATE_SIP | 0);
+gen8_emit_sip(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN6_STATE_SIP | (3 - 2));
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 }
 
@@ -575,9 +576,7 @@ gen8_emit_cc(struct intel_batchbuffer *batch) {
 
 static void
 gen8_emit_multisample(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN8_3DSTATE_MULTISAMPLE | 2);
-	OUT_BATCH(0);
-	OUT_BATCH(0);
+	OUT_BATCH(GEN8_3DSTATE_MULTISAMPLE | 0);
 	OUT_BATCH(0);
 
 	OUT_BATCH(GEN6_3DSTATE_SAMPLE_MASK);
@@ -585,14 +584,18 @@ gen8_emit_multisample(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen7_emit_vs(struct intel_batchbuffer *batch) {
+gen8_emit_vs(struct intel_batchbuffer *batch) {
 	OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS);
 	OUT_BATCH(0);
 
 	OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN6_3DSTATE_CONSTANT_VS | (7-2));
+	OUT_BATCH(GEN6_3DSTATE_CONSTANT_VS | (11-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -600,7 +603,10 @@ gen7_emit_vs(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN6_3DSTATE_VS | (6-2));
+	OUT_BATCH(GEN6_3DSTATE_VS | (9-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -609,8 +615,12 @@ gen7_emit_vs(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen7_emit_hs(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN7_3DSTATE_CONSTANT_HS | (7-2));
+gen8_emit_hs(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN7_3DSTATE_CONSTANT_HS | (11-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -618,7 +628,9 @@ gen7_emit_hs(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_HS | (7-2));
+	OUT_BATCH(GEN7_3DSTATE_HS | (9-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -634,8 +646,12 @@ gen7_emit_hs(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen7_emit_gs(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN7_3DSTATE_CONSTANT_GS | (7-2));
+gen8_emit_gs(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN7_3DSTATE_CONSTANT_GS | (11-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -643,7 +659,10 @@ gen7_emit_gs(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_GS | (7-2));
+	OUT_BATCH(GEN7_3DSTATE_GS | (10-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -659,8 +678,12 @@ gen7_emit_gs(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen7_emit_ds(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN7_3DSTATE_CONSTANT_DS | (7-2));
+gen8_emit_ds(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN7_3DSTATE_CONSTANT_DS | (11-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -668,7 +691,10 @@ gen7_emit_ds(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_DS | (6-2));
+	OUT_BATCH(GEN7_3DSTATE_DS | (9-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -683,15 +709,15 @@ gen7_emit_ds(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen7_emit_null_state(struct intel_batchbuffer *batch) {
-	gen7_emit_hs(batch);
+gen8_emit_null_state(struct intel_batchbuffer *batch) {
+	gen8_emit_hs(batch);
 	OUT_BATCH(GEN7_3DSTATE_TE | (4-2));
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
-	gen7_emit_gs(batch);
-	gen7_emit_ds(batch);
-	gen7_emit_vs(batch);
+	gen8_emit_gs(batch);
+	gen8_emit_ds(batch);
+	gen8_emit_vs(batch);
 }
 
 static void
@@ -782,7 +808,8 @@ gen8_emit_ps(struct intel_batchbuffer *batch, uint32_t kernel) {
 
 static void
 gen8_emit_depth(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER | (7-2));
+	OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER | (8-2));
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -790,11 +817,15 @@ gen8_emit_depth(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER | (3-2));
+	OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER | (5-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER | (3-2));
+	OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER | (5-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 }
@@ -913,7 +944,7 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 	 * order */
 	OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D);
 
-	gen6_emit_sip(batch);
+	gen8_emit_sip(batch);
 
 	gen7_emit_push_constants(batch);
 
@@ -930,9 +961,11 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 
 	gen8_emit_multisample(batch);
 
-	gen7_emit_null_state(batch);
+	gen8_emit_null_state(batch);
 
-	OUT_BATCH(GEN7_3DSTATE_STREAMOUT | 1);
+	OUT_BATCH(GEN7_3DSTATE_STREAMOUT | (5 - 2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 10/26 rendercopy/skl: Set Instruction Buffer size Modify Enable to 1

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

This is ported from that on BDW.

---
 lib/rendercopy_gen9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rendercopy_gen9.c +1 -1
index 2c769bc..dce63ae 100644
@@ -545,7 +545,7 @@ gen8_emit_state_base_address(struct intel_batchbuffer *batch) {
 	/* indirect object buffer size */
 	OUT_BATCH(0xfffff000 | 1);
 	/* intruction buffer size */
-	OUT_BATCH(1 << 12);
+	OUT_BATCH(1 << 12 | 1);
 }
 
 static void
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 11/26 rendercopy/skl: Fix the STATE_BASE_ADDRESS instruction length

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/rendercopy_gen9.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
lib/rendercopy_gen9.c +8 -3
index dce63ae..f98019e 100644
@@ -511,8 +511,8 @@ gen7_emit_push_constants(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen8_emit_state_base_address(struct intel_batchbuffer *batch) {
-	OUT_BATCH(GEN6_STATE_BASE_ADDRESS | (16 - 2));
+gen9_emit_state_base_address(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN6_STATE_BASE_ADDRESS | (19 - 2));
 
 	/* general */
 	OUT_BATCH(0 | BASE_ADDRESS_MODIFY);
@@ -546,6 +546,11 @@ gen8_emit_state_base_address(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0xfffff000 | 1);
 	/* intruction buffer size */
 	OUT_BATCH(1 << 12 | 1);
+
+	/* Bindless surface state base address */
+	OUT_BATCH(0 | BASE_ADDRESS_MODIFY);
+	OUT_BATCH(0);
+	OUT_BATCH(0xfffff000);
 }
 
 static void
@@ -948,7 +953,7 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 
 	gen7_emit_push_constants(batch);
 
-	gen8_emit_state_base_address(batch);
+	gen9_emit_state_base_address(batch);
 
 	OUT_BATCH(GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC);
 	OUT_BATCH(viewport.cc_state);
Signature · 1 line
1.8.3.1
#11 lore raw

PATCH 12/26 rendercopy/skl: Fix the 3DSTATE_DS instruction length

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/rendercopy_gen9.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
lib/rendercopy_gen9.c +5 -3
index f98019e..1aacaa2 100644
@@ -683,7 +683,7 @@ gen8_emit_gs(struct intel_batchbuffer *batch) {
 }
 
 static void
-gen8_emit_ds(struct intel_batchbuffer *batch) {
+gen9_emit_ds(struct intel_batchbuffer *batch) {
 	OUT_BATCH(GEN7_3DSTATE_CONSTANT_DS | (11-2));
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -696,7 +696,9 @@ gen8_emit_ds(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 
-	OUT_BATCH(GEN7_3DSTATE_DS | (9-2));
+	OUT_BATCH(GEN7_3DSTATE_DS | (11-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	OUT_BATCH(0);
@@ -721,7 +723,7 @@ gen8_emit_null_state(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 	OUT_BATCH(0);
 	gen8_emit_gs(batch);
-	gen8_emit_ds(batch);
+	gen9_emit_ds(batch);
 	gen8_emit_vs(batch);
 }
 
Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 13/26 rendercopy/skl: Emit 3DSTATE_WM_HZ_OP

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

This is from that on BDW. Without it, the pixel pipeline can't work well.

---
 lib/rendercopy_gen9.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
lib/rendercopy_gen9.c +11 -0
index 1aacaa2..52fc90f 100644
@@ -715,8 +715,19 @@ gen9_emit_ds(struct intel_batchbuffer *batch) {
 	OUT_BATCH(0);
 }
 
+
+static void
+gen8_emit_wm_hz_op(struct intel_batchbuffer *batch) {
+	OUT_BATCH(GEN8_3DSTATE_WM_HZ_OP | (5-2));
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+}
+
 static void
 gen8_emit_null_state(struct intel_batchbuffer *batch) {
+	gen8_emit_wm_hz_op(batch);
 	gen8_emit_hs(batch);
 	OUT_BATCH(GEN7_3DSTATE_TE | (4-2));
 	OUT_BATCH(0);
Signature · 1 line
1.8.3.1
#13 lore raw

PATCH 14/26 rendercopy/skl: Follow the spec to add the Pipeline selection mask

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/gen9_render.h     | 2 ++
 lib/rendercopy_gen9.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
lib/gen9_render.h +2 -0
index 8d6398c..2cd7530 100644
@@ -10,4 +10,6 @@
 #define GEN9_SBE_ACTIVE_COMPONENT_XYZ		2
 #define GEN9_SBE_ACTIVE_COMPONENT_XYZW		3
 
+#define GEN9_PIPELINE_SELECTION_MASK		(3 << 8)
+
 #endif
lib/rendercopy_gen9.c +2 -1
index 52fc90f..8621f7f 100644
@@ -960,7 +960,8 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,
 
 	/* Start emitting the commands. The order roughly follows the mesa blorp
 	 * order */
-	OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D);
+	OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D |
+				GEN9_PIPELINE_SELECTION_MASK);
 
 	gen8_emit_sip(batch);
 
Signature · 1 line
1.8.3.1
#14 lore raw

PATCH 15/26 rendercopy/skl: Set the URB VS start address to 4

In reply to Damien Lespiau

From: "Xiang, Haihao" <[email protected]>

A value less than 4 might result in GPU hang on simulation

---
 lib/rendercopy_gen9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rendercopy_gen9.c +1 -1
index 8621f7f..92265c1 100644
@@ -558,7 +558,7 @@ gen7_emit_urb(struct intel_batchbuffer *batch) {
 	/* XXX: Min valid values from mesa */
 	const int vs_entries = 64;
 	const int vs_size = 2;
-	const int vs_start = 2;
+	const int vs_start = 4;
 
 	OUT_BATCH(GEN7_3DSTATE_URB_VS);
 	OUT_BATCH(vs_entries | ((vs_size - 1) << 16) | (vs_start << 25));
Signature · 1 line
1.8.3.1
#15 lore raw

PATCH 16/26 assembler/skl: Add gen 9 to the -g option

In reply to Damien Lespiau
---
 assembler/disasm-main.c | 4 ++--
 assembler/main.c        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
assembler/disasm-main.c +2 -2
index 5e4cb0e..b365556 100644
@@ -100,7 +100,7 @@ static void usage(void)
     fprintf(stderr, "usage: intel-gen4disasm [options] inputfile\n");
     fprintf(stderr, "\t-b, --binary                         C style binary output\n");
     fprintf(stderr, "\t-o, --output {outputfile}            Specify output file\n");
-    fprintf(stderr, "\t-g, --gen <4|5|6|7|8>                Specify GPU generation\n");
+    fprintf(stderr, "\t-g, --gen <4|5|6|7|8|9>              Specify GPU generation\n");
 }
 
 int main(int argc, char **argv)
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
 	case 'g':
 	    gen = strtol(optarg, NULL, 10);
 
-	    if (gen < 4 || gen > 8) {
+	    if (gen < 4 || gen > 9) {
 		    usage();
 		    exit(1);
 	    }
assembler/main.c +2 -2
index 469406a..a1eca52 100644
@@ -97,7 +97,7 @@ static void usage(void)
 	fprintf(stderr, "\t-e, --export {exportfile}            Export label file\n");
 	fprintf(stderr, "\t-l, --input_list {entrytablefile}    Input entry_table_list file\n");
 	fprintf(stderr, "\t-o, --output {outputfile}            Specify output file\n");
-	fprintf(stderr, "\t-g, --gen <4|5|6|7|8>                Specify GPU generation\n");
+	fprintf(stderr, "\t-g, --gen <4|5|6|7|8|9>              Specify GPU generation\n");
 }
 
 static int hash(char *key)
@@ -311,7 +311,7 @@ int main(int argc, char **argv)
 				}
 			}
 
-			if (gen_level < 40 || gen_level > 80) {
+			if (gen_level < 40 || gen_level > 90) {
 				usage();
 				exit(1);
 			}
Signature · 1 line
1.8.3.1
#16 lore raw

PATCH 17/26 assembler/skl: Redefine the cache agent type for some fixed functions

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

The different cache agent type is defined for SKL although it still uses the same function ID as the previous generations.

---
 assembler/brw_defines.h | 7 +++++++
 1 file changed, 7 insertions(+)
assembler/brw_defines.h +7 -0
index f74342c..6ca3e17 100644
@@ -880,6 +880,13 @@ enum brw_message_target {
 
    HSW_SFID_DATAPORT_DATA_CACHE1     = 0x0c,
    HSW_SFID_CRE                      = 0x0d,
+
+   /* There is no Sampler data port cache(0x04) on SKL and it is used
+    * as the extension of DP_DC0/DP_DC1.
+    */
+   SKL_SFID_DATAPORT_DATA_CACHE2     = 0x4,
+   /* Data Read only Data port cache */
+   SKL_SFID_DATAPORT_DCR0            = 0x9,
 };
 
 #define BRW_SAMPLER_RETURN_FORMAT_FLOAT32     0
Signature · 1 line
1.8.3.1
#17 lore raw

PATCH 18/26 assembler/skl: update read(...)

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

READ(...) is used for Render Target read and Media Block read. But there is no sampler cache agent on gen9. At the same time two message types don't share the same cache agent any more. So a parameter is needed for cache agent. The 2th parameter of read(...) is not used for gen6/gen7/gen8. Hence it is reused as cache agent for SKL as that on ILK.

---
 assembler/gram.y | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
assembler/gram.y +21 -1
index e56533d..157ce79 100644
@@ -1609,7 +1609,27 @@ msgtarget:	NULL_TOKEN
 		| READ  LPAREN INTEGER COMMA INTEGER COMMA INTEGER COMMA
                 INTEGER RPAREN
 		{
-		  if (IS_GENp(8)) {
+                  if (IS_GENp(9)) {
+                      if ($5 != 0 &&
+			  $5 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
+			  $5 != GEN7_SFID_DATAPORT_DATA_CACHE &&
+			  $5 != HSW_SFID_DATAPORT_DATA_CACHE1 &&
+			  $5 != SKL_SFID_DATAPORT_DCR0 &&
+			  $5 != SKL_SFID_DATAPORT_DATA_CACHE2) {
+			  error (&@9, "error: wrong cache type\n");
+		      }
+
+		      if ($5 == 0)
+			  gen8_set_sfid(GEN8(&$$), HSW_SFID_DATAPORT_DATA_CACHE1);
+		      else
+			  gen8_set_sfid(GEN8(&$$), $5);
+
+                      gen8_set_header_present(GEN8(&$$), 1);
+                      gen8_set_dp_binding_table_index(GEN8(&$$), $3);
+                      gen8_set_dp_message_control(GEN8(&$$), $7);
+                      gen8_set_dp_message_type(GEN8(&$$), $9);
+                      gen8_set_dp_category(GEN8(&$$), 0);
+                  } else if (IS_GENp(8)) {
                       gen8_set_sfid(GEN8(&$$), GEN6_SFID_DATAPORT_SAMPLER_CACHE);
                       gen8_set_header_present(GEN8(&$$), 1);
                       gen8_set_dp_binding_table_index(GEN8(&$$), $3);
Signature · 1 line
1.8.3.1
#18 lore raw

PATCH 19/26 assembler/skl: Add more cache agent for write(...)

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 assembler/gram.y | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
assembler/gram.y +30 -10
index 157ce79..9689352 100644
@@ -1671,11 +1671,21 @@ msgtarget:	NULL_TOKEN
 		INTEGER RPAREN
 		{
 		  if (IS_GENp(8)) {
-                      if ($9 != 0 &&
-			  $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
-			  $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
-			  $9 != HSW_SFID_DATAPORT_DATA_CACHE1) {
-			  error (&@9, "error: wrong cache type\n");
+                      if (IS_GENp(9)) {
+                          if ($9 != 0 &&
+			      $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
+			      $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
+			      $9 != HSW_SFID_DATAPORT_DATA_CACHE1 &&
+			      $9 != SKL_SFID_DATAPORT_DATA_CACHE2) {
+			      error (&@9, "error: wrong cache type\n");
+                          }
+                      } else {
+                          if ($9 != 0 &&
+			      $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
+			      $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
+			      $9 != HSW_SFID_DATAPORT_DATA_CACHE1) {
+			      error (&@9, "error: wrong cache type\n");
+                          }
 		      }
 
 		      if ($9 == 0)
@@ -1732,11 +1742,21 @@ msgtarget:	NULL_TOKEN
 		INTEGER COMMA INTEGER RPAREN
 		{
 		  if (IS_GENp(8)) {
-                      if ($9 != 0 &&
-			  $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
-			  $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
-			  $9 != HSW_SFID_DATAPORT_DATA_CACHE1) {
-			  error (&@9, "error: wrong cache type\n");
+                      if (IS_GENp(9)) {
+                          if ($9 != 0 &&
+			      $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
+			      $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
+			      $9 != HSW_SFID_DATAPORT_DATA_CACHE1 &&
+			      $9 != SKL_SFID_DATAPORT_DATA_CACHE2) {
+			      error (&@9, "error: wrong cache type\n");
+                          }
+                      } else {
+                          if ($9 != 0 &&
+			      $9 != GEN6_SFID_DATAPORT_RENDER_CACHE &&
+			      $9 != GEN7_SFID_DATAPORT_DATA_CACHE &&
+			      $9 != HSW_SFID_DATAPORT_DATA_CACHE1) {
+			      error (&@9, "error: wrong cache type\n");
+                          }
 		      }
 
 		      if ($9 == 0)
Signature · 1 line
1.8.3.1
#19 lore raw

PATCH 20/26 assembler/skl: update the extdesc field for SEND instruction

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

The send instruction on gen9 uses the 32bit immediate instead of 6bit immediate for the extended message descriptors. And some bits of SEND instruction are defined as the extdesc field.

---
 assembler/brw_defines.h      |  2 ++
 assembler/gen8_instruction.c | 20 ++++++++++++++++++++
 assembler/gen8_instruction.h |  2 ++
 assembler/gram.y             | 16 ++++++++++++++--
 4 files changed, 38 insertions(+), 2 deletions(-)
assembler/brw_defines.h +2 -0
index 6ca3e17..24e5e30 100644
@@ -1647,4 +1647,6 @@ enum brw_wm_barycentric_interp_mode {
 #define EX_DESC_SFID_MASK 0xF
 #define EX_DESC_EOT_MASK  0x20
 
+#define EX_DESC_FUNC_MASK 0xFFFFFFC0
+
 #endif
assembler/gen8_instruction.c +20 -0
index 31c15ca..fe0067e 100644
@@ -423,3 +423,23 @@ gen8_set_dp_message(struct gen8_instruction *inst,
    gen8_set_function_control(inst,
          binding_table_index | msg_type << 14 | msg_control << 8);
 }
+
+
+void
+gen9_set_send_extdesc(struct gen8_instruction *inst,
+		     unsigned int value)
+{
+   unsigned int extdesc;
+
+   extdesc = (value >> 16) & 0x0f;
+   gen8_set_bits(inst, 67, 64, extdesc);
+
+   extdesc = (value >> 20) & 0x0f;
+   gen8_set_bits(inst, 83, 80, extdesc);
+
+   extdesc = (value >> 24) & 0x0f;
+   gen8_set_bits(inst, 88, 85, extdesc);
+
+   extdesc = (value >> 28) & 0x0f;
+   gen8_set_bits(inst, 94, 91, extdesc);
+}
assembler/gen8_instruction.h +2 -0
index 5e72e45..7db4746 100644
@@ -357,4 +357,6 @@ gen8_set_bits(struct gen8_instruction *insn,
    insn->data[word] = (insn->data[word] & ~mask) | ((value << low) & mask);
 }
 
+void gen9_set_send_extdesc(struct gen8_instruction *insn, unsigned int value);
+
 #endif
assembler/gram.y +14 -2
index 9689352..23e1a57 100644
@@ -1190,7 +1190,11 @@ sendinstruction: predicate sendop execsize exp post_dst payload msgtarget
                           YYERROR;
 		  }
 
-		  if (IS_GENp(8)) {
+		  if (IS_GENp(9)) {
+		      gen8_set_src1_reg_file(GEN8(&$$), BRW_IMMEDIATE_VALUE);
+		      gen8_set_src1_reg_type(GEN8(&$$), BRW_REGISTER_TYPE_D);
+		      gen9_set_send_extdesc(GEN8(&$$), 0);
+		  } else if (IS_GENp(8)) {
 		      gen8_set_src1_reg_file(GEN8(&$$), BRW_IMMEDIATE_VALUE);
 		      gen8_set_src1_reg_type(GEN8(&$$), BRW_REGISTER_TYPE_D);
 		  } else {
@@ -1308,7 +1312,11 @@ sendinstruction: predicate sendop execsize exp post_dst payload msgtarget
                   set_instruction_src0(&$$, &src0, NULL);
 		  set_instruction_src1(&$$, &$7, NULL);
 
-                  if (IS_GENp(8)) {
+                  if (IS_GENp(9)) {
+                      gen8_set_sfid(GEN8(&$$), $6 & EX_DESC_SFID_MASK);
+                      gen8_set_eot(GEN8(&$$), !!($6 & EX_DESC_EOT_MASK));
+                      gen9_set_send_extdesc(GEN8(&$$), $6 & EX_DESC_FUNC_MASK);
+                  } else if (IS_GENp(8)) {
                       gen8_set_sfid(GEN8(&$$), $6 & EX_DESC_SFID_MASK);
                       gen8_set_eot(GEN8(&$$), !!($6 & EX_DESC_EOT_MASK));
 		  } else {
@@ -1358,6 +1366,10 @@ sendinstruction: predicate sendop execsize exp post_dst payload msgtarget
                   if (IS_GENp(8)) {
                       gen8_set_sfid(GEN8(&$$), $6 & EX_DESC_SFID_MASK);
                       gen8_set_eot(GEN8(&$$), !!($6 & EX_DESC_EOT_MASK));
+                      gen9_set_send_extdesc(GEN8(&$$), $6 & EX_DESC_FUNC_MASK);
+		  } else if (IS_GENp(8)) {
+                      gen8_set_sfid(GEN8(&$$), $6 & EX_DESC_SFID_MASK);
+                      gen8_set_eot(GEN8(&$$), !!($6 & EX_DESC_EOT_MASK));
 		  } else {
                       GEN(&$$)->header.destreg__conditionalmod = ($6 & EX_DESC_SFID_MASK); /* SFID */
                       GEN(&$$)->bits3.generic_gen5.end_of_thread = !!($6 & EX_DESC_EOT_MASK);
Signature · 1 line
1.8.3.1
#20 lore raw

PATCH 21/26 mediafill/skl: Start the gen9 media_fill from the gen8 version

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/Makefile.sources  |   1 +
 lib/media_fill.c      |  16 +++
 lib/media_fill.h      |   7 +
 lib/media_fill_gen9.c | 378 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 402 insertions(+)
 create mode 100644 lib/media_fill.c
 create mode 100644 lib/media_fill_gen9.c
lib/Makefile.sources +1 -0
index 82e306d..eee145f 100644
@@ -26,6 +26,7 @@ libintel_tools_la_SOURCES = 	\
 	media_fill_gen7.c       \
 	media_fill_gen8.c       \
 	media_fill_gen8lp.c     \
+	media_fill_gen9.c       \
 	gen7_media.h            \
 	gen8_media.h            \
 	rendercopy_i915.c	\
lib/media_fill.c new file +16 -0
new file mode 100644
index 0000000..1d212b8
@@ -0,0 +1,16 @@
+#include "i830_reg.h"
+#include "media_fill.h"
+
+media_fillfunc_t get_media_fillfunc(int devid)
+{
+	media_fillfunc_t fill = NULL;
+
+	if (IS_GEN8(devid))
+		fill = gen8_media_fillfunc;
+	else if (IS_GEN7(devid))
+		fill = gen7_media_fillfunc;
+	else if (IS_GEN9(devid))
+		fill = gen9_media_fillfunc;
+
+	return fill;
+}
lib/media_fill.h +7 -0
index ca35aeb..226489c 100644
@@ -25,4 +25,11 @@ gen8lp_media_fillfunc(struct intel_batchbuffer *batch,
 		unsigned width, unsigned height,
 		uint8_t color);
 
+void
+gen9_media_fillfunc(struct intel_batchbuffer *batch,
+                struct igt_buf *dst,
+                unsigned x, unsigned y,
+                unsigned width, unsigned height,
+                uint8_t color);
+
 #endif /* RENDE_MEDIA_FILL_H */
lib/media_fill_gen9.c new file +378 -0

378 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#21 lore raw

PATCH 22/26 mediafill/skl: follow the spec to update STATE_BASE_ADDRESS command

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/media_fill_gen9.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
lib/media_fill_gen9.c +8 -3
index 98e2403..a067221 100644
@@ -192,9 +192,9 @@ gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *
 }
 
 static void
-gen8_emit_state_base_address(struct intel_batchbuffer *batch)
+gen9_emit_state_base_address(struct intel_batchbuffer *batch)
 {
-	OUT_BATCH(GEN8_STATE_BASE_ADDRESS | (16 - 2));
+	OUT_BATCH(GEN8_STATE_BASE_ADDRESS | (19 - 2));
 
 	/* general */
 	OUT_BATCH(0 | BASE_ADDRESS_MODIFY);
@@ -228,6 +228,11 @@ gen8_emit_state_base_address(struct intel_batchbuffer *batch)
 	OUT_BATCH(0xfffff000 | 1);
 	/* intruction buffer size, must set modify enable bit, otherwise it may result in GPU hang */
 	OUT_BATCH(1 << 12 | 1);
+
+	/* Bindless surface state base address */
+	OUT_BATCH(0 | BASE_ADDRESS_MODIFY);
+	OUT_BATCH(0);
+	OUT_BATCH(0xfffff000);
 }
 
 static void
@@ -358,7 +363,7 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 	/* media pipeline */
 	batch->ptr = batch->buffer;
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
-	gen8_emit_state_base_address(batch);
+	gen9_emit_state_base_address(batch);
 
 	gen8_emit_vfe_state(batch);
 
Signature · 1 line
1.8.3.1
#22 lore raw

PATCH 23/26 mediafill/skl: Follow the spec to add pipeline_select mask

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/gen8_media.h      | 3 +++
 lib/media_fill_gen9.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
lib/gen8_media.h +3 -0
index 1214cd1..d1df8b9 100644
@@ -371,4 +371,7 @@ struct gen8_surface_state
 	} ss15;
 };
 
+
+#define GEN9_PIPELINE_SELECTION_MASK		(3 << 8)
+
 #endif /* GEN8_MEDIA_H */
lib/media_fill_gen9.c +2 -1
index a067221..df0407d 100644
@@ -362,7 +362,8 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 
 	/* media pipeline */
 	batch->ptr = batch->buffer;
-	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
+	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
+			GEN9_PIPELINE_SELECTION_MASK);
 	gen9_emit_state_base_address(batch);
 
 	gen8_emit_vfe_state(batch);
Signature · 1 line
1.8.3.1
#23 lore raw

PATCH 24/26 mediafill/skl: Follow spec to configure FORCE_MEDIA_AWAKE in PIPELINE_SELECTION

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

The FORCE_MEDIA_AWAKE bit is added for the PIPELINE_SELECTION command and some instructions requires that the media enginee is awake.

---
 lib/gen8_media.h      | 7 +++++++
 lib/media_fill_gen9.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
lib/gen8_media.h +7 -0
index d1df8b9..f654215 100644
@@ -374,4 +374,11 @@ struct gen8_surface_state
 
 #define GEN9_PIPELINE_SELECTION_MASK		(3 << 8)
 
+/*  If enabled, it will force awake media enginee and the following instructions
+ *  will require that the media enginee is awake.
+ */
+#define GEN9_FORCE_MEDIA_AWAKE_DISABLE		(0 << 5)
+#define GEN9_FORCE_MEDIA_AWAKE_ENABLE		(1 << 5)
+#define GEN9_FORCE_MEDIA_AWAKE_MASK		(1 << 13)
+
 #endif /* GEN8_MEDIA_H */
lib/media_fill_gen9.c +8 -1
index df0407d..4ecf268 100644
@@ -363,7 +363,9 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 	/* media pipeline */
 	batch->ptr = batch->buffer;
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
-			GEN9_PIPELINE_SELECTION_MASK);
+			GEN9_FORCE_MEDIA_AWAKE_ENABLE |
+			GEN9_PIPELINE_SELECTION_MASK |
+			GEN9_FORCE_MEDIA_AWAKE_MASK);
 	gen9_emit_state_base_address(batch);
 
 	gen8_emit_vfe_state(batch);
@@ -374,6 +376,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 
 	gen8_emit_media_objects(batch, x, y, width, height);
 
+	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
+			GEN9_FORCE_MEDIA_AWAKE_DISABLE |
+			GEN9_PIPELINE_SELECTION_MASK |
+			GEN9_FORCE_MEDIA_AWAKE_MASK);
+
 	OUT_BATCH(MI_BATCH_BUFFER_END);
 
 	batch_end = batch_align(batch, 8);
Signature · 1 line
1.8.3.1
#24 lore raw

PATCH 25/26 mediafill/skl: Follow spec to configure media sampler DOP clock gating in PIPELINE_SELECTION

In reply to Damien Lespiau

From: Zhao Yakui <[email protected]>

---
 lib/gen8_media.h      | 4 ++++
 lib/media_fill_gen9.c | 4 ++++
 2 files changed, 8 insertions(+)
lib/gen8_media.h +4 -0
index f654215..15cd799 100644
@@ -381,4 +381,8 @@ struct gen8_surface_state
 #define GEN9_FORCE_MEDIA_AWAKE_ENABLE		(1 << 5)
 #define GEN9_FORCE_MEDIA_AWAKE_MASK		(1 << 13)
 
+#define GEN9_SAMPLER_DOP_GATE_DISABLE		(0 << 4)
+#define GEN9_SAMPLER_DOP_GATE_ENABLE		(1 << 4)
+#define GEN9_SAMPLER_DOP_GATE_MASK		(1 << 12)
+
 #endif /* GEN8_MEDIA_H */
lib/media_fill_gen9.c +4 -0
index 4ecf268..6c6ba89 100644
@@ -364,7 +364,9 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 	batch->ptr = batch->buffer;
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
 			GEN9_FORCE_MEDIA_AWAKE_ENABLE |
+			GEN9_SAMPLER_DOP_GATE_DISABLE |
 			GEN9_PIPELINE_SELECTION_MASK |
+			GEN9_SAMPLER_DOP_GATE_MASK |
 			GEN9_FORCE_MEDIA_AWAKE_MASK);
 	gen9_emit_state_base_address(batch);
 
@@ -378,7 +380,9 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
 
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
 			GEN9_FORCE_MEDIA_AWAKE_DISABLE |
+			GEN9_SAMPLER_DOP_GATE_ENABLE |
 			GEN9_PIPELINE_SELECTION_MASK |
+			GEN9_SAMPLER_DOP_GATE_MASK |
 			GEN9_FORCE_MEDIA_AWAKE_MASK);
 
 	OUT_BATCH(MI_BATCH_BUFFER_END);
Signature · 1 line
1.8.3.1
#25 lore raw

PATCH 26/26 lib/skl: Return the render copy and media fill functions

In reply to Damien Lespiau

From: "Xiang, Haihao" <[email protected]>

---
 lib/intel_batchbuffer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
lib/intel_batchbuffer.c +5 -1
index 952b86a..c1b0e3d 100644
@@ -481,6 +481,8 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid)
 		copy = gen7_render_copyfunc;
 	else if (IS_GEN8(devid))
 		copy = gen8_render_copyfunc;
+	else if (IS_GEN9(devid))
+		copy = gen9_render_copyfunc;
 
 	return copy;
 }
@@ -498,7 +500,9 @@ igt_media_fillfunc_t igt_get_media_fillfunc(int devid)
 {
 	igt_media_fillfunc_t fill = NULL;
 
-	if (IS_BROADWELL(devid))
+	if (IS_GEN9(devid))
+		fill = gen9_media_fillfunc;
+	else if (IS_BROADWELL(devid))
 		fill = gen8_media_fillfunc;
 	else if (IS_GEN7(devid))
 		fill = gen7_media_fillfunc;
Signature · 1 line
1.8.3.1