drm/i915: Remove i915.enable_ppgtt override
Now that we are confident in providing full-ppgtt where supported, remove the ability to override the context isolation. v2: Remove faked aliasing-ppgtt for testing as it no longer is accepted. v3: s/USES/HAS/ to match usage and reject attempts to load the module on old GVT-g setups that do not provide support for full-ppgtt. v4: Insulate ABI ppGTT values from our internal enum (later plans involve moving ppGTT depth out of the enum, thus potentially breaking ABI unless we document the current values). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Acked-by: Zhi Wang <zhi.a.wang@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180926201222.5643-1-chris@chris-wilson.co.uk
This commit is contained in:
@@ -1436,7 +1436,7 @@ static int igt_ppgtt_pin_update(void *arg)
|
||||
* huge-gtt-pages.
|
||||
*/
|
||||
|
||||
if (!USES_FULL_48BIT_PPGTT(dev_priv)) {
|
||||
if (!HAS_FULL_48BIT_PPGTT(dev_priv)) {
|
||||
pr_info("48b PPGTT not supported, skipping\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1687,10 +1687,9 @@ int i915_gem_huge_page_mock_selftests(void)
|
||||
SUBTEST(igt_mock_ppgtt_huge_fill),
|
||||
SUBTEST(igt_mock_ppgtt_64K),
|
||||
};
|
||||
int saved_ppgtt = i915_modparams.enable_ppgtt;
|
||||
struct drm_i915_private *dev_priv;
|
||||
struct pci_dev *pdev;
|
||||
struct i915_hw_ppgtt *ppgtt;
|
||||
struct pci_dev *pdev;
|
||||
int err;
|
||||
|
||||
dev_priv = mock_gem_device();
|
||||
@@ -1698,7 +1697,7 @@ int i915_gem_huge_page_mock_selftests(void)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Pretend to be a device which supports the 48b PPGTT */
|
||||
i915_modparams.enable_ppgtt = 3;
|
||||
mkwrite_device_info(dev_priv)->ppgtt = INTEL_PPGTT_FULL_4LVL;
|
||||
|
||||
pdev = dev_priv->drm.pdev;
|
||||
dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(39));
|
||||
@@ -1731,9 +1730,6 @@ out_close:
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
|
||||
i915_modparams.enable_ppgtt = saved_ppgtt;
|
||||
|
||||
drm_dev_put(&dev_priv->drm);
|
||||
|
||||
return err;
|
||||
@@ -1753,7 +1749,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv)
|
||||
struct i915_gem_context *ctx;
|
||||
int err;
|
||||
|
||||
if (!USES_PPGTT(dev_priv)) {
|
||||
if (!HAS_PPGTT(dev_priv)) {
|
||||
pr_info("PPGTT not supported, skipping live-selftests\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -535,7 +535,6 @@ static int igt_ctx_exec(void *arg)
|
||||
IGT_TIMEOUT(end_time);
|
||||
LIST_HEAD(objects);
|
||||
unsigned long ncontexts, ndwords, dw;
|
||||
bool first_shared_gtt = true;
|
||||
int err = -ENODEV;
|
||||
|
||||
/*
|
||||
@@ -561,12 +560,7 @@ static int igt_ctx_exec(void *arg)
|
||||
struct i915_gem_context *ctx;
|
||||
unsigned int id;
|
||||
|
||||
if (first_shared_gtt) {
|
||||
ctx = __create_hw_context(i915, file->driver_priv);
|
||||
first_shared_gtt = false;
|
||||
} else {
|
||||
ctx = i915_gem_create_context(i915, file->driver_priv);
|
||||
}
|
||||
ctx = i915_gem_create_context(i915, file->driver_priv);
|
||||
if (IS_ERR(ctx)) {
|
||||
err = PTR_ERR(ctx);
|
||||
goto out_unlock;
|
||||
@@ -865,33 +859,6 @@ out_unlock:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int fake_aliasing_ppgtt_enable(struct drm_i915_private *i915)
|
||||
{
|
||||
struct drm_i915_gem_object *obj;
|
||||
int err;
|
||||
|
||||
err = i915_gem_init_aliasing_ppgtt(i915);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
list_for_each_entry(obj, &i915->mm.bound_list, mm.link) {
|
||||
struct i915_vma *vma;
|
||||
|
||||
vma = i915_vma_instance(obj, &i915->ggtt.vm, NULL);
|
||||
if (IS_ERR(vma))
|
||||
continue;
|
||||
|
||||
vma->flags &= ~I915_VMA_LOCAL_BIND;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fake_aliasing_ppgtt_disable(struct drm_i915_private *i915)
|
||||
{
|
||||
i915_gem_fini_aliasing_ppgtt(i915);
|
||||
}
|
||||
|
||||
int i915_gem_context_mock_selftests(void)
|
||||
{
|
||||
static const struct i915_subtest tests[] = {
|
||||
@@ -918,31 +885,9 @@ int i915_gem_context_live_selftests(struct drm_i915_private *dev_priv)
|
||||
SUBTEST(igt_ctx_exec),
|
||||
SUBTEST(igt_ctx_readonly),
|
||||
};
|
||||
bool fake_alias = false;
|
||||
int err;
|
||||
|
||||
if (i915_terminally_wedged(&dev_priv->gpu_error))
|
||||
return 0;
|
||||
|
||||
/* Install a fake aliasing gtt for exercise */
|
||||
if (USES_PPGTT(dev_priv) && !dev_priv->mm.aliasing_ppgtt) {
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
err = fake_aliasing_ppgtt_enable(dev_priv);
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
GEM_BUG_ON(!dev_priv->mm.aliasing_ppgtt);
|
||||
fake_alias = true;
|
||||
}
|
||||
|
||||
err = i915_subtests(tests, dev_priv);
|
||||
|
||||
if (fake_alias) {
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
fake_aliasing_ppgtt_disable(dev_priv);
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
}
|
||||
|
||||
return err;
|
||||
return i915_subtests(tests, dev_priv);
|
||||
}
|
||||
|
@@ -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 (!USES_FULL_PPGTT(i915))
|
||||
if (!HAS_FULL_PPGTT(i915))
|
||||
return 0;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
|
@@ -153,7 +153,7 @@ static int igt_ppgtt_alloc(void *arg)
|
||||
|
||||
/* Allocate a ppggt and try to fill the entire range */
|
||||
|
||||
if (!USES_PPGTT(dev_priv))
|
||||
if (!HAS_PPGTT(dev_priv))
|
||||
return 0;
|
||||
|
||||
ppgtt = __hw_ppgtt_create(dev_priv);
|
||||
@@ -1001,7 +1001,7 @@ static int exercise_ppgtt(struct drm_i915_private *dev_priv,
|
||||
IGT_TIMEOUT(end_time);
|
||||
int err;
|
||||
|
||||
if (!USES_FULL_PPGTT(dev_priv))
|
||||
if (!HAS_FULL_PPGTT(dev_priv))
|
||||
return 0;
|
||||
|
||||
file = mock_file(dev_priv);
|
||||
|
Fai riferimento in un nuovo problema
Block a user