From patchwork Fri May 13 14:30:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9091931 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 7A1BABF29F for ; Fri, 13 May 2016 14:31:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DC332025A for ; Fri, 13 May 2016 14:31:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B83C120251 for ; Fri, 13 May 2016 14:31:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AFA26E545; Fri, 13 May 2016 14:31:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id A4DBA6E18F for ; Fri, 13 May 2016 14:30:56 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id w143so4067236wmw.3 for ; Fri, 13 May 2016 07:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=EnbFpMAH4AAi0MsM3UqyQq4evOd3a36AM523C77GtA0=; b=Dd2WaHx8yVchpagn6I3CIY0/gpiByvSPabFzViquItu1x/+SRMDsz5aN/HVjtPKrRA Qzg8lhQ5cV2HW7/eXQCbBbeOF4HGx6dVw91f1z5BdwVPWYv+NjN6nnlhMqNVI0O1ZycR vzSp1AdAVSIBkr7lktY70uyPicnBTLDC5IqQv/nte6es1J/jiJ/i+QqoSaQoIlX+gX8y pQ1zJXeuIfFAX0y5jML9DhkVbGwUjAF7J7379fo2ozavYRsyQDvD+EG7q6BvEva6cik9 BbvEVIXmOFJEHU3CzhBpZ1u/gNXqK4l0QBtBbGoDA/Dcgx/Y/9T1DUccpm+FMEOz+6wR TulQ== 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:subject:date:message-id :in-reply-to:references; bh=EnbFpMAH4AAi0MsM3UqyQq4evOd3a36AM523C77GtA0=; b=XKBnpyzCCW1cmqVzrN08V7NJZh8BSY5Nnj2IbprDO5JVhBoRx+xdQQPrVucEECZ/TF Cer0FAPlEGMSypQ6n7y3IwPZsVGnCxaH9dsbuPD9QsoasUjKTMWuQbhC12CM3KfPe/2O S+BkZWhFprPJAspiwSSgcj4iCWo09OfTssPw4wnVNHr+NydYtideylRkE8ANFzNfpAiM T71x9ZAG9+6LBrfOgDy2wMmuA43qJrc0UPU6K/3+0xpAuHwn+vIEwd5K+6vpAE0gDfSc J71ZBDmn6dHmf14Vf53AgiX53YAPl7p6KMWflSfrQRJ+jFharWVShhxmSAQo6CMc6Wyt ftyg== X-Gm-Message-State: AOPr4FWEHa3CwUH2tPz1lGkg/U8F1qMLKbw1XGFSbwJrNMc5V27xNTQGCGLsXU27CHrPXg== X-Received: by 10.28.144.138 with SMTP id s132mr4312790wmd.102.1463149855281; Fri, 13 May 2016 07:30:55 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id lr9sm18883734wjb.39.2016.05.13.07.30.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 May 2016 07:30:53 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 13 May 2016 15:30:47 +0100 Message-Id: <1463149847-30067-4-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1463149847-30067-1-git-send-email-chris@chris-wilson.co.uk> References: <1463053288-24953-1-git-send-email-chris@chris-wilson.co.uk> <1463149847-30067-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 4/4] drm/i915: Skip clearing the GGTT on full-ppgtt systems 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_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Under full-ppgtt, access to the global GTT is carefully regulated through hardware functions (i.e. userspace cannot read and write to arbitrary locations in the GGTT via the GPU). With this restriction in place, we can forgo clearing stale entries from the GGTT as they will not be accessed. For aliasing-ppgtt, we could almost do the same except that we do allow userspace access to the global-GTT via execbuf in order to workraound some quirks of certain instructions. (This execbuf path is filtered out with EINVAL on full-ppgtt.) The most dramatic effect this will have will be during resume, as with full-ppgtt the GGTT is only used sparingly. References: https://bugs.freedesktop.org/show_bug.cgi?id=94722 Signed-off-by: Chris Wilson Cc: David Weinehall Reviewed-by: Joonas Lahtinen Tested-by: David Weinehall --- drivers/gpu/drm/i915/i915_gem_gtt.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 319f3b459b3e..7eab619a3eb2 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -2477,6 +2477,13 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, assert_rpm_atomic_end(dev_priv, rpm_atomic_seq); } +static void nop_clear_range(struct i915_address_space *vm, + uint64_t start, + uint64_t length, + bool use_scratch) +{ +} + static void gen8_ggtt_clear_range(struct i915_address_space *vm, uint64_t start, uint64_t length, @@ -3072,14 +3079,17 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) ret = ggtt_probe_common(dev, ggtt->size); - ggtt->base.clear_range = gen8_ggtt_clear_range; - if (IS_CHERRYVIEW(dev_priv)) - ggtt->base.insert_entries = gen8_ggtt_insert_entries__BKL; - else - ggtt->base.insert_entries = gen8_ggtt_insert_entries; ggtt->base.bind_vma = ggtt_bind_vma; ggtt->base.unbind_vma = ggtt_unbind_vma; + ggtt->base.clear_range = nop_clear_range; + if (!USES_FULL_PPGTT(dev_priv)) + ggtt->base.clear_range = gen8_ggtt_clear_range; + + ggtt->base.insert_entries = gen8_ggtt_insert_entries; + if (IS_CHERRYVIEW(dev_priv)) + ggtt->base.insert_entries = gen8_ggtt_insert_entries__BKL; + return ret; }