From: Bob Paauwe <bob.j.paauwe@intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: [PATCH 3/3] drm/i915: Remove HAS_FULL_PPGTT and device_info.ppgtt enum
Date: Mon, 29 Oct 2018 14:39:51 -0700 [thread overview]
Message-ID: <20181029213951.544255-3-bob.j.paauwe@intel.com> (raw)
In-Reply-To: <20181029213951.544255-1-bob.j.paauwe@intel.com>
The distincsion between aliasing, full, and 4 level ppgtt is primarily
the size of the address range. Now that we have that specified for
each platform, having a separate enum that specifies the ppgtt type is
redundant. A platform either has support for ppgtt or it doesn't.
This means we can now remove the HAS_FULL_PPGTT macro and the devcie
info ppgtt type.
However, there are still a few places where GEN 6's aliasing ppgtt
differences matter. For those cases, it makes just as much sense to
check if we're running on GEN 6 as it does to check a device info flag.
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 ++++++-
drivers/gpu/drm/i915/i915_drv.h | 8 +++++---
drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
drivers/gpu/drm/i915/i915_pci.c | 6 ------
drivers/gpu/drm/i915/intel_device_info.c | 2 +-
drivers/gpu/drm/i915/intel_device_info.h | 9 +--------
drivers/gpu/drm/i915/selftests/huge_pages.c | 4 ++--
drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
10 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 393e89e2b309..eafb70407356 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -345,7 +345,12 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data,
value = HAS_WT(dev_priv);
break;
case I915_PARAM_HAS_ALIASING_PPGTT:
- value = min_t(int, INTEL_PPGTT(dev_priv), I915_GEM_PPGTT_FULL);
+ if (INTEL_GEN(dev_priv) < 6)
+ value = I915_GEM_PPGTT_NONE;
+ else if (IS_GEN6(dev_priv))
+ value = I915_GEM_PPGTT_ALIASING;
+ else
+ value = I915_GEM_PPGTT_FULL;
break;
case I915_PARAM_HAS_SEMAPHORES:
value = HAS_LEGACY_SEMAPHORES(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5b104dad75d8..3acdda232ea1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2582,11 +2582,13 @@ intel_info(const struct drm_i915_private *dev_priv)
#define HAS_EXECLISTS(dev_priv) HAS_LOGICAL_RING_CONTEXTS(dev_priv)
-#define INTEL_PPGTT(dev_priv) (INTEL_INFO(dev_priv)->ppgtt)
+#define INTEL_PPGTT_BITS(dev_priv) (INTEL_INFO(dev_priv)->ppgtt_bits)
#define HAS_PPGTT(dev_priv) \
- (INTEL_PPGTT(dev_priv) != INTEL_PPGTT_NONE)
+ (INTEL_PPGTT_BITS(dev_priv) != 0)
+/*
#define HAS_FULL_PPGTT(dev_priv) \
- (INTEL_PPGTT(dev_priv) >= INTEL_PPGTT_FULL)
+ (INTEL_PPGTT_BITS(dev_priv) >= 31)
+*/
#define HAS_PAGE_SIZES(dev_priv, sizes) ({ \
GEM_BUG_ON((sizes) == 0); \
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 1853e82cebd5..7bab4754b20c 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -414,7 +414,7 @@ i915_gem_create_context(struct drm_i915_private *dev_priv,
if (IS_ERR(ctx))
return ctx;
- if (HAS_FULL_PPGTT(dev_priv)) {
+ if (INTEL_GEN(dev_priv) > 6) {
struct i915_hw_ppgtt *ppgtt;
ppgtt = i915_ppgtt_create(dev_priv, file_priv);
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index e818d3c00bba..1272f7d9e915 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2861,7 +2861,7 @@ int i915_gem_init_ggtt(struct drm_i915_private *dev_priv)
/* And finally clear the reserved guard page */
ggtt->vm.clear_range(&ggtt->vm, ggtt->vm.total - PAGE_SIZE, PAGE_SIZE);
- if (INTEL_PPGTT(dev_priv) == INTEL_PPGTT_ALIASING) {
+ if (IS_GEN6(dev_priv)) {
ret = i915_gem_init_aliasing_ppgtt(dev_priv);
if (ret)
goto err;
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index fac4c69cb5db..76d3c96733b0 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -252,7 +252,6 @@ static const struct intel_device_info intel_ironlake_m_info = {
.has_llc = 1, \
.has_rc6 = 1, \
.has_rc6p = 1, \
- .ppgtt = INTEL_PPGTT_ALIASING, \
.ppgtt_bits = 31, \
GEN_DEFAULT_PIPEOFFSETS, \
GEN_DEFAULT_PAGE_SIZES, \
@@ -298,7 +297,6 @@ static const struct intel_device_info intel_sandybridge_m_gt2_info = {
.has_llc = 1, \
.has_rc6 = 1, \
.has_rc6p = 1, \
- .ppgtt = INTEL_PPGTT_FULL, \
.ppgtt_bits = 31, \
GEN_DEFAULT_PIPEOFFSETS, \
GEN_DEFAULT_PAGE_SIZES, \
@@ -352,7 +350,6 @@ static const struct intel_device_info intel_valleyview_info = {
.has_rc6 = 1,
.has_gmch_display = 1,
.has_hotplug = 1,
- .ppgtt = INTEL_PPGTT_FULL,
.ppgtt_bits = 31,
.has_snoop = true,
.has_coherent_ggtt = false,
@@ -400,7 +397,6 @@ static const struct intel_device_info intel_haswell_gt3_info = {
.page_sizes = I915_GTT_PAGE_SIZE_4K | \
I915_GTT_PAGE_SIZE_2M, \
.has_logical_ring_contexts = 1, \
- .ppgtt = INTEL_PPGTT_FULL, \
.ppgtt_bits = 48, \
.has_64bit_reloc = 1, \
.has_reset_engine = 1
@@ -445,7 +441,6 @@ static const struct intel_device_info intel_cherryview_info = {
.has_rc6 = 1,
.has_logical_ring_contexts = 1,
.has_gmch_display = 1,
- .ppgtt = INTEL_PPGTT_FULL,
.ppgtt_bits = 32,
.has_reset_engine = 1,
.has_snoop = true,
@@ -522,7 +517,6 @@ static const struct intel_device_info intel_skylake_gt4_info = {
.has_logical_ring_contexts = 1, \
.has_logical_ring_preemption = 1, \
.has_guc = 1, \
- .ppgtt = INTEL_PPGTT_FULL, \
.ppgtt_bits = 48, \
.has_reset_engine = 1, \
.has_snoop = true, \
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 3e873c2e0220..570fc4720b10 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -857,7 +857,7 @@ void intel_device_info_runtime_init(struct intel_device_info *info)
if (IS_GEN6(dev_priv) && intel_vtd_active()) {
DRM_INFO("Disabling ppGTT for VT-d support\n");
- info->ppgtt = INTEL_PPGTT_NONE;
+ info->ppgtt_bits = 0;
}
/* Initialize command stream timestamp frequency */
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index dc60be4b1435..a7f29cf098d9 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -76,12 +76,6 @@ enum intel_platform {
INTEL_MAX_PLATFORMS
};
-enum intel_ppgtt {
- INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
- INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
- INTEL_PPGTT_FULL = I915_GEM_PPGTT_FULL,
-};
-
#define DEV_INFO_FOR_EACH_FLAG(func) \
func(is_mobile); \
func(is_lp); \
@@ -159,7 +153,6 @@ struct intel_device_info {
enum intel_platform platform;
u32 platform_mask;
- enum intel_ppgtt ppgtt;
unsigned int page_sizes; /* page sizes supported by the HW */
u32 display_mmio_offset;
@@ -189,7 +182,7 @@ struct intel_device_info {
u16 gamma_lut_size;
} color;
- /* Full PPGTT address range size */
+ /* PPGTT address range size in number of bits */
int ppgtt_bits;
};
diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
index 95abf8475464..11973452fed6 100644
--- a/drivers/gpu/drm/i915/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
@@ -1696,8 +1696,8 @@ int i915_gem_huge_page_mock_selftests(void)
if (!dev_priv)
return -ENOMEM;
- /* Pretend to be a device which supports the 48b PPGTT */
- mkwrite_device_info(dev_priv)->ppgtt = INTEL_PPGTT_FULL;
+ /* Pretend to be a device which supports the 63b PPGTT */
+ mkwrite_device_info(dev_priv)->ppgtt_bits = 63;
pdev = dev_priv->drm.pdev;
dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(39));
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index 4365979d8222..e63ee21c2317 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -351,7 +351,7 @@ static int igt_evict_contexts(void *arg)
* where the GTT space of the request is separate from the GGTT
* allocation required to build the request.
*/
- if (!HAS_FULL_PPGTT(i915))
+ if (INTEL_GEN(i915) <= 6)
return 0;
mutex_lock(&i915->drm.struct_mutex);
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 17b5aaaa7a50..af7309aee610 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1001,7 +1001,7 @@ static int exercise_ppgtt(struct drm_i915_private *dev_priv,
IGT_TIMEOUT(end_time);
int err;
- if (!HAS_FULL_PPGTT(dev_priv))
+ if (INTEL_GEN(dev_priv) <= 6)
return 0;
file = mock_file(dev_priv);
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-29 21:39 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 15:47 [PATCH] drm/i915: Rename full ppgtt configuration to be more generic Bob Paauwe
2018-08-31 15:51 ` Chris Wilson
2018-08-31 17:43 ` Bob Paauwe
2018-08-31 20:21 ` Rodrigo Vivi
2018-09-04 17:42 ` Bob Paauwe
2018-08-31 16:41 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-09-01 1:07 ` ✓ Fi.CI.IGT: " Patchwork
2018-09-06 20:04 ` [PATCH] drm/i915: Make 48bit full ppgtt configuration generic (v2) Bob Paauwe
2018-09-06 20:08 ` Chris Wilson
2018-09-06 20:32 ` Bob Paauwe
2018-09-06 21:12 ` Rodrigo Vivi
2018-09-06 21:10 ` Rodrigo Vivi
2018-09-07 16:29 ` Bob Paauwe
2018-09-10 17:12 ` [PATCH] drm/i915: Make 48bit full ppgtt configuration generic (v3) Bob Paauwe
2018-09-10 17:32 ` Rodrigo Vivi
2018-09-10 18:51 ` Bob Paauwe
2018-09-10 19:56 ` Chris Wilson
2018-09-10 20:34 ` Bob Paauwe
2018-09-10 20:35 ` Chris Wilson
2018-09-12 16:04 ` [PATCH] drm/i915: Make 48bit full ppgtt configuration generic (v4) Bob Paauwe
2018-09-12 16:10 ` Chris Wilson
2018-09-13 17:02 ` Bob Paauwe
2018-09-13 17:05 ` Ville Syrjälä
2018-09-13 17:12 ` Bob Paauwe
2018-09-13 17:22 ` Ville Syrjälä
2018-09-14 15:51 ` Bob Paauwe
2018-10-02 17:41 ` Chris Wilson
2018-10-02 17:39 ` [PATCH] drm/i915: Make 48bit full ppgtt configuration generic (v6) Bob Paauwe
2018-10-02 17:43 ` Chris Wilson
2018-10-08 18:14 ` [PATCH] drm/i915: Make 48bit full ppgtt configuration generic (v7) Bob Paauwe
2018-10-11 10:01 ` Chris Wilson
2018-10-29 21:39 ` [PATCH 1/3] " Bob Paauwe
2018-10-29 21:39 ` [PATCH 2/3] drm/i915: Remove HAS_4LVL_PPGTT Bob Paauwe
2018-10-29 21:39 ` Bob Paauwe [this message]
2018-10-29 21:45 ` [PATCH 3/3] drm/i915: Remove HAS_FULL_PPGTT and device_info.ppgtt enum Chris Wilson
2018-10-29 21:47 ` [PATCH 1/3] drm/i915: Make 48bit full ppgtt configuration generic (v7) Chris Wilson
2018-10-31 15:54 ` [PATCH 1/3] drm/i915: Make 48bit full ppgtt configuration generic (v8) Bob Paauwe
2018-10-31 15:54 ` [PATCH 2/3] drm/i915: Remove HAS_4LVL_PPGTT Bob Paauwe
2018-10-31 15:54 ` [PATCH 3/3] drm/i915: Remove HAS_FULL_PPGTT and device_info.ppgtt enum (v2) Bob Paauwe
2018-11-07 22:28 ` [PATCH 1/3] drm/i915: Make 48bit full ppgtt configuration generic (v9) Bob Paauwe
2018-11-07 22:28 ` [PATCH 2/3] drm/i915: Remove HAS_4LVL_PPGTT Bob Paauwe
2018-11-07 22:28 ` [PATCH 3/3] drm/i915: Remove HAS_FULL_PPGTT and device_info.ppgtt enum (v2) Bob Paauwe
2018-11-08 12:21 ` kbuild test robot
2018-11-08 8:54 ` [PATCH 1/3] drm/i915: Make 48bit full ppgtt configuration generic (v9) kbuild test robot
2018-11-08 21:56 ` [PATCH 1/3] drm/i915: Make 48bit full ppgtt configuration generic (v10) Bob Paauwe
2018-11-08 21:56 ` [PATCH 2/3] drm/i915: Remove HAS_4LVL_PPGTT Bob Paauwe
2018-11-08 21:56 ` [PATCH 3/3] drm/i915: Remove HAS_FULL_PPGTT and device_info.ppgtt enum (v2) Bob Paauwe
2018-09-06 20:16 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Rename full ppgtt configuration to be more generic (rev2) Patchwork
2018-09-06 20:35 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-06 21:25 ` ✓ Fi.CI.IGT: " Patchwork
2018-09-10 18:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Rename full ppgtt configuration to be more generic (rev3) Patchwork
2018-09-10 18:16 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-09-10 18:35 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-09-12 17:19 ` ✓ Fi.CI.BAT: success for drm/i915: Rename full ppgtt configuration to be more generic (rev4) Patchwork
2018-09-12 23:57 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-02 17:50 ` ✗ Fi.CI.SPARSE: warning for drm/i915: Rename full ppgtt configuration to be more generic (rev5) Patchwork
2018-10-02 18:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-03 8:29 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-03 9:54 ` Martin Peres
2018-10-08 18:32 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Rename full ppgtt configuration to be more generic (rev6) Patchwork
2018-10-08 18:32 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-08 18:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-08 19:45 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-07 12:59 ` ✗ Fi.CI.BAT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181029213951.544255-3-bob.j.paauwe@intel.com \
--to=bob.j.paauwe@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox