Mesa (staging/19.1): anv: Set STATE_BASE_ADDRESS upper bounds on gen7

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 18 10:05:52 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: db4850c631a0b0626372832728c3ea1bea164417
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=db4850c631a0b0626372832728c3ea1bea164417

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Mon Jun 17 17:01:48 2019 -0500

anv: Set STATE_BASE_ADDRESS upper bounds on gen7

This should fix floating-point border color on all gen7 HW.  Integer is
still thoroughly busted on gen7 because it doesn't exist on IVB and it's
crazy on HSW.

Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 9672b7044cc329b94a72de9ec5bdda1895901304)

---

 src/intel/vulkan/genX_cmd_buffer.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 6b4db729819..5534b2e39a5 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -108,6 +108,23 @@ genX(cmd_buffer_emit_state_base_address)(struct anv_cmd_buffer *cmd_buffer)
       sba.IndirectObjectBufferSizeModifyEnable  = true;
       sba.InstructionBufferSize                 = 0xfffff;
       sba.InstructionBuffersizeModifyEnable     = true;
+#  else
+      /* On gen7, we have upper bounds instead.  According to the docs,
+       * setting an upper bound of zero means that no bounds checking is
+       * performed so, in theory, we should be able to leave them zero.
+       * However, border color is broken and the GPU bounds-checks anyway.
+       * To avoid this and other potential problems, we may as well set it
+       * for everything.
+       */
+      sba.GeneralStateAccessUpperBound =
+         (struct anv_address) { .bo = NULL, .offset = 0xfffff000 };
+      sba.GeneralStateAccessUpperBoundModifyEnable = true;
+      sba.DynamicStateAccessUpperBound =
+         (struct anv_address) { .bo = NULL, .offset = 0xfffff000 };
+      sba.DynamicStateAccessUpperBoundModifyEnable = true;
+      sba.InstructionAccessUpperBound =
+         (struct anv_address) { .bo = NULL, .offset = 0xfffff000 };
+      sba.InstructionAccessUpperBoundModifyEnable = true;
 #  endif
 #  if (GEN_GEN >= 9)
       if (cmd_buffer->device->instance->physicalDevice.use_softpin) {




More information about the mesa-commit mailing list