From patchwork Thu Oct 5 12:07:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9986965 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 A7748602B8 for ; Thu, 5 Oct 2017 12:08:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 909B728C2A for ; Thu, 5 Oct 2017 12:08:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8422D28C6E; Thu, 5 Oct 2017 12:08:05 +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.2 required=2.0 tests=BAYES_00, 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 20EC528C2A for ; Thu, 5 Oct 2017 12:08:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBF3189F49; Thu, 5 Oct 2017 12:08:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC09D89F49 for ; Thu, 5 Oct 2017 12:08:02 +0000 (UTC) Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LxwHc-1dCm7A3zPA-015LNL; Thu, 05 Oct 2017 14:07:53 +0200 From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Chris Wilson Subject: [PATCH] drm/i915/selftests: fix check for intel IOMMU Date: Thu, 5 Oct 2017 14:07:22 +0200 Message-Id: <20171005120749.400818-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:8EG2+CxEgaYLcH+8i2ah8+amZqjg9T47lm6PHWzNKk+xKovoj3h Xrpot+T7/o2vzc+Zjbt3nL0Tgmfx+1w/wHOEjLARLPG68aA6gBResr4U00HK+z6B5xdWaQY 8f6cm6jI50WavnRKBlsLA9iosv1w4bAhA/eIDF/jmsoXnTeeN5/zW5fYXGBsxEfUfNeEd49 CdGwWW0u5e8tRUgnwE3Ow== X-UI-Out-Filterresults: notjunk:1; V01:K0:C4oOONNMrHg=:FpuDyIhfoG0MopBTQMTx5a IJxcewIlqyT1NkC+zhq9aKq4xtJXG5pJS2trRHJqq+iseDWREPtqLMZdpvuzBHHOjDtBHfzni jCgJ7Cj/YYaweptv2GtIEuAfZ+u5KOdze8Jrv0htPPYykIv6J544a0d3SyxzO6QHxa5KayRfb bsW8QU15+08e4hIpsBUCtiNrGDld4QsQ0Ch8WiJuVIld+rCV+ZbjOJF0HJqL4qvIMfh7tDXYl 1PhrrmEjz/S8dz7GB0itlmz5tgVKPrz3CDPTLQHsCClEfB9E09ppwrO//RpFWSFfSolm4E5cW MEUUf6sJ5Q9Msx5GeXxgM7uA7OPyapApHulS7/8RT2niGtDxRIC8xDjpHS266DY0ADRh0bgO1 13GImthBYhsjUBBJmFxAIYKYL2k8k+yFIwkEu2053L3DJLX56UsxD74vAIw7jfhz1ADKG2q88 OXy3uPOrSfhjn03CTRnDiAodwQ7YUVlBpNg4LSWdfCbcmpOe7xSP3flS4pizdm2qMdDkOG/lx uiJoiV/kSFLgP6yOTcVUKWWdnFlcXo8EPTdKWOsGyITmvhq9YlUcRqzqrk838CbCcfFw2Qw99 tCUMa91FxmNhxKATRCcLGavjQwlx/PJAHrOfQklegGrXE59BHty7SY7CGMqjSK0WG55BbU9js Z+Bx1vEkxnD62FTlRIOAm88uD/xSufCvc5zLPOK4HwFKF6s82ZgWG+CcQ3PRrCRDmmVjV8OqA eV2fgPMGUf+66dczxcQUpn09GwnTxqW6QymiOg== Cc: Arnd Bergmann , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Matthew Auld X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP An earlier bugfix tried to work around this build failure: drivers/gpu/drm/i915/selftests/mock_gem_device.c: In function 'mock_gem_device': drivers/gpu/drm/i915/selftests/mock_gem_device.c:151:20: error: 'struct dev_archdata' has no member named 'iommu' Checking for CONFIG_IOMMU_API is not sufficient as a compile-time test since that may be enabled in configurations that have neither INTEL_IOMMU not AMD_IOMMU enabled. This changes the check to INTEL_IOMMU instead, as this is the only case we actually care about. Fixes: f46f156ea770 ("drm/i915/selftests: Only touch archdata.iommu when it exists") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index 2388424a14da..3b7877884dd1 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -146,7 +146,7 @@ struct drm_i915_private *mock_gem_device(void) dev_set_name(&pdev->dev, "mock"); dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); -#if IS_ENABLED(CONFIG_IOMMU_API) +#if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU) /* hack to disable iommu for the fake device; force identity mapping */ pdev->dev.archdata.iommu = (void *)-1; #endif