[Mesa-dev] [PATCH 1/2] i965: Plumb brw through to intel_batchbuffer_reset().

Kenneth Graunke kenneth at whitecape.org
Sat Sep 16 08:31:26 UTC 2017


We'll want to pass this to brw_bo_map in a moment.
---
 src/mesa/drivers/dri/i965/brw_context.c       |  2 +-
 src/mesa/drivers/dri/i965/intel_batchbuffer.c | 17 +++++++++--------
 src/mesa/drivers/dri/i965/intel_batchbuffer.h |  3 +--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index f67c30f3aa4..ee1badd94b3 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -934,7 +934,7 @@ brwCreateContext(gl_api api,
 
    intel_fbo_init(brw);
 
-   intel_batchbuffer_init(screen, &brw->batch);
+   intel_batchbuffer_init(brw);
 
    if (devinfo->gen >= 6) {
       /* Create a new hardware context.  Using a hardware context means that
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index da4a4d5f250..ae9351499aa 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -62,8 +62,7 @@
 #define MAX_STATE_SIZE (64 * 1024)
 
 static void
-intel_batchbuffer_reset(struct intel_batchbuffer *batch,
-                        struct intel_screen *screen);
+intel_batchbuffer_reset(struct brw_context *brw);
 
 static bool
 uint_key_compare(const void *a, const void *b)
@@ -87,9 +86,10 @@ init_reloc_list(struct brw_reloc_list *rlist, int count)
 }
 
 void
-intel_batchbuffer_init(struct intel_screen *screen,
-                       struct intel_batchbuffer *batch)
+intel_batchbuffer_init(struct brw_context *brw)
 {
+   struct intel_screen *screen = brw->screen;
+   struct intel_batchbuffer *batch = &brw->batch;
    const struct gen_device_info *devinfo = &screen->devinfo;
 
    if (!devinfo->has_llc) {
@@ -123,7 +123,7 @@ intel_batchbuffer_init(struct intel_screen *screen,
    if (devinfo->gen == 6)
       batch->valid_reloc_flags |= EXEC_OBJECT_NEEDS_GTT;
 
-   intel_batchbuffer_reset(batch, screen);
+   intel_batchbuffer_reset(brw);
 }
 
 #define READ_ONCE(x) (*(volatile __typeof__(x) *)&(x))
@@ -170,9 +170,10 @@ add_exec_bo(struct intel_batchbuffer *batch, struct brw_bo *bo)
 }
 
 static void
-intel_batchbuffer_reset(struct intel_batchbuffer *batch,
-                        struct intel_screen *screen)
+intel_batchbuffer_reset(struct brw_context *brw)
 {
+   struct intel_screen *screen = brw->screen;
+   struct intel_batchbuffer *batch = &brw->batch;
    struct brw_bufmgr *bufmgr = screen->bufmgr;
 
    if (batch->last_bo != NULL) {
@@ -218,7 +219,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch,
 static void
 intel_batchbuffer_reset_and_clear_render_cache(struct brw_context *brw)
 {
-   intel_batchbuffer_reset(&brw->batch, brw->screen);
+   intel_batchbuffer_reset(brw);
    brw_render_cache_set_clear(brw);
 }
 
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
index c02cafed521..5a2649f06f3 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
@@ -12,8 +12,7 @@ extern "C" {
 
 struct intel_batchbuffer;
 
-void intel_batchbuffer_init(struct intel_screen *screen,
-                            struct intel_batchbuffer *batch);
+void intel_batchbuffer_init(struct brw_context *brw);
 void intel_batchbuffer_free(struct intel_batchbuffer *batch);
 void intel_batchbuffer_save_state(struct brw_context *brw);
 void intel_batchbuffer_reset_to_saved(struct brw_context *brw);
-- 
2.14.1



More information about the mesa-dev mailing list