From: Andi Shyti <andi.shyti@linux.intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>,
DRI Devel <dri-devel@lists.freedesktop.org>
Cc: "Michał Winiarski" <michal.winiarski@intel.com>,
"Andi Shyti" <andi@etezian.org>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Chris Wilson" <chris@chris-wilson.co.uk>,
"Andi Shyti" <andi.shyti@linux.intel.com>
Subject: [PATCH v8 14/16] drm/i915/selftests: Use to_gt() helper for GGTT accesses
Date: Tue, 14 Dec 2021 21:33:44 +0200 [thread overview]
Message-ID: <20211214193346.21231-15-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20211214193346.21231-1-andi.shyti@linux.intel.com>
From: Michał Winiarski <michal.winiarski@intel.com>
GGTT is currently available both through i915->ggtt and gt->ggtt, and we
eventually want to get rid of the i915->ggtt one.
Use to_gt() for all i915->ggtt accesses to help with the future
refactoring.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
drivers/gpu/drm/i915/selftests/i915_gem.c | 8 ++++----
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 6 +++---
drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem.c b/drivers/gpu/drm/i915/selftests/i915_gem.c
index b5576888cd78..1628b81d0a35 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem.c
@@ -41,7 +41,7 @@ static int switch_to_context(struct i915_gem_context *ctx)
static void trash_stolen(struct drm_i915_private *i915)
{
- struct i915_ggtt *ggtt = &i915->ggtt;
+ struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
const u64 slot = ggtt->error_capture.start;
const resource_size_t size = resource_size(&i915->dsm);
unsigned long page;
@@ -99,7 +99,7 @@ static void igt_pm_suspend(struct drm_i915_private *i915)
intel_wakeref_t wakeref;
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
- i915_ggtt_suspend(&i915->ggtt);
+ i915_ggtt_suspend(to_gt(i915)->ggtt);
i915_gem_suspend_late(i915);
}
}
@@ -109,7 +109,7 @@ static void igt_pm_hibernate(struct drm_i915_private *i915)
intel_wakeref_t wakeref;
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
- i915_ggtt_suspend(&i915->ggtt);
+ i915_ggtt_suspend(to_gt(i915)->ggtt);
i915_gem_freeze(i915);
i915_gem_freeze_late(i915);
@@ -125,7 +125,7 @@ static void igt_pm_resume(struct drm_i915_private *i915)
* that runtime-pm just works.
*/
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
- i915_ggtt_resume(&i915->ggtt);
+ i915_ggtt_resume(to_gt(i915)->ggtt);
i915_gem_resume(i915);
}
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 48123c3e1ff0..9afe7cf9d068 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1122,7 +1122,7 @@ static int exercise_ggtt(struct drm_i915_private *i915,
u64 hole_start, u64 hole_end,
unsigned long end_time))
{
- struct i915_ggtt *ggtt = &i915->ggtt;
+ struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
u64 hole_start, hole_end, last = 0;
struct drm_mm_node *node;
IGT_TIMEOUT(end_time);
@@ -1182,7 +1182,7 @@ static int igt_ggtt_page(void *arg)
const unsigned int count = PAGE_SIZE/sizeof(u32);
I915_RND_STATE(prng);
struct drm_i915_private *i915 = arg;
- struct i915_ggtt *ggtt = &i915->ggtt;
+ struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
struct drm_i915_gem_object *obj;
intel_wakeref_t wakeref;
struct drm_mm_node tmp;
@@ -2110,7 +2110,7 @@ int i915_gem_gtt_live_selftests(struct drm_i915_private *i915)
SUBTEST(igt_cs_tlb),
};
- GEM_BUG_ON(offset_in_page(i915->ggtt.vm.total));
+ GEM_BUG_ON(offset_in_page(to_gt(i915)->ggtt->vm.total));
return i915_subtests(tests, i915);
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index 92a859b34190..7f66f6d299b2 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -843,7 +843,7 @@ static struct i915_vma *empty_batch(struct drm_i915_private *i915)
intel_gt_chipset_flush(to_gt(i915));
- vma = i915_vma_instance(obj, &i915->ggtt.vm, NULL);
+ vma = i915_vma_instance(obj, &to_gt(i915)->ggtt->vm, NULL);
if (IS_ERR(vma)) {
err = PTR_ERR(vma);
goto err;
diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
index 1f10fe36619b..6ac15d3bc5bc 100644
--- a/drivers/gpu/drm/i915/selftests/i915_vma.c
+++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
@@ -967,7 +967,7 @@ static int igt_vma_remapped_gtt(void *arg)
intel_wakeref_t wakeref;
int err = 0;
- if (!i915_ggtt_has_aperture(&i915->ggtt))
+ if (!i915_ggtt_has_aperture(to_gt(i915)->ggtt))
return 0;
obj = i915_gem_object_create_internal(i915, 10 * 10 * PAGE_SIZE);
diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 8aa7b1d33865..0b469ae0f474 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -69,7 +69,7 @@ static void mock_device_release(struct drm_device *dev)
i915_gem_drain_workqueue(i915);
i915_gem_drain_freed_objects(i915);
- mock_fini_ggtt(&i915->ggtt);
+ mock_fini_ggtt(to_gt(i915)->ggtt);
destroy_workqueue(i915->wq);
intel_region_ttm_device_fini(i915);
--
2.34.1
next prev parent reply other threads:[~2021-12-14 19:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 19:33 [PATCH v8 00/16] More preparation for multi gt patches Andi Shyti
2021-12-14 19:33 ` [PATCH v8 01/16] drm/i915: Store backpointer to GT in uncore Andi Shyti
2021-12-14 19:33 ` [PATCH v8 02/16] drm/i915: Introduce to_gt() helper Andi Shyti
2021-12-14 19:33 ` [PATCH v8 03/16] drm/i915/display: Use " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 04/16] drm/i915/gt: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 05/16] drm/i915/gem: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 06/16] drm/i915/gvt: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 07/16] drm/i915/selftests: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 08/16] drm/i915/pxp: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 09/16] drm/i915: " Andi Shyti
2021-12-14 19:33 ` [PATCH v8 10/16] drm/i915: Rename i915->gt to i915->gt0 Andi Shyti
2021-12-14 19:33 ` [PATCH v8 11/16] drm/i915/gem: Use to_gt() helper for GGTT accesses Andi Shyti
2021-12-17 0:41 ` Sundaresan, Sujaritha
2021-12-18 4:44 ` Matt Roper
2021-12-14 19:33 ` [PATCH v8 12/16] drm/i915/display: " Andi Shyti
2021-12-16 23:13 ` [Intel-gfx] " Sundaresan, Sujaritha
2021-12-18 4:45 ` Matt Roper
2021-12-14 19:33 ` [PATCH v8 13/16] drm/i915/gt: " Andi Shyti
2021-12-16 23:12 ` [Intel-gfx] " Sundaresan, Sujaritha
2021-12-18 4:46 ` Matt Roper
2021-12-14 19:33 ` Andi Shyti [this message]
2021-12-16 23:11 ` [Intel-gfx] [PATCH v8 14/16] drm/i915/selftests: " Sundaresan, Sujaritha
2021-12-18 4:49 ` Matt Roper
2021-12-14 19:33 ` [PATCH v8 15/16] drm/i915: " Andi Shyti
2021-12-18 4:54 ` Matt Roper
2021-12-18 13:49 ` Andi Shyti
2021-12-14 19:33 ` [PATCH v8 16/16] drm/i915: Remove unused i915->ggtt Andi Shyti
2021-12-16 21:26 ` [Intel-gfx] " Sundaresan, Sujaritha
2021-12-18 5:05 ` Matt Roper
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=20211214193346.21231-15-andi.shyti@linux.intel.com \
--to=andi.shyti@linux.intel.com \
--cc=andi@etezian.org \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=michal.winiarski@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).