summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-09-07 23:43:46 -0700
committerKenneth Graunke <[email protected]>2017-09-14 16:17:36 -0700
commit0bf3fa4c538bd6ae954c3323aac3724b0fdbf96c (patch)
tree1e5f28077efaa7e82b04bc6b053ee51c013e4920 /src/mesa
parent2e68c4e4547292d3e5b743bb6e28912b1d9d62ae (diff)
i965: Pass screen to intel_batchbuffer_reset().
This will let us access screen->kernel_features in the next patch. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chris Wilson <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index d9b157b324c..8080e77b251 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -44,8 +44,7 @@
static void
intel_batchbuffer_reset(struct intel_batchbuffer *batch,
- struct brw_bufmgr *bufmgr,
- bool has_llc);
+ struct intel_screen *screen);
static bool
uint_key_compare(const void *a, const void *b)
@@ -72,7 +71,6 @@ void
intel_batchbuffer_init(struct intel_screen *screen,
struct intel_batchbuffer *batch)
{
- struct brw_bufmgr *bufmgr = screen->bufmgr;
const struct gen_device_info *devinfo = &screen->devinfo;
if (!devinfo->has_llc) {
@@ -103,7 +101,7 @@ intel_batchbuffer_init(struct intel_screen *screen,
if (devinfo->gen == 6)
batch->valid_reloc_flags |= EXEC_OBJECT_NEEDS_GTT;
- intel_batchbuffer_reset(batch, bufmgr, devinfo->has_llc);
+ intel_batchbuffer_reset(batch, screen);
}
#define READ_ONCE(x) (*(volatile __typeof__(x) *)&(x))
@@ -151,9 +149,11 @@ add_exec_bo(struct intel_batchbuffer *batch, struct brw_bo *bo)
static void
intel_batchbuffer_reset(struct intel_batchbuffer *batch,
- struct brw_bufmgr *bufmgr,
- bool has_llc)
+ struct intel_screen *screen)
{
+ struct brw_bufmgr *bufmgr = screen->bufmgr;
+ const struct gen_device_info *devinfo = &screen->devinfo;
+
if (batch->last_bo != NULL) {
brw_bo_unreference(batch->last_bo);
batch->last_bo = NULL;
@@ -161,7 +161,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch,
batch->last_bo = batch->bo;
batch->bo = brw_bo_alloc(bufmgr, "batchbuffer", BATCH_SZ, 4096);
- if (has_llc) {
+ if (devinfo->has_llc) {
batch->map = brw_bo_map(NULL, batch->bo, MAP_READ | MAP_WRITE);
}
batch->map_next = batch->map;
@@ -186,9 +186,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch,
static void
intel_batchbuffer_reset_and_clear_render_cache(struct brw_context *brw)
{
- const struct gen_device_info *devinfo = &brw->screen->devinfo;
-
- intel_batchbuffer_reset(&brw->batch, brw->bufmgr, devinfo->has_llc);
+ intel_batchbuffer_reset(&brw->batch, brw->screen);
brw_render_cache_set_clear(brw);
}