i965: Bump aperture tracking to u64
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 7 Sep 2018 13:32:05 +0000 (14:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 10 Sep 2018 08:14:46 +0000 (09:14 +0100)
As a prelude to handling large address spaces, first allow ourselves the
luxury of handling the full 4G.

Reported-by: Andrey Simiklit <asimiklit.work@gmail.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h

index bf2cddebdc6eebbb71123ac7b291dfa04699e43e..7fd15669eb9ef0b22795a7c49f7e47c4c04f721f 100644 (file)
@@ -514,7 +514,7 @@ struct intel_batchbuffer {
    int exec_array_size;
 
    /** The amount of aperture space (in bytes) used by all exec_bos */
-   int aperture_space;
+   uint64_t aperture_space;
 
    struct {
       uint32_t *map_next;
index 65d2c64e3198708fd913e2354ba772dc2a54b59c..4363b1461504cef5d74ad8e09c46b02f9c0cf1ee 100644 (file)
@@ -870,7 +870,7 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw,
               bytes_for_commands, 100.0f * bytes_for_commands / BATCH_SZ,
               bytes_for_state, 100.0f * bytes_for_state / STATE_SZ,
               brw->batch.exec_count,
-              (float) brw->batch.aperture_space / (1024 * 1024),
+              (float) (brw->batch.aperture_space / (1024 * 1024)),
               brw->batch.batch_relocs.reloc_count,
               brw->batch.state_relocs.reloc_count);
 
@@ -890,13 +890,6 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw,
    return ret;
 }
 
-bool
-brw_batch_has_aperture_space(struct brw_context *brw, unsigned extra_space)
-{
-   return brw->batch.aperture_space + extra_space <=
-          brw->screen->aperture_threshold;
-}
-
 bool
 brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo)
 {
index d10948f19165090fce84921c532f045f5a2cea26..0632142cd318decc7faea9b5991f068245380d27 100644 (file)
@@ -44,8 +44,12 @@ int _intel_batchbuffer_flush_fence(struct brw_context *brw,
 void intel_batchbuffer_data(struct brw_context *brw,
                             const void *data, GLuint bytes);
 
-bool brw_batch_has_aperture_space(struct brw_context *brw,
-                                  unsigned extra_space_in_bytes);
+static inline bool
+brw_batch_has_aperture_space(struct brw_context *brw, uint64_t extra_space)
+{
+   return brw->batch.aperture_space + extra_space <=
+          brw->screen->aperture_threshold;
+}
 
 bool brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo);