From patchwork Thu Jun 25 15:53:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6677221 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B717C05AC for ; Thu, 25 Jun 2015 18:52:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDAD32073D for ; Thu, 25 Jun 2015 18:52:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DB6A02073C for ; Thu, 25 Jun 2015 18:52:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D8906ECA0; Thu, 25 Jun 2015 11:52:24 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 52F466ECA0 for ; Thu, 25 Jun 2015 11:52:23 -0700 (PDT) Received: by qkeo142 with SMTP id o142so43437567qke.1 for ; Thu, 25 Jun 2015 11:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=vA3MNQQLzI+uATfugjfguLUI5jHrGuLr8i7nuahIrlQ=; b=d0A6tDXSC3MsN0IEfHBWHpWD12p9TcjYxp668oNVmYQj9I6cet+JOK2+z1/bDjmhBf 5Gtihi9IaI0ug7rR6MiMawK4c/wroPh/aj1dXygoefQ94G6Gq6gjgF+kQGcGUgakvUb9 y3QSAX3W+887vrBLxA73z40rmGODUB5EkDYHvP8/VY4y/KD/rK7zDj30Z2fByVtag3VT j+9CpANyfRFpSoh971hq1oYQdPQ3F/RVHMUZjEeRd5sZt8WjDVXDn6TCLfy9wOz0xMg0 eRU1cRH3U1LyrVejwU9Pvmn1AKSu6mjnuCBScve6bZcPuf+GeeH/n4H1YProo3mNRyot nY0w== X-Received: by 10.55.31.22 with SMTP id f22mr99169409qkf.33.1435258342853; Thu, 25 Jun 2015 11:52:22 -0700 (PDT) Received: from localhost.localdomain (r130-pw-tresbarras.ibys.com.br. [189.76.1.243]) by mx.google.com with ESMTPSA id q74sm5447855qha.4.2015.06.25.11.52.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Jun 2015 11:52:22 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 25 Jun 2015 12:53:19 -0300 Message-Id: <1435247599-21678-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt] lib/igt_draw: move to the GTT domain before using GTT mmaps X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.5 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 From: Paulo Zanoni With this, we don't need to worry about what happened to the buffer before. Signed-off-by: Paulo Zanoni Reviewed-by: Chris Wilson --- lib/igt_draw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/igt_draw.c b/lib/igt_draw.c index 51dce4b..fb9294d 100644 --- a/lib/igt_draw.c +++ b/lib/igt_draw.c @@ -262,6 +262,9 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect, { uint32_t *ptr; + gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); + ptr = gem_mmap__gtt(fd, buf->handle, buf->size, PROT_READ | PROT_WRITE); igt_assert(ptr); @@ -276,6 +279,8 @@ static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect, uint32_t *ptr; uint32_t tiling, swizzle; + gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); gem_get_tiling(fd, buf->handle, &tiling, &swizzle); /* We didn't implement suport for the older tiling methods yet. */