Mesa (10.3): i965: Fix register write checks.

Emil Velikov evelikov at kemper.freedesktop.org
Mon Oct 13 01:03:16 UTC 2014


Module: Mesa
Branch: 10.3
Commit: 13a4fd24305eb692492714a6706e311fcc3c0629
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=13a4fd24305eb692492714a6706e311fcc3c0629

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Sep 29 17:00:51 2014 -0700

i965: Fix register write checks.

When mapping the buffer a second time, we need to use the new pointer,
not the one from the previous mapping.  Otherwise, we will most likely
crash.

Apparently, we've just been getting lucky and getting the same
bo->virtual pointer in both cases.  libdrm probably has a hand in that.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Cc: mesa-stable at lists.freedesktop.org
(cherry picked from commit 94841b6d5dac6dcb445a30f083ec6e9858ad2f7d)

---

 src/mesa/drivers/dri/i965/intel_extensions.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index 046d2a1..f3aa37f 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -87,6 +87,7 @@ can_do_pipelined_register_writes(struct brw_context *brw)
 
    /* Check whether the value got written. */
    drm_intel_bo_map(brw->batch.workaround_bo, false);
+   data = brw->batch.workaround_bo->virtual;
    bool success = data[offset] == expected_value;
    drm_intel_bo_unmap(brw->batch.workaround_bo);
 
@@ -145,6 +146,7 @@ can_write_oacontrol(struct brw_context *brw)
 
    /* Check whether the value got written. */
    drm_intel_bo_map(brw->batch.workaround_bo, false);
+   data = brw->batch.workaround_bo->virtual;
    bool success = data[offset] == expected_value;
    drm_intel_bo_unmap(brw->batch.workaround_bo);
 




More information about the mesa-commit mailing list