From patchwork Fri Feb 17 14:07:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9579859 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 AFAE0600C5 for ; Fri, 17 Feb 2017 14:07:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A020E27F10 for ; Fri, 17 Feb 2017 14:07:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92AAF27FA8; Fri, 17 Feb 2017 14:07:20 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C33B27F10 for ; Fri, 17 Feb 2017 14:07:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8DCB6E12C; Fri, 17 Feb 2017 14:07:19 +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 011896E12C for ; Fri, 17 Feb 2017 14:07:19 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id r18so2764370wmd.3 for ; Fri, 17 Feb 2017 06:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=wa/tyjisqCdyX6y1qatgytITETKowjBtJvJO2XuAjak=; b=PiSPoQpiYr3q4WUCHIyt5vUvHuPtxxvO/y38Y/2gp4ssv7A+ZbmPJmnk8g8FHcl8fS Wy6TLS1LgGb9YT07VeSEVHjlbIBRFFQOn2UfHy+dYf9qZ5nOqDle6063xX4p+cGCB+dq dbDFk3Y/g87/TaIFf7SE6IAJwJo7wVoxAc6U8g1CkaxvgCvE5CiIbY4Ek4S8/nbzMWHH XUhG+18fAr1B0XlPwL5nFl6OyKd1ywAbGl/Y6CimnzAxsCKeA2Kpg2QeYdCVis9mkvfl /hoqasBjXmbXQwKvPGYqZFVUNUtNhEA9sk7XhEF9odqx/frEqW4xqcOPbMjVs2kBEnkk Slaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=wa/tyjisqCdyX6y1qatgytITETKowjBtJvJO2XuAjak=; b=N4kCEOFZzv6qQVpIt6CWVAhKijjjCIiOAFDP+3qYfC9M5nwY5nVnIRs0CCeaiNqaq9 Rzf1a08jHXA/YHQUNzjdcgx0v3JyoPSDTmvuoGDYX4DaUOjrx5tfHlM3wov4gB7pKrTf AQOe7Il/7FqQ3ZABUqaOE1E/IxWnPH0ZNh0pTRiTHTN9kDJJ7KpFFeSTuI1tNyPAYoQx CiyIRoGg54Sc3DcgZGJdqBbeFAzdEv4GEoh2Y+n8HFAV/mtqR5TVvw4pTfihD2AZawLo mo14goopkM8ffJW/P3cyyyOx2H67Qd1Ws9w8pTrAt0auR36uKwUHuIK85tBGLDiJn9rk 0YJQ== X-Gm-Message-State: AMke39k5iXo93kuuC0fdP51Bp2KEivcI47YOOVkHb2L/ywRVuHKo0z1KvjKS3XL7bjHnkw== X-Received: by 10.28.146.12 with SMTP id u12mr2233214wmd.113.1487340437454; Fri, 17 Feb 2017 06:07:17 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id u68sm1925461wrb.65.2017.02.17.06.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 06:07:16 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 17 Feb 2017 14:07:14 +0000 Message-Id: <20170217140715.30653-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects 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 Generalise the skip for physical and stolen objects by skipping anything we do not have a valid address inside the sg. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_gem.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6745dcbf3799..96098a7e0bc3 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3162,14 +3162,19 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj, * to GPU, and we can ignore the cache flush because it'll happen * again at bind time. */ - if (!obj->mm.pages) + if (!obj->mm.pages) { + GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU); return; + } /* * Stolen memory is always coherent with the GPU as it is explicitly * marked as wc by the system, or the system is cache-coherent. + * Similarly, we only access struct pages through the CPU cache, so + * anything not backed by physical memory we consider to be always + * coherent and not need clflushing. */ - if (obj->stolen || obj->phys_handle) + if (!i915_gem_object_has_struct_page(obj)) return; /* If the GPU is snooping the contents of the CPU cache,