Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1526078pxb; Fri, 21 Jan 2022 22:15:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvX7Ho3OVnaIuSyhli0n4EW6X5xuNU8kFf3+KKOByXhr1pO262bAIKPv+PtauD5NZuTxqN X-Received: by 2002:a17:902:d492:b0:14a:f3ce:37a8 with SMTP id c18-20020a170902d49200b0014af3ce37a8mr6582553plg.34.1642832116754; Fri, 21 Jan 2022 22:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642832116; cv=none; d=google.com; s=arc-20160816; b=CbPCsMQVVcS3gMd7xS1d96awWJ/0IuenxPjQzJhPp9yAQGzjMbQawV48S/yZSylfC9 r6/UhjFtbrt35IvzfGOBVaQJ9pzTY17mbJzv9PDdOks/rDctFe6IVXGdmVaHASF1kNoq eb34J5NVY1L/BPz9n9M4MH1gMJfuMyjbAoZCN9/YCiCL1x0ugwxdGHRyVafPeGs7pUtI W5q//UYqDY0Y1N9SWGHwJ0sBAZgbLuFIE6mC4mi5/fEJuGXXVM/MmJGr1LIEkivyHzjX eMw8i7Zv5ytlAtTEuYTTGXI/GE0UOvS3LUzNmaKfANHf/w7h5So1Car838CUmj8dDtLb S1CA== 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=5kOv5RF5Jz5UhiyzjxXzzgyOSv8C5xRpkupIRDIgAPc=; b=cIHut+KAeOtvxtcL9mV5/VodqgC3m4d+MgipbTYcdjA4ioK5Z3g7BArVTbS79Yi4pz Y/75Svg4g+g0bdfjzX8VnlAlbnKE8/+kjURrULGiAyW0GmUrZ4z6ax1yS7fVZp9MtGuN qTje92wsW8aUUIGkwhV/RBJpLQs8YMUHNzWk6Z4rdKQvke4LSno0z6BNCJHd6t45inWM afMW4rjuP9bDxEOpeAdfWqr3BADo/OJ5+3zsXiaYeE4NkewBQRmOecuKQaMxqh/8cnBl pXTwEqwxTv8ogqZI7N8ORe9TpyhEjwM1zpzCJJYAGam2P1T3Vt/lSiRyxdRzgi0zSafz 0ssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Gu4uJEuC; 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 j64si1121586pge.828.2022.01.21.22.15.04; Fri, 21 Jan 2022 22:15:16 -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=Gu4uJEuC; 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 S232539AbiAUTvs (ORCPT + 99 others); Fri, 21 Jan 2022 14:51:48 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50388 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbiAUTvr (ORCPT ); Fri, 21 Jan 2022 14:51:47 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 027A31F46562 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642794706; bh=Fut1EPFyHtKExAKjhP5T7L+Q36Hqy+5BGq/LNpKSQ60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gu4uJEuCZlLUb6pJdC7RhWK76Xvzua26HeEOa9XR5Bm8I0mPWD2dNrHJipGBCoZH9 WQtKsgVqHrqLbFmR4zP633AdfmuiPUYLAU+rBJ9c6XCl7gqZTvYuoO6zKsbO24s3KM odvh3FZVcOWAPutYUroagdI9cTqxOC3Ss5t9DeRSwSEg9fVukEas43a+MmwU2b/guP tEXc1K2cuHUFZXZrtaP832D3Wsx6IzTLZKbyQOs9K8mtWsrNl4gb365sRj1UKjyuVH mfD700sn9rlZxVff+KomizCVgQ45c6znhU9hp+hg36Bml7VbhP6vcSruLS9JrYoB8m c7bpDB9tvJLrA== 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 v4 1/5] drm/i915: add needs_compact_pt flag Date: Fri, 21 Jan 2022 19:50:35 +0000 Message-Id: <20220121195040.2145227-2-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220121195040.2145227-1-bob.beckett@collabora.com> References: <20220121195040.2145227-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 44c1f98144b4..1258b7779705 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