Module: Mesa
Branch: master
Commit: ba9b71e56a43f95946dbb0329f99f2db098005b0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba9b71e56a43f95946dbb0329f99f2db098005b0

Author: Chris Wilson <[email protected]>
Date:   Fri Jul 21 16:36:48 2017 +0100

i965: Ignore reloc read/write domains

Since before the kernel supported I915_EXEC_NO_RELOC, long before our
minimum kernel requirement, the kernel unconditionally invalidated all
GPU TLBs before a batch and flushed all GPU caches after a batch. At
that moment, the only use for read/write domain was for activity
tracking, ensuring that future reads waited for the last writer and
future writes waited for all reads. This only requires a single bit in
the execbuf interface which can be supplied via the NO_RELOC interface,
making the use of relocation domains entirely redundant.

Trimming the excess writes into the array allows the compiler to be much
more frugal:

   text    data     bss     dec     hex filename
8493790  357184  424944 9275918  8d8a0e i965_dri.baseline
8493758  357184  424944 9275886  8d89ee i965_dri.so

(This text improvement really does come from dropping domains, not from
the new use of C99 initializers.)

Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>

---

 src/mesa/drivers/dri/i965/intel_batchbuffer.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c 
b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index dcc6f90238..672a960868 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -811,17 +811,13 @@ brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t 
batch_offset,
       offset64 = target->offset64;
    }
 
-   struct drm_i915_gem_relocation_entry *reloc =
-      &batch->relocs[batch->reloc_count];
-
-   batch->reloc_count++;
-
-   reloc->offset = batch_offset;
-   reloc->delta = target_offset;
-   reloc->target_handle = target->gem_handle;
-   reloc->read_domains = read_domains;
-   reloc->write_domain = write_domain;
-   reloc->presumed_offset = offset64;
+   batch->relocs[batch->reloc_count++] =
+      (struct drm_i915_gem_relocation_entry) {
+         .offset = batch_offset,
+         .delta = target_offset,
+         .target_handle = target->gem_handle,
+         .presumed_offset = offset64,
+      };
 
    /* Using the old buffer offset, write in what the right data would be, in
     * case the buffer doesn't move and we can short-circuit the relocation

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to