ilo: fix some state pointer commands on Gen8
authorChia-I Wu <olvaffe@gmail.com>
Sun, 15 Feb 2015 05:21:51 +0000 (13:21 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 15 Feb 2015 05:32:41 +0000 (13:32 +0800)
3DSTATE_CC_STATE_POINTERS seems to be ignored when bit 0 of DW1 is not set.
Follow i965 and set the bit for 3DSTATE_CC_STATE_POINTERS and
3DSTATE_BLEND_STATE_POINTERS.  Add gen checks for all state pointer commands.

src/gallium/drivers/ilo/ilo_builder_3d_bottom.h

index 20b23daf95c0ea9f65b604799ce2c14a5a73edd7..9b61e6521ed15365215d3757025685d1d7a17350 100644 (file)
@@ -841,6 +841,8 @@ static inline void
 gen7_3DSTATE_BINDING_TABLE_POINTERS_PS(struct ilo_builder *builder,
                                        uint32_t binding_table)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_PS,
          binding_table);
@@ -850,6 +852,8 @@ static inline void
 gen7_3DSTATE_SAMPLER_STATE_POINTERS_PS(struct ilo_builder *builder,
                                        uint32_t sampler_state)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_PS,
          sampler_state);
@@ -1362,6 +1366,8 @@ static inline void
 gen7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP(struct ilo_builder *builder,
                                              uint32_t sf_clip_viewport)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP,
          sf_clip_viewport);
@@ -1371,6 +1377,8 @@ static inline void
 gen7_3DSTATE_VIEWPORT_STATE_POINTERS_CC(struct ilo_builder *builder,
                                         uint32_t cc_viewport)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_VIEWPORT_STATE_POINTERS_CC,
          cc_viewport);
@@ -1380,6 +1388,11 @@ static inline void
 gen7_3DSTATE_CC_STATE_POINTERS(struct ilo_builder *builder,
                                uint32_t color_calc_state)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
+   if (ilo_dev_gen(builder->dev) >= ILO_GEN(8))
+      color_calc_state |= 1;
+
    gen7_3dstate_pointer(builder,
          GEN6_RENDER_OPCODE_3DSTATE_CC_STATE_POINTERS, color_calc_state);
 }
@@ -1388,6 +1401,8 @@ static inline void
 gen7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS(struct ilo_builder *builder,
                                           uint32_t depth_stencil_state)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_DEPTH_STENCIL_STATE_POINTERS,
          depth_stencil_state);
@@ -1397,6 +1412,11 @@ static inline void
 gen7_3DSTATE_BLEND_STATE_POINTERS(struct ilo_builder *builder,
                                   uint32_t blend_state)
 {
+   ILO_DEV_ASSERT(builder->dev, 7, 8);
+
+   if (ilo_dev_gen(builder->dev) >= ILO_GEN(8))
+      blend_state |= 1;
+
    gen7_3dstate_pointer(builder,
          GEN7_RENDER_OPCODE_3DSTATE_BLEND_STATE_POINTERS,
          blend_state);