Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1295675pxb; Fri, 21 Jan 2022 14:38:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXQETq6CifTz1Snmrls7keBej1wFR8hM6bd9e5zEqdfLHfnUy54lBREx0Vb5VPKebeZfi1 X-Received: by 2002:a17:90b:3b8f:: with SMTP id pc15mr2733915pjb.210.1642804724781; Fri, 21 Jan 2022 14:38:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804724; cv=none; d=google.com; s=arc-20160816; b=Vc1Tmw0t9FPCVNIcr33fxzOt7zlEMjDyRfazom5Hur49zUDNKayWybeR/kj2CxS0+F 73lFvs3RUs2tqcMdOK1aVNwg4e8lOAEpJwQ9pIkDF/jBHtVuYuLfyiOSNCTFcTdD9wfG QzHgdmeT8V724ryAYebsg1W6yjIz32pD1Arc5FDBWjw36cQ+Lkn8X2nBN0TsnzCEw0/S xEXURHpMbW9qVVnKG/176TEB5spp9OC+M9lUsjnaDWcgjD0hMqsDJexc/9mGSmwhqnp8 DmM3bQfmyo/a8rzGQNLZgpRMjwOprl4yuHr43ZhRQNSAhSumIGngu7XfpdTPp5Vd2rdj swDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sRucnGSdXsxsXW0UZxuqWqJMHLFQNHVMsR87DYwH8ow=; b=b5S3bzgpl+nwz2bkQ+L1K+cRJ0QiYwVjs93jLABoB2U/cVGXxuQMHKHwhkkKH9eiMT L1g6mHlajNocE6LWyKNWTRQUbVm5VPpFlNQaN9rJiZGBWJkNFbrTlBT64dUFFd/jOn2C C4JEeWIfAKHB7tOUGJoa9EnXuwec4/OSQvHwf3D3tVuQelEtSLRF1KeO5CwRAo1D5Sbf IesJCQ6MkJ4S2Rd90UGlczr6xWld0d2kGjiW4CMo6F6GVjOYSTMDmVYEFoGeuUC8ClLf eI/VrOxTWoO1Q/RrTN4gOXttwgU+sTLIAWFS0KejZuKLe0d/6FwzXsRargS19C/1nXaR f23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hg3rtvcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si7081976plq.117.2022.01.21.14.38.32; Fri, 21 Jan 2022 14:38:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hg3rtvcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377684AbiATUks (ORCPT + 99 others); Thu, 20 Jan 2022 15:40:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377668AbiATUkq (ORCPT ); Thu, 20 Jan 2022 15:40:46 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CDC3C061574 for ; Thu, 20 Jan 2022 12:40:46 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 0EFEF1F418B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642711244; bh=auL5iwvObCfBrtpG9CbNfkwKNfs8eziZAt49juwM40E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hg3rtvcjUM93/v13wWcM7M/7LNeOXXrDqA/q5nao+PltHLDp+yzWinLlGL6he73Kz /W2AtducJUB5DaCpejCmIZUzDHT3ycc3Y/XtshVkhDXcnLRNruUlzp1G7kpkJdKKWu GSPsla3UWDA+xlxHiL334gaDhc1pBwUsZtimGDjBG8y/UoCtuZBsbNgl1YA1DSpJcK k9WFC9ZXT1HVb8Ykq0Qn42020QYOF/+rQirpGu2jqcZI+7+vxiTJIpv+p5YK86Uz8h IpMbwx/Gh40qVhk50MINUL+pAnnOVrxZIGeUb+Fua+orHsMBeDy3oNcR+iUoxovAwS WGIwU37FVfJRQ== From: Robert Beckett To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: Ramalingam C , Matthew Auld , Robert Beckett , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/5] drm/i915: add needs_compact_pt flag Date: Thu, 20 Jan 2022 20:37:16 +0000 Message-Id: <20220120203721.632424-2-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220120203721.632424-1-bob.beckett@collabora.com> References: <20220120203721.632424-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramalingam C Add a new platform flag, needs_compact_pt, to mark the requirement of compact pt layout support for the ppGTT when using 64K GTT pages. With this flag has_64k_pages will only indicate requirement of 64K GTT page sizes or larger for device local memory access. Suggested-by: Matthew Auld Signed-off-by: Ramalingam C Signed-off-by: Robert Beckett --- drivers/gpu/drm/i915/i915_drv.h | 10 +++++++--- drivers/gpu/drm/i915/i915_pci.c | 2 ++ drivers/gpu/drm/i915/intel_device_info.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 890f1f6fbc49..23f4713005bb 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1512,12 +1512,16 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, /* * Set this flag, when platform requires 64K GTT page sizes or larger for - * device local memory access. Also this flag implies that we require or - * at least support the compact PT layout for the ppGTT when using the 64K - * GTT pages. + * device local memory access. */ #define HAS_64K_PAGES(dev_priv) (INTEL_INFO(dev_priv)->has_64k_pages) +/* Set this flag when platform doesn't allow both 64k pages and 4k pages in + * the same PT. this flag means we need to support compact PT layout for the + * ppGTT when using the 64K GTT pages. + */ +#define NEEDS_COMPACT_PT(dev_priv) (INTEL_INFO(dev_priv)->needs_compact_pt) + #define HAS_IPC(dev_priv) (INTEL_INFO(dev_priv)->display.has_ipc) #define HAS_REGION(i915, i) (INTEL_INFO(i915)->memory_regions & (i)) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 4081fd50ba9d..799b56569ef5 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -1028,6 +1028,7 @@ static const struct intel_device_info xehpsdv_info = { PLATFORM(INTEL_XEHPSDV), .display = { }, .has_64k_pages = 1, + .needs_compact_pt = 1, .platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VECS1) | BIT(VECS2) | BIT(VECS3) | @@ -1045,6 +1046,7 @@ static const struct intel_device_info dg2_info = { .media.rel = 55, PLATFORM(INTEL_DG2), .has_64k_pages = 1, + .needs_compact_pt = 1, .platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VECS1) | diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index 3699b1c539ea..c8aaf646430c 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -130,6 +130,7 @@ enum intel_ppgtt_type { /* Keep has_* in alphabetical order */ \ func(has_64bit_reloc); \ func(has_64k_pages); \ + func(needs_compact_pt); \ func(gpu_reset_clobbers_display); \ func(has_reset_engine); \ func(has_global_mocs); \ -- 2.25.1