Mesa (master): intel: tools: aubwrite: reuse canonical address helper
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Aug 4 08:47:32 UTC 2018
Module: Mesa
Branch: master
Commit: 7471286bb092be24e4ad2555f9355075dfefe8b6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7471286bb092be24e4ad2555f9355075dfefe8b6
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Tue Jul 31 10:48:37 2018 +0100
intel: tools: aubwrite: reuse canonical address helper
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/intel/tools/aub_write.h | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/src/intel/tools/aub_write.h b/src/intel/tools/aub_write.h
index 2e42e3d400..b421679b9e 100644
--- a/src/intel/tools/aub_write.h
+++ b/src/intel/tools/aub_write.h
@@ -29,6 +29,7 @@
#include <stdio.h>
#include "dev/gen_device_info.h"
+#include "common/gen_gem.h"
struct aub_ppgtt_table {
uint64_t phys_addr;
@@ -63,23 +64,7 @@ static inline void
aub_write_reloc(const struct gen_device_info *devinfo, void *p, uint64_t v)
{
if (devinfo->gen >= 8) {
- /* From the Broadwell PRM Vol. 2a,
- * MI_LOAD_REGISTER_MEM::MemoryAddress:
- *
- * "This field specifies the address of the memory
- * location where the register value specified in the
- * DWord above will read from. The address specifies
- * the DWord location of the data. Range =
- * GraphicsVirtualAddress[63:2] for a DWord register
- * GraphicsAddress [63:48] are ignored by the HW and
- * assumed to be in correct canonical form [63:48] ==
- * [47]."
- *
- * In practice, this will always mean the top bits are zero
- * because of the GTT size limitation of the aubdump tool.
- */
- const int shift = 63 - 47;
- *(uint64_t *)p = (((int64_t)v) << shift) >> shift;
+ *(uint64_t *)p = gen_canonical_address(v);
} else {
*(uint32_t *)p = v;
}
More information about the mesa-commit
mailing list