i965: Move gen8_disable_stages to brw_upload_initial_gpu_state
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 30 Sep 2016 23:28:53 +0000 (16:28 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 31 Oct 2016 20:20:05 +0000 (13:20 -0700)
3DSTATE_WM_CHROMAKEY isn't programmed anywhere else.
3DSTATE_WM_HZ_OP is programmed, then cleared by blorp during a
HZ op, so repeatedly clearing it after every blorp execution is
redundant.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/gen8_disable.c [deleted file]

index 491735815454738159b6a0a985acae3a0ce73233..30648e313fd9adb14bf71a39a02f9bff54f82447 100644 (file)
@@ -201,7 +201,6 @@ i965_FILES = \
        gen7_wm_surface_state.c \
        gen8_blend_state.c \
        gen8_depth_state.c \
-       gen8_disable.c \
        gen8_draw_upload.c \
        gen8_ds_state.c \
        gen8_gs_state.c \
index 75e497f7b2ce297f807388b264de5b0d3aff22cc..841c3dee5a5aa24d86745eb43408d50051cf0ba9 100644 (file)
@@ -149,7 +149,6 @@ extern const struct brw_tracked_state gen7_wm_state;
 extern const struct brw_tracked_state gen7_hw_binding_tables;
 extern const struct brw_tracked_state haswell_cut_index;
 extern const struct brw_tracked_state gen8_blend_state;
-extern const struct brw_tracked_state gen8_disable_stages;
 extern const struct brw_tracked_state gen8_ds_state;
 extern const struct brw_tracked_state gen8_gs_state;
 extern const struct brw_tracked_state gen8_hs_state;
index 2461ee5800c1fda351e5cee22065d8b8d6871971..b689ae41f675af515dc108f4d51ffc0b3c9566a0 100644 (file)
@@ -332,7 +332,6 @@ static const struct brw_tracked_state *gen8_render_atoms[] =
    &brw_gs_samplers,
    &gen8_multisample_state,
 
-   &gen8_disable_stages,
    &gen8_vs_state,
    &gen8_hs_state,
    &gen7_te_state,
@@ -411,6 +410,19 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
 
    if (brw->gen >= 8) {
       gen8_emit_3dstate_sample_pattern(brw);
+
+      BEGIN_BATCH(5);
+      OUT_BATCH(_3DSTATE_WM_HZ_OP << 16 | (5 - 2));
+      OUT_BATCH(0);
+      OUT_BATCH(0);
+      OUT_BATCH(0);
+      OUT_BATCH(0);
+      ADVANCE_BATCH();
+
+      BEGIN_BATCH(2);
+      OUT_BATCH(_3DSTATE_WM_CHROMAKEY << 16 | (2 - 2));
+      OUT_BATCH(0);
+      ADVANCE_BATCH();
    }
 }
 
diff --git a/src/mesa/drivers/dri/i965/gen8_disable.c b/src/mesa/drivers/dri/i965/gen8_disable.c
deleted file mode 100644 (file)
index b7598a3..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "brw_context.h"
-#include "brw_state.h"
-#include "brw_defines.h"
-#include "intel_batchbuffer.h"
-
-static void
-disable_stages(struct brw_context *brw)
-{
-   BEGIN_BATCH(5);
-   OUT_BATCH(_3DSTATE_WM_HZ_OP << 16 | (5 - 2));
-   OUT_BATCH(0);
-   OUT_BATCH(0);
-   OUT_BATCH(0);
-   OUT_BATCH(0);
-   ADVANCE_BATCH();
-
-   BEGIN_BATCH(2);
-   OUT_BATCH(_3DSTATE_WM_CHROMAKEY << 16 | (2 - 2));
-   OUT_BATCH(0);
-   ADVANCE_BATCH();
-}
-
-const struct brw_tracked_state gen8_disable_stages = {
-   .dirty = {
-      .mesa  = 0,
-      .brw   = BRW_NEW_BLORP |
-               BRW_NEW_CONTEXT,
-   },
-   .emit = disable_stages,
-};