From patchwork Tue Mar 15 18:14:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12781716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0C3AC433EF for ; Tue, 15 Mar 2022 18:15:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4782310E141; Tue, 15 Mar 2022 18:15:07 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id B905D10E141 for ; Tue, 15 Mar 2022 18:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647368105; x=1678904105; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=HlxqDOjlzAfC6JqVA1gpuKjafPAZfI2kTyHNAx6ZLBc=; b=EU28TYpim4uwIISyeuFArkEo4N6w47qlA7HHz6uWbk/mIb1eKq2L5jjB PP+5uxzXBRzSuZRvejy3D3jLVFsE8PUeTEP0oLXpKgjiyXhAlsUeONSkt jKZGvrvgeN+Amp1eou6OmFOjU7B9/wjXTKNELUk4Rir8EwKQm/v1oPD+0 OzlIWWwR++3HA/9IAKv9CghkH+VbHgdrMa8VeuXaLT+bPpwBrOtQuP/iO C1dSc166rrLrlLsOTWlJT9jX6yDTTES1WIRXzwxaS6KFWmuGc7NRW3JUT PA67PhRmQ2wHbClVDyFJUv8uHbFAqG6zxnitknv1ddFSgZ/yjKxWt0CC8 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="255221131" X-IronPort-AV: E=Sophos;i="5.90,184,1643702400"; d="scan'208";a="255221131" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 11:15:04 -0700 X-IronPort-AV: E=Sophos;i="5.90,184,1643702400"; d="scan'208";a="498133149" Received: from sobyrne-mobl.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.31.219]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 11:15:03 -0700 From: Matthew Auld To: intel-gfx@lists.freedesktop.org Date: Tue, 15 Mar 2022 18:14:19 +0000 Message-Id: <20220315181425.576828-1-matthew.auld@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [CI 1/7] drm/i915/lmem: don't treat small BAR as an error X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. It does leave open with what to do with stolen local-memory. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Reviewed-by: Nirmoy Das --- drivers/gpu/drm/i915/gt/intel_region_lmem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c index 6cecfdae07ad..783d81072c3b 100644 --- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c +++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c @@ -93,6 +93,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt) struct intel_memory_region *mem; resource_size_t min_page_size; resource_size_t io_start; + resource_size_t io_size; resource_size_t lmem_size; int err; @@ -124,7 +125,8 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt) io_start = pci_resource_start(pdev, 2); - if (GEM_WARN_ON(lmem_size > pci_resource_len(pdev, 2))) + io_size = min(pci_resource_len(pdev, 2), lmem_size); + if (!io_size) return ERR_PTR(-ENODEV); min_page_size = HAS_64K_PAGES(i915) ? I915_GTT_PAGE_SIZE_64K : @@ -134,7 +136,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt) lmem_size, min_page_size, io_start, - lmem_size, + io_size, INTEL_MEMORY_LOCAL, 0, &intel_region_lmem_ops);