From patchwork Wed Dec 21 14:11:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9483035 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 DA98F60487 for ; Wed, 21 Dec 2016 14:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC9C3280FC for ; Wed, 21 Dec 2016 14:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1424281AA; Wed, 21 Dec 2016 14:11:36 +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 453A3280FC for ; Wed, 21 Dec 2016 14:11:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8227E6EC0A; Wed, 21 Dec 2016 14:11:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id B23836EC0A for ; Wed, 21 Dec 2016 14:11:30 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id u144so30719174wmu.0 for ; Wed, 21 Dec 2016 06:11:30 -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=vBf5ttFnh0JEeI5sIHvoT0tkosQ6W4Wrnt65LcaWuIQ=; b=r417faHLAdxioTNtloafZRECo2D3COBtJfj0fEZm3Dozc6UkbccTWyzHS/G4iWHGPN Ff9oP/0V40IRsUllpenzOmUzXajGyi2iFomx0oBp9NfpJ2Htacm8UtRBohOdBclpup4d ynO6FDraIJPzoCRZKehyh/0TxsWIh9a36QWpHej3WZL7jDfffYeTInO/VNKDFuFagKju 6DehVvhg0axD81fhw/J931lTGVCgyTMe+yiUXasfn/Hl/Ub0bM7DTpOTtSA5hdLMY3+U b7IMeWhi8IyJFVU+ClLalC1REM0mUEI4U1LcchXRx89pUYTtWFZeSg5l/RcHXv01Tqkr KYAw== 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=vBf5ttFnh0JEeI5sIHvoT0tkosQ6W4Wrnt65LcaWuIQ=; b=suagEUU4KagyJ0j8drV2Kr9p8BTvb+xPLsc98VjmoMqOQpQyIuGYPi11jydCOCa1P1 Sb/nWHsycG18WnudtLUvPw7clEzZoxNa/QVpmp4WVHvGuoMrHtoQpQWXjuBuKqWSRgv7 ZL2rcdIEuZd9MAEF6ViYqXjM4U/PCC+5TyRqzQOZcxhVEqxsmUlQmptATANao6A8++mu x0a0aHpTJcH+jfeD49BPdDg2QPXaUumY71ZM432yfiSSFdBnOO+/CTu1c43nVb7fmqol Ifdubnsb2deoMDrn9y9t8hh1umZvP5+lDbISbul+teMNWnOrw4MztDANzxSBjluV5AHV 0vMw== X-Gm-Message-State: AIkVDXIlDVD0hlE7TaCA33JZPNCj5oudDZGwq0UAjbwPH0OXzTTGKL59eyD/lFSOobasbQ== X-Received: by 10.28.165.2 with SMTP id o2mr7737913wme.38.1482329489011; Wed, 21 Dec 2016 06:11:29 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id f134sm27412203wmf.19.2016.12.21.06.11.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 06:11:28 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 21 Dec 2016 14:11:26 +0000 Message-Id: <20161221141126.2452-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Subject: [Intel-gfx] [PATCH] drm/i915/guc: Reserve the upper end of the Global GTT for the GuC 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 The GuC would like to own the upper portion of the GTT for itself, so exclude it from our drm_mm to prevent us using it. Signed-off-by: Chris Wilson Cc: Michal Wajdeczko Cc: Arkadiusz Hiler Reviewed-by: MichaƂ Winiarski Tested-by: Arkadiusz Hiler Reviewed-by: Michal Wajdeczko --- drivers/gpu/drm/i915/i915_gem_gtt.c | 5 +++++ drivers/gpu/drm/i915/intel_guc_fwif.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 6af9311f72f5..96bc0e83286a 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -3176,6 +3176,11 @@ int i915_ggtt_probe_hw(struct drm_i915_private *dev_priv) if (ret) return ret; + if (HAS_GUC_SCHED(dev_priv)) { + ggtt->base.total -= GUC_GGTT_RESERVED_TOP; + ggtt->mappable_end = min(ggtt->mappable_end, ggtt->base.total); + } + if ((ggtt->base.total - 1) >> 32) { DRM_ERROR("We never expected a Global GTT with more than 32bits" " of address space! Found %lldM!\n", diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h index 3202b32b5638..3361d38ed859 100644 --- a/drivers/gpu/drm/i915/intel_guc_fwif.h +++ b/drivers/gpu/drm/i915/intel_guc_fwif.h @@ -23,6 +23,9 @@ #ifndef _INTEL_GUC_FWIF_H #define _INTEL_GUC_FWIF_H +/* A small region at the top of the global GTT is reserved for use by the GuC */ +#define GUC_GGTT_RESERVED_TOP 0x1200000 + #define GFXCORE_FAMILY_GEN9 12 #define GFXCORE_FAMILY_UNKNOWN 0x7fffffff