aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-06-05 14:19:28 -0700
committerJason Ekstrand <[email protected]>2017-06-07 08:54:54 -0700
commit9cb6ac62fbab86ed914152b40cb1f8f4ee7fdaff (patch)
tree304896635d8f2862195ff1d1827d43a561bb9470
parented5801864ede0a04fb5fa80bf9ffea40e5c0e022 (diff)
intel/blorp: Plumb through access to the workaround BO
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101283 Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/intel/blorp/blorp_genX_exec.h9
-rw-r--r--src/intel/vulkan/genX_blorp_exec.c12
-rw-r--r--src/mesa/drivers/dri/i965/genX_blorp_exec.c13
3 files changed, 32 insertions, 2 deletions
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
index 2276d7c06bb..7c8a9416c58 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -27,6 +27,7 @@
#include "blorp_priv.h"
#include "common/gen_device_info.h"
#include "common/gen_sample_positions.h"
+#include "genxml/gen_macros.h"
/**
* This file provides the blorp pipeline setup and execution functionality.
@@ -59,6 +60,11 @@ static void *
blorp_alloc_vertex_buffer(struct blorp_batch *batch, uint32_t size,
struct blorp_address *addr);
+#if GEN_GEN >= 8
+static struct blorp_address
+blorp_get_workaround_page(struct blorp_batch *batch);
+#endif
+
static void
blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries,
unsigned state_size, unsigned state_alignment,
@@ -82,8 +88,6 @@ blorp_emit_pipeline(struct blorp_batch *batch,
/***** BEGIN blorp_exec implementation ******/
-#include "genxml/gen_macros.h"
-
static uint64_t
_blorp_combine_address(struct blorp_batch *batch, void *location,
struct blorp_address address, uint32_t delta)
@@ -1497,6 +1501,7 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
*/
blorp_emit(batch, GENX(PIPE_CONTROL), pc) {
pc.PostSyncOperation = WriteImmediateData;
+ pc.Address = blorp_get_workaround_page(batch);
}
blorp_emit(batch, GENX(3DSTATE_WM_HZ_OP), hzp);
diff --git a/src/intel/vulkan/genX_blorp_exec.c b/src/intel/vulkan/genX_blorp_exec.c
index eb338991456..04c5499a08c 100644
--- a/src/intel/vulkan/genX_blorp_exec.c
+++ b/src/intel/vulkan/genX_blorp_exec.c
@@ -139,6 +139,18 @@ blorp_alloc_vertex_buffer(struct blorp_batch *batch, uint32_t size,
return vb_state.map;
}
+#if GEN_GEN >= 8
+static struct blorp_address
+blorp_get_workaround_page(struct blorp_batch *batch)
+{
+ struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
+
+ return (struct blorp_address) {
+ .buffer = &cmd_buffer->device->workaround_bo,
+ };
+}
+#endif
+
static void
blorp_flush_range(struct blorp_batch *batch, void *start, size_t size)
{
diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
index 3451d7187eb..dc0cd7e466c 100644
--- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
+++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
@@ -150,6 +150,19 @@ blorp_alloc_vertex_buffer(struct blorp_batch *batch, uint32_t size,
return data;
}
+#if GEN_GEN >= 8
+static struct blorp_address
+blorp_get_workaround_page(struct blorp_batch *batch)
+{
+ assert(batch->blorp->driver_ctx == batch->driver_batch);
+ struct brw_context *brw = batch->driver_batch;
+
+ return (struct blorp_address) {
+ .buffer = brw->workaround_bo,
+ };
+}
+#endif
+
static void
blorp_flush_range(struct blorp_batch *batch, void *start, size_t size)
{