From patchwork Wed Jul 10 02:49:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 2825512 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF8979F756 for ; Wed, 10 Jul 2013 02:51:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C40E20119 for ; Wed, 10 Jul 2013 02:51:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 215E3200F0 for ; Wed, 10 Jul 2013 02:51:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1657E6317 for ; Tue, 9 Jul 2013 19:51:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E62CE5BFA for ; Tue, 9 Jul 2013 19:50:59 -0700 (PDT) Received: by mail-ob0-f177.google.com with SMTP id ta17so7787572obb.22 for ; Tue, 09 Jul 2013 19:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=R4Z6jKhsp4LeDWsVq/b5FeLnVuujgJ5lCYuNHSxgyDs=; b=xYofNgUQaC++aqnRNjXaC0ydzdl/7ttZJozAmtpKwZkEQPs3HsEQiEbj43XJtbhgi5 8W155YIHagPJ8PGHF7XU8AYlCbujFuAiD0syAlmdUb6hg6eAkZkh6/j1RdIUj7TzoUwn eq/x87bG6bFC1zJUvvVw0NQSZi4zfjfEHkwOT0fe6MmnMP3QzE5rGrbPucCntA7tRuqK DY21aoYsJ0bCBT4biEYeV6wzC+SxOeo+FPoCEK1Q6apoPdJYzCnLG02Mf7xs369uAB8X PLV3uPyOVurW9NK7B2XlgJVWqIk/FCCvEBxamx3v0VL1dzY64opsRCefkebmgHiF/VtL u/vg== X-Received: by 10.60.160.194 with SMTP id xm2mr26821465oeb.82.1373424658615; Tue, 09 Jul 2013 19:50:58 -0700 (PDT) Received: from holycrap.mydomain ([207.224.50.62]) by mx.google.com with ESMTPSA id mt3sm42447907oeb.1.2013.07.09.19.50.57 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Jul 2013 19:50:57 -0700 (PDT) From: Chia-I Wu To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Jul 2013 10:49:59 +0800 Message-Id: <1373424599-8583-1-git-send-email-olvaffe@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [Intel-gfx] [PATCH libdrm] intel: silence valgrind warnings for unsynchronized maps X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Mark the address ranges as accessible with VALGRIND_MAKE_MEM_DEFINED. Signed-off-by: Chia-I Wu --- 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;