From patchwork Thu Mar 7 19:11:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 10843767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 031241390 for ; Thu, 7 Mar 2019 19:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2B722F791 for ; Thu, 7 Mar 2019 19:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D753F2F8F6; Thu, 7 Mar 2019 19:11:33 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 DCFBF2F8A3 for ; Thu, 7 Mar 2019 19:11:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67F1C6E216; Thu, 7 Mar 2019 19:11:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id C93246E216 for ; Thu, 7 Mar 2019 19:11:30 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 11:11:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,451,1544515200"; d="scan'208";a="150258599" Received: from relo-linux-2.fm.intel.com ([10.1.27.125]) by fmsmga004.fm.intel.com with ESMTP; 07 Mar 2019 11:11:30 -0800 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Mar 2019 11:11:15 -0800 Message-Id: <20190307191115.35336-2-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307191115.35336-1-antonio.argenziano@intel.com> References: <20190307191115.35336-1-antonio.argenziano@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 2/2] drm/i915: Account for platform without mappable aperture when returning size X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Some devices will not expose a mappable aperture anymore so we need to return an appropriate value in that case. Signed-off-by: Antonio Argenziano Cc: Matthew Auld Cc: Daniele Ceraolo Spurio Cc: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index d109f6dbe992..5125a5329100 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -221,7 +221,8 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, args->aper_size = ggtt->vm.total; args->aper_available_size = args->aper_size - pinned; - args->mappable_aperture_size = ggtt->mappable_end; + args->mappable_aperture_size = + HAS_MAPPABLE_APERTURE(to_i915(dev)) ? ggtt->mappable_end : (__u64)-ENODEV; return 0; }