[igt-dev] [PATCH i-g-t v2 3/3] lib/gen6_render: Drop duplicated definitions

Lukasz Kalamarz lukasz.kalamarz at intel.com
Wed Jun 20 11:54:36 UTC 2018


Dropping duplicated definitions of registers,fields
and shiftsm, which were implemented in gen4 and
does not changed in gen6.

Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz at intel.com>
Cc: Katarzyna Dec <katarzyna.dec at intel.com>
Cc: Antonio Argenziano <antonio.argenziano at intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/gen6_render.h | 137 +-----------------------------------------------------
 1 file changed, 2 insertions(+), 135 deletions(-)

diff --git a/lib/gen6_render.h b/lib/gen6_render.h
index 6bf468df..f45c8ae7 100644
--- a/lib/gen6_render.h
+++ b/lib/gen6_render.h
@@ -5,26 +5,15 @@
 #include "surfaceformat.h"
 #include "gen4_render.h"
 
-#define GEN6_3D(Pipeline,Opcode,Subopcode) ((3 << 29) | \
-					   ((Pipeline) << 27) | \
-					   ((Opcode) << 24) | \
-					   ((Subopcode) << 16))
-
-#define GEN6_STATE_BASE_ADDRESS			GEN4_3D(0, 1, 1)
-# define BASE_ADDRESS_MODIFY			       (1 << 0)
+/* GEN6_STATE_BASE_ADDRESS */
 # define BUFFER_SIZE_MODIFY			       (1 << 0)
 
-#define GEN6_STATE_SIP				GEN4_3D(0, 1, 2)
-
 #define GEN6_3DSTATE_VF_STATISTICS		GEN4_3D(1, 0, 0xB)
-#define GEN6_PIPELINE_SELECT			GEN4_3D(1, 1, 4)
-# define PIPELINE_SELECT_3D		0
-# define PIPELINE_SELECT_MEDIA		1
 
 #define GEN6_MEDIA_STATE_POINTERS		GEN4_3D(2, 0, 0)
 #define GEN6_MEDIA_OBJECT			GEN4_3D(2, 1, 0)
 
-#define GEN6_3DSTATE_BINDING_TABLE_POINTERS	GEN4_3D(3, 0, 0x01)
+/* GEN6_3DSTATE_BINDING_TABLE_POINTERS */
 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_PS	       (1 << 12)/* for GEN6 */
 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_GS	       (1 << 9) /* for GEN6 */
 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_VS	       (1 << 8) /* for GEN6 */
@@ -42,7 +31,6 @@
 # define GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT		8
 # define GEN6_3DSTATE_URB_GS_SIZE_SHIFT			0
 
-#define GEN6_3DSTATE_VERTEX_BUFFERS		GEN4_3D(3, 0, 0x08)
 #define GEN6_3DSTATE_VERTEX_ELEMENTS		GEN4_3D(3, 0, 0x09)
 #define GEN6_3DSTATE_INDEX_BUFFER		GEN4_3D(3, 0, 0x0A)
 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS	GEN4_3D(3, 0, 0x0D)
@@ -103,13 +91,9 @@
 
 #define GEN6_3DSTATE_SAMPLE_MASK		GEN4_3D(3, 0, 0x18)
 
-#define GEN6_3DSTATE_DRAWING_RECTANGLE		GEN4_3D(3, 1, 0x00)
 #define GEN6_3DSTATE_CONSTANT_COLOR		GEN4_3D(3, 1, 0x01)
 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD	GEN4_3D(3, 1, 0x02)
 #define GEN6_3DSTATE_CHROMA_KEY			GEN4_3D(3, 1, 0x04)
-#define GEN6_3DSTATE_DEPTH_BUFFER		GEN4_3D(3, 1, 0x05)
-# define GEN6_3DSTATE_DEPTH_BUFFER_TYPE_SHIFT		29
-# define GEN6_3DSTATE_DEPTH_BUFFER_FORMAT_SHIFT		18
 
 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET	GEN4_3D(3, 1, 0x06)
 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN	GEN4_3D(3, 1, 0x07)
@@ -126,9 +110,7 @@
 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_4			(2 << 1)
 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_8			(3 << 1)
 
-#define GEN6_3DSTATE_CLEAR_PARAMS		GEN4_3D(3, 1, 0x10)
 /* DW1 */
-# define GEN6_3DSTATE_DEPTH_CLEAR_VALID		       (1 << 15)
 # define GEN6_PIPE_CONTROL_NOWRITE		       (0 << 14)
 # define GEN6_PIPE_CONTROL_WRITE_QWORD		       (1 << 14)
 # define GEN6_PIPE_CONTROL_WRITE_DEPTH		       (2 << 14)
@@ -145,29 +127,15 @@
 #define GEN6_3DSTATE_MONOFILTER_SIZE		GEN4_3D(3, 1, 0x11)
 #define GEN6_PIPE_CONTROL			GEN4_3D(3, 2, 0)
 
-#define GEN6_3DPRIMITIVE			GEN4_3D(3, 3, 0)
-# define GEN6_3DPRIMITIVE_VERTEX_SEQUENTIAL	       (0 << 15)
-# define GEN6_3DPRIMITIVE_VERTEX_RANDOM		       (1 << 15)
-/* Primitive types are in gen6_defines.h */
-# define GEN6_3DPRIMITIVE_TOPOLOGY_SHIFT		10
-
 /* VERTEX_BUFFER_STATE Structure */
 #define GEN6_VB0_BUFFER_INDEX_SHIFT	 26
 #define GEN6_VB0_VERTEXDATA		(0 << 20)
 #define GEN6_VB0_INSTANCEDATA	(1 << 20)
-#define VB0_BUFFER_PITCH_SHIFT	 0
 #define VB0_NULL_VERTEX_BUFFER	(1 << 13)
 
 /* VERTEX_ELEMENT_STATE Structure */
 #define GEN6_VE0_VERTEX_BUFFER_INDEX_SHIFT	 26 /* for GEN6 */
 #define GEN6_VE0_VALID				(1 << 25) /* for GEN6 */
-#define VE0_FORMAT_SHIFT			 16
-#define VE0_OFFSET_SHIFT			 0
-#define VE1_VFCOMPONENT_0_SHIFT			 28
-#define VE1_VFCOMPONENT_1_SHIFT			 24
-#define VE1_VFCOMPONENT_2_SHIFT			 20
-#define VE1_VFCOMPONENT_3_SHIFT			 16
-#define VE1_DESTINATION_ELEMENT_OFFSET_SHIFT	 0
 
 #define GEN6_SVG_CTL		0x7400
 # define GEN6_SVG_CTL_GS_BA	(0 << 8)
@@ -302,26 +270,6 @@
 #define GEN6_EU_ATT_CLR_1	0x8834
 #define GEN6_EU_RDATA		0x8840
 
-/* for GEN6+ */
-#define UF0_CS_REALLOC		(1 << 13)
-#define UF0_VFE_REALLOC		(1 << 12)
-#define UF0_SF_REALLOC		(1 << 11)
-#define UF0_CLIP_REALLOC	(1 << 10)
-#define UF0_GS_REALLOC		(1 << 9)
-#define UF0_VS_REALLOC		(1 << 8)
-#define UF1_CLIP_FENCE_SHIFT	 20
-#define UF1_GS_FENCE_SHIFT	 10
-#define UF1_VS_FENCE_SHIFT	 0
-#define UF2_CS_FENCE_SHIFT	 20
-#define UF2_VFE_FENCE_SHIFT	 10
-#define UF2_SF_FENCE_SHIFT	 0
-
-/* for GEN6_3DSTATE_PIPELINED_POINTERS */
-#define GEN6_GS_DISABLE		0
-#define GEN6_GS_ENABLE		1
-#define GEN6_CLIP_DISABLE	0
-#define GEN6_CLIP_ENABLE	1
-
 /* 3D state */
 #define _3DOP_3DSTATE_PIPELINED			0x0
 #define _3DOP_3DSTATE_NONPIPELINED		0x1
@@ -346,28 +294,6 @@
 #define _3DCONTROL				0x00
 #define _3DPRIMITIVE				0x00
 
-#define _3DPRIM_POINTLIST		0x01
-#define _3DPRIM_LINELIST		0x02
-#define _3DPRIM_LINESTRIP		0x03
-#define _3DPRIM_TRILIST			0x04
-#define _3DPRIM_TRISTRIP		0x05
-#define _3DPRIM_TRIFAN			0x06
-#define _3DPRIM_QUADLIST		0x07
-#define _3DPRIM_QUADSTRIP		0x08
-#define _3DPRIM_LINELIST_ADJ		0x09
-#define _3DPRIM_LINESTRIP_ADJ		0x0A
-#define _3DPRIM_TRILIST_ADJ		0x0B
-#define _3DPRIM_TRISTRIP_ADJ		0x0C
-#define _3DPRIM_TRISTRIP_REVERSE	0x0D
-#define _3DPRIM_POLYGON			0x0E
-#define _3DPRIM_RECTLIST		0x0F
-#define _3DPRIM_LINELOOP		0x10
-#define _3DPRIM_POINTLIST_BF		0x11
-#define _3DPRIM_LINESTRIP_CONT		0x12
-#define _3DPRIM_LINESTRIP_BF		0x13
-#define _3DPRIM_LINESTRIP_CONT_BF	0x14
-#define _3DPRIM_TRIFAN_NOSTIPPLE	0x15
-
 #define _3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL	0
 #define _3DPRIM_VERTEXBUFFER_ACCESS_RANDOM	1
 
@@ -438,19 +364,9 @@
 #define GEN6_COVERAGE_PIXELS_2		2
 #define GEN6_COVERAGE_PIXELS_4		3
 
-#define GEN6_CULLMODE_BOTH	0
-#define GEN6_CULLMODE_NONE	1
-#define GEN6_CULLMODE_FRONT	2
-#define GEN6_CULLMODE_BACK	3
-
 #define GEN6_DEFAULTCOLOR_R8G8B8A8_UNORM	0
 #define GEN6_DEFAULTCOLOR_R32G32B32A32_FLOAT	1
 
-#define GEN6_DEPTHFORMAT_D32_FLOAT_S8X24_UINT	0
-#define GEN6_DEPTHFORMAT_D32_FLOAT		1
-#define GEN6_DEPTHFORMAT_D24_UNORM_S8_UINT	2
-#define GEN6_DEPTHFORMAT_D16_UNORM		5
-
 #define GEN6_FLOATING_POINT_IEEE_754		0
 #define GEN6_FLOATING_POINT_NON_IEEE_754	1
 
@@ -478,26 +394,9 @@
 #define GEN6_LOGICOPFUNCTION_OR			14
 #define GEN6_LOGICOPFUNCTION_SET		15
 
-#define GEN6_MAPFILTER_NEAREST	0x0
-#define GEN6_MAPFILTER_LINEAR		0x1
-#define GEN6_MAPFILTER_ANISOTROPIC	0x2
-
-#define GEN6_MIPFILTER_NONE	0
-#define GEN6_MIPFILTER_NEAREST	1
-#define GEN6_MIPFILTER_LINEAR	3
-
 #define GEN6_POLYGON_FRONT_FACING	0
 #define GEN6_POLYGON_BACK_FACING	1
 
-#define GEN6_PREFILTER_ALWAYS	0x0
-#define GEN6_PREFILTER_NEVER	0x1
-#define GEN6_PREFILTER_LESS	0x2
-#define GEN6_PREFILTER_EQUAL	0x3
-#define GEN6_PREFILTER_LEQUAL	0x4
-#define GEN6_PREFILTER_GREATER	0x5
-#define GEN6_PREFILTER_NOTEQUAL	0x6
-#define GEN6_PREFILTER_GEQUAL	0x7
-
 #define GEN6_PROVOKING_VERTEX_0		0
 #define GEN6_PROVOKING_VERTEX_1		1
 #define GEN6_PROVOKING_VERTEX_2		2
@@ -518,16 +417,6 @@
 #define GEN6_STENCILOP_DECR	6
 #define GEN6_STENCILOP_INVERT	7
 
-#define GEN6_BORDER_COLOR_MODE_DEFAULT	0
-#define GEN6_BORDER_COLOR_MODE_LEGACY	1
-
-#define GEN6_TEXCOORDMODE_WRAP		0
-#define GEN6_TEXCOORDMODE_MIRROR	1
-#define GEN6_TEXCOORDMODE_CLAMP		2
-#define GEN6_TEXCOORDMODE_CUBE		3
-#define GEN6_TEXCOORDMODE_CLAMP_BORDER	4
-#define GEN6_TEXCOORDMODE_MIRROR_ONCE	5
-
 #define GEN6_THREAD_PRIORITY_NORMAL	0
 #define GEN6_THREAD_PRIORITY_HIGH	1
 
@@ -540,15 +429,6 @@
 #define GEN6_VERTEXBUFFER_ACCESS_VERTEXDATA	0
 #define GEN6_VERTEXBUFFER_ACCESS_INSTANCEDATA	1
 
-#define GEN6_VFCOMPONENT_NOSTORE	0
-#define GEN6_VFCOMPONENT_STORE_SRC	1
-#define GEN6_VFCOMPONENT_STORE_0	2
-#define GEN6_VFCOMPONENT_STORE_1_FLT	3
-#define GEN6_VFCOMPONENT_STORE_1_INT	4
-#define GEN6_VFCOMPONENT_STORE_VID	5
-#define GEN6_VFCOMPONENT_STORE_IID	6
-#define GEN6_VFCOMPONENT_STORE_PID	7
-
 /* Execution Unit (EU) defines */
 
 #define GEN6_ALIGN_1	0
@@ -867,14 +747,6 @@
  * The legacy mode matches the semantics specified by the Render
  * extension.
  */
-struct gen6_sampler_default_border_color {
-   float color[4];
-};
-
-struct gen6_sampler_legacy_border_color {
-   uint8_t color[4];
-};
-
 struct gen6_sampler_state {
    struct {
       uint32_t shadow_function:3;
@@ -1068,9 +940,4 @@ struct gen6_surface_state {
 	} ss5;
 };
 
-struct gen6_cc_viewport {
-	float min_depth;
-	float max_depth;
-};
-
 #endif
-- 
2.14.3



More information about the igt-dev mailing list