* [PATCH libdrm] intel: silence valgrind warnings for unsynchronized maps
@ 2013-07-10 2:49 Chia-I Wu
2013-07-16 13:24 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Chia-I Wu @ 2013-07-10 2:49 UTC (permalink / raw)
To: intel-gfx
Mark the address ranges as accessible with VALGRIND_MAKE_MEM_DEFINED.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
---
intel/intel_bufmgr_gem.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index a51e3f3..f98f7a7 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1322,6 +1322,7 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
+ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
int ret;
/* If the CPU cache isn't coherent with the GTT, then use a
@@ -1335,7 +1336,13 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo)
return drm_intel_gem_bo_map_gtt(bo);
pthread_mutex_lock(&bufmgr_gem->lock);
+
ret = map_gtt(bo);
+ if (ret == 0) {
+ drm_intel_gem_bo_mark_mmaps_incoherent(bo);
+ VG(VALGRIND_MAKE_MEM_DEFINED(bo_gem->gtt_virtual, bo->size));
+ }
+
pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH libdrm] intel: silence valgrind warnings for unsynchronized maps
2013-07-10 2:49 [PATCH libdrm] intel: silence valgrind warnings for unsynchronized maps Chia-I Wu
@ 2013-07-16 13:24 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2013-07-16 13:24 UTC (permalink / raw)
To: Chia-I Wu; +Cc: intel-gfx
On Wed, Jul 10, 2013 at 10:49:59AM +0800, Chia-I Wu wrote:
> Mark the address ranges as accessible with VALGRIND_MAKE_MEM_DEFINED.
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
lgtm. Applied to mater, thanks for the patch.
-Daniel
> ---
> intel/intel_bufmgr_gem.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index a51e3f3..f98f7a7 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -1322,6 +1322,7 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
> int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo)
> {
> drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
> + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
> int ret;
>
> /* If the CPU cache isn't coherent with the GTT, then use a
> @@ -1335,7 +1336,13 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo)
> return drm_intel_gem_bo_map_gtt(bo);
>
> pthread_mutex_lock(&bufmgr_gem->lock);
> +
> ret = map_gtt(bo);
> + if (ret == 0) {
> + drm_intel_gem_bo_mark_mmaps_incoherent(bo);
> + VG(VALGRIND_MAKE_MEM_DEFINED(bo_gem->gtt_virtual, bo->size));
> + }
> +
> pthread_mutex_unlock(&bufmgr_gem->lock);
>
> return ret;
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-16 13:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 2:49 [PATCH libdrm] intel: silence valgrind warnings for unsynchronized maps Chia-I Wu
2013-07-16 13:24 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox