From patchwork Thu Aug 25 14:52:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 12954963 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 BAA4BC64990 for ; Thu, 25 Aug 2022 14:52:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5881B10E38F; Thu, 25 Aug 2022 14:52:39 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id C350E10E38F for ; Thu, 25 Aug 2022 14:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661439155; x=1692975155; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xtARnxyRZnhpYhzBIZ2SOwTsdxFjkpt22DHlPDcYScM=; b=AvoWWLS/Bd4sxoFnSp2GjlOzU/Nj+GFR8p9LmsPehpjnM5Pp+hP6XKLg laDDcnyC1uHY9xw9ZEcZ6QPB8ubJnKF5ZwZzqUH6xnSIXg+dEmBnt4V7q AoMK1lWEwk9/KLmktR+QiZ6c/yK+78uYtIwDRbKeAIMgwGVWBSHl97dEi FqQdoZnIiFNVK9maMpZDJHgtDJevoQ6PL0qHHgcMFaLv1G0KHk43CvRa9 XiPd5zU/fPfyUX3xA40BOCUFOWYc6sCtxGCBB0yXfSCOCh3BIpSKZzKBk jm32pI/kFzrCL8JStx08emF+DSymmkyE5VELrP6ZjEabpWhiK5Bfi2B9L Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="358222626" X-IronPort-AV: E=Sophos;i="5.93,263,1654585200"; d="scan'208";a="358222626" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 07:52:35 -0700 X-IronPort-AV: E=Sophos;i="5.93,263,1654585200"; d="scan'208";a="678487020" Received: from lab-ah.igk.intel.com ([10.91.215.196]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 07:52:33 -0700 From: Andrzej Hajda To: intel-gfx@lists.freedesktop.org Date: Thu, 25 Aug 2022 16:52:11 +0200 Message-Id: <20220825145211.22941-1-andrzej.hajda@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Subject: [Intel-gfx] [PATCH] drm/i915/selftests: do not try misaligned_pin test on unmappable memory 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: , Cc: Chris Wilson , Matthew Auld , Andrzej Hajda Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In case of Small BAR configurations stolen local memory can be unmappable. Trying to test it causes -ENOSPC error from _i915_gem_object_stolen_init. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565 Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index fb5e6196347925..667c4c004bdbcf 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1164,6 +1164,10 @@ static int misaligned_pin(struct i915_address_space *vm, if (hole_size < 3 * min_alignment) continue; + /* avoid -ENOSPC on unmappable memory */ + if (!mr->io_size) + continue; + /* we can't test < 4k alignment due to flags being encoded in lower bits */ if (min_alignment != I915_GTT_PAGE_SIZE_4K) { err = misaligned_case(vm, mr, addr + (min_alignment / 2), size, flags);