From patchwork Tue Jul 19 10:51:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9236729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DC7B60574 for ; Tue, 19 Jul 2016 10:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80193205A4 for ; Tue, 19 Jul 2016 10:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74B9226A4D; Tue, 19 Jul 2016 10:52:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41224205A4 for ; Tue, 19 Jul 2016 10:52:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 84F976E61C; Tue, 19 Jul 2016 10:52:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1AE36E616 for ; Tue, 19 Jul 2016 10:52:23 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id o80so2398362wme.0 for ; Tue, 19 Jul 2016 03:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=eklgFAbp8wqkvklcbQn6gT6aPrdaXm1KcUY+E74c+ZI=; b=LPY4gE0Cj1wNhupqvHME8B3Ui4CyfgweV8+uPE+iFyTLXXmM/qk+KOt5wByuJ+BwNO C+DM2CiXtioHkm2UWbIymnBxJGx7mPmFhV3fCYt1oPCuG0tdaXprxadhVMJfW/96PjQX Fkm4hSVDml2O90JeZVut0QkSSOhtHHnY5h4dNq6gCmbzI2IQmBA4x66Y7Fp28jNHhbrk R+VTEneqMmvYWFouvq5EjYa3UkLZlv5isxxNF8ANlPfiIB9rEweFW6YZcM+d81nz/pZr d4RehyN1/NW/uhayYSccuVK6Hosvius4eFxSZsAoirv2Nh5Zm3Uc2Dzh5iu7EvrfqGuz DNLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=eklgFAbp8wqkvklcbQn6gT6aPrdaXm1KcUY+E74c+ZI=; b=RwaMzyQopQdJdwftoF0Q/7TIoea0u30PL080kJoIye6bjWlqe1Fe1W57JyrXgZ8F5z rchOZiCD//+EI+E57jeFm4BROenUXx3nVX+w46wReTLaY9dgm7U6G1isIuh6818ck7eo B4nxVyudm4mpBP30MwG4RoLW44bQlGlQ4B5NXU5cF3n2GwxLpBM6KOvkgnj8lkUvJrup u8v1z+FkR0uo4gV8enbDKRNr8GPin7hB7D/oe8tDEPUVLS0cV37dBYy7XLRxd3ZNYwau RKMkncsHYJH2u5M54j1wrMsehYowvgbbxG9N07sfmUrojj/s0F0WZRu6ISrWQpdKErYQ 0eDQ== X-Gm-Message-State: ALyK8tKXVp79dvkEUAX9Snzbkk6oeOezmvZhznYyTRKZNf0kdzkDaOr+DhzGYTMz8P/ucQ== X-Received: by 10.28.211.10 with SMTP id k10mr3229095wmg.16.1468925541247; Tue, 19 Jul 2016 03:52:21 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id x62sm21881697wmf.13.2016.07.19.03.52.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 03:52:19 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Jul 2016 11:51:58 +0100 Message-Id: <1468925519-32534-7-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468925519-32534-1-git-send-email-chris@chris-wilson.co.uk> References: <1468925519-32534-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 7/8] drm/i915: Mark imported dma-buf objects as being coherent 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-Virus-Scanned: ClamAV using ClamSMTP A foreign dma-buf does not share our cache domain tracking, and we rely on the producer ensuring cache coherency. Marking them as being in the CPU domain is incorrect. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 80bbe43a2e92..c7d734248ed0 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c @@ -299,6 +299,8 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, drm_gem_private_object_init(dev, &obj->base, dma_buf->size); i915_gem_object_init(obj, &i915_gem_object_dmabuf_ops); obj->base.import_attach = attach; + obj->base.read_domains = I915_GEM_DOMAIN_GTT; + obj->base.write_domain = 0; return &obj->base;