Mesa (18.2): intel: aubinator: fix read the context/ring

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 9 00:30:42 UTC 2018


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

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Tue Jul 31 07:12:56 2018 +0100

intel: aubinator: fix read the context/ring

Up to now we've been lucky that the buffer returned was always exactly
at the address we requested.

Fixes: 144b40db5411 ("intel: aubinator: drop the 1Tb GTT mapping")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>
(cherry picked from commit 35955afa7aa49906fad772b44d3e6357203430ae)

---

 src/intel/tools/aubinator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 8989d558b6..3fec04c24c 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -590,7 +590,7 @@ handle_memtrace_reg_write(uint32_t *p)
    uint32_t pphwsp_addr = context_descriptor & 0xfffff000;
    struct gen_batch_decode_bo pphwsp_bo = get_ggtt_batch_bo(NULL, pphwsp_addr);
    uint32_t *context = (uint32_t *)((uint8_t *)pphwsp_bo.map +
-                                    (pphwsp_bo.addr - pphwsp_addr) +
+                                    (pphwsp_addr - pphwsp_bo.addr) +
                                     pphwsp_size);
 
    uint32_t ring_buffer_head = context[5];
@@ -601,7 +601,7 @@ handle_memtrace_reg_write(uint32_t *p)
    struct gen_batch_decode_bo ring_bo = get_ggtt_batch_bo(NULL,
                                                           ring_buffer_start);
    assert(ring_bo.size > 0);
-   void *commands = (uint8_t *)ring_bo.map + (ring_bo.addr - ring_buffer_start);
+   void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - ring_bo.addr);
 
    if (context_descriptor & 0x100 /* ppgtt */) {
       batch_ctx.get_bo = get_ppgtt_batch_bo;




More information about the mesa-commit mailing list