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 0E002CCF9F0 for ; Thu, 30 Oct 2025 08:51:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C121110E933; Thu, 30 Oct 2025 08:51:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="iokexpTZ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0859410E92D; Thu, 30 Oct 2025 08:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761814262; x=1793350262; h=from:to:subject:in-reply-to:references:date:message-id: mime-version:content-transfer-encoding; bh=bup7AB98FqqifvUSoe+GWZ7fyeuCwOu83UHRPn3q+Xg=; b=iokexpTZEefRTQy/nUHQQiWzYoqSYzo1hOWb4uTXVtczatDCxlZPtS13 n05LUzc23VCmOTgalXOIsxeIugE4Rc5vYOVO5HoDR15fUbdNhul5oVRXQ v1LOeHsHDKO9v7X7hxXu0AJmkLuxBSOLbbSrAExEIWE7PjzPHMO5neFl/ SvabhkN7z7K+AMu3ddKumVOPI9gPfiiv3PUof/ENSNa1S6GXyIQVpz+44 5grzOfFke76DfTdcNumPfp9RBxtH9kZFp61GqKd/HM1FfdKVBqlsWaCpO /Bwum2HzI3311cVrCnNeUVgbXQK6CoJbAtfLq+DR57y0FogYFSrnd2bzO w==; X-CSE-ConnectionGUID: SrIYutexQnO2yy+0lLqS7w== X-CSE-MsgGUID: KvCLpHYbRJS+EelHml6o5A== X-IronPort-AV: E=McAfee;i="6800,10657,11597"; a="74548259" X-IronPort-AV: E=Sophos;i="6.19,266,1754982000"; d="scan'208";a="74548259" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2025 01:51:01 -0700 X-CSE-ConnectionGUID: pLsi2s9EQ1aNXI1z08d6qQ== X-CSE-MsgGUID: zB81DpTpQi2UUAHkcAUScQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,266,1754982000"; d="scan'208";a="185832979" Received: from ettammin-desk.ger.corp.intel.com (HELO localhost) ([10.245.246.223]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2025 01:51:00 -0700 From: Jani Nikula To: Luca Coelho , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Subject: Re: [PATCH 4/6] drm/i915/display: add intel_display_vtd_active() In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: Date: Thu, 30 Oct 2025 10:50:57 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Thu, 30 Oct 2025, Luca Coelho wrote: > On Wed, 2025-10-22 at 18:17 +0300, Jani Nikula wrote: >> diff --git a/drivers/gpu/drm/i915/display/intel_display_utils.c b/driver= s/gpu/drm/i915/display/intel_display_utils.c >> index 13d3999dd580..04d010f7c23e 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display_utils.c >> +++ b/drivers/gpu/drm/i915/display/intel_display_utils.c >> @@ -1,10 +1,15 @@ >> // SPDX-License-Identifier: MIT >> /* Copyright =C2=A9 2025 Intel Corporation */ >>=20=20 >> +#include >> + >> +#include >> + >> #ifdef CONFIG_X86 >> #include >> #endif >>=20=20 >> +#include "intel_display_core.h" >> #include "intel_display_utils.h" >>=20=20 >> bool intel_display_run_as_guest(struct intel_display *display) >> @@ -16,3 +21,12 @@ bool intel_display_run_as_guest(struct intel_display = *display) >> return false; >> #endif >> } >> + >> +bool intel_display_vtd_active(struct intel_display *display) >> +{ >> + if (device_iommu_mapped(display->drm->dev)) >> + return true; >> + >> + /* Running as a guest, we assume the host is enforcing VT'd */ >> + return intel_display_run_as_guest(display); >> +} > > This also looks quite much like an "inlineable" function, no? Same reason as before, and that display->drm->dev dereference would require pulling in both intel_display_core.h and drm/drm_device.h in the header. BR, Jani. --=20 Jani Nikula, Intel