* [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS
@ 2022-03-24 17:21 Matthew Auld
2022-03-24 17:21 ` [PATCH 2/2] drm/i915/migrate: move the sanity check Matthew Auld
2022-03-25 7:16 ` [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Thomas Hellström
0 siblings, 2 replies; 6+ messages in thread
From: Matthew Auld @ 2022-03-24 17:21 UTC (permalink / raw)
To: intel-gfx; +Cc: Thomas Hellström, dri-devel, Nirmoy Das
We only need this when allocating device local-memory, where this
influences the drm_buddy. Currently there is some funny behaviour where
an "in limbo" system memory object is lacking the relevant placement
flags etc. before we first allocate the ttm_tt, leading to ttm
performing a move when not needed, since the current placement is seen
as not compatible.
Suggested-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Fixes: 2ed38cec5606 ("drm/i915: opportunistically apply ALLOC_CONTIGIOUS")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index e4a06fcf741a..97e648fa76bd 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct intel_memory_region *mr,
memset(place, 0, sizeof(*place));
place->mem_type = intel_region_to_ttm_type(mr);
+ if (mr->type == INTEL_MEMORY_SYSTEM)
+ return;
+
if (flags & I915_BO_ALLOC_CONTIGUOUS)
place->flags |= TTM_PL_FLAG_CONTIGUOUS;
if (offset != I915_BO_INVALID_OFFSET) {
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] drm/i915/migrate: move the sanity check
2022-03-24 17:21 [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Matthew Auld
@ 2022-03-24 17:21 ` Matthew Auld
2022-03-25 7:17 ` Thomas Hellström
2022-03-25 7:16 ` [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Thomas Hellström
1 sibling, 1 reply; 6+ messages in thread
From: Matthew Auld @ 2022-03-24 17:21 UTC (permalink / raw)
To: intel-gfx; +Cc: Thomas Hellström, dri-devel, Nirmoy Das
Move the sanity check that both src and dst are never both system
memory, which should never happen on discrete, and likely means we have
a bug. The only exception is on integrated where we trigger this path in
the selftests.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
---
drivers/gpu/drm/i915/gt/intel_migrate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
index 20444d6ceb3c..950fd6da146c 100644
--- a/drivers/gpu/drm/i915/gt/intel_migrate.c
+++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
@@ -530,6 +530,7 @@ intel_context_migrate_copy(struct intel_context *ce,
int err;
GEM_BUG_ON(ce->vm != ce->engine->gt->migrate.context->vm);
+ GEM_BUG_ON(IS_DGFX(ce->engine->i915) && (!src_is_lmem && !dst_is_lmem));
*out = NULL;
GEM_BUG_ON(ce->ring->size < SZ_64K);
@@ -566,8 +567,6 @@ intel_context_migrate_copy(struct intel_context *ce,
src_offset = 0;
dst_offset = CHUNK_SZ;
if (HAS_64K_PAGES(ce->engine->i915)) {
- GEM_BUG_ON(!src_is_lmem && !dst_is_lmem);
-
src_offset = 0;
dst_offset = 0;
if (src_is_lmem)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 2/2] drm/i915/migrate: move the sanity check
2022-03-24 17:21 ` [PATCH 2/2] drm/i915/migrate: move the sanity check Matthew Auld
@ 2022-03-25 7:17 ` Thomas Hellström
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Hellström @ 2022-03-25 7:17 UTC (permalink / raw)
To: Matthew Auld, intel-gfx; +Cc: Nirmoy Das, dri-devel
On 3/24/22 18:21, Matthew Auld wrote:
> Move the sanity check that both src and dst are never both system
> memory, which should never happen on discrete, and likely means we have
> a bug. The only exception is on integrated where we trigger this path in
> the selftests.
>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_migrate.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
> index 20444d6ceb3c..950fd6da146c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
> @@ -530,6 +530,7 @@ intel_context_migrate_copy(struct intel_context *ce,
> int err;
>
> GEM_BUG_ON(ce->vm != ce->engine->gt->migrate.context->vm);
> + GEM_BUG_ON(IS_DGFX(ce->engine->i915) && (!src_is_lmem && !dst_is_lmem));
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> *out = NULL;
>
> GEM_BUG_ON(ce->ring->size < SZ_64K);
> @@ -566,8 +567,6 @@ intel_context_migrate_copy(struct intel_context *ce,
> src_offset = 0;
> dst_offset = CHUNK_SZ;
> if (HAS_64K_PAGES(ce->engine->i915)) {
> - GEM_BUG_ON(!src_is_lmem && !dst_is_lmem);
> -
> src_offset = 0;
> dst_offset = 0;
> if (src_is_lmem)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS
2022-03-24 17:21 [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Matthew Auld
2022-03-24 17:21 ` [PATCH 2/2] drm/i915/migrate: move the sanity check Matthew Auld
@ 2022-03-25 7:16 ` Thomas Hellström
2022-03-25 10:03 ` Das, Nirmoy
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Hellström @ 2022-03-25 7:16 UTC (permalink / raw)
To: Matthew Auld, intel-gfx; +Cc: Nirmoy Das, dri-devel
On 3/24/22 18:21, Matthew Auld wrote:
> We only need this when allocating device local-memory, where this
> influences the drm_buddy. Currently there is some funny behaviour where
> an "in limbo" system memory object is lacking the relevant placement
> flags etc. before we first allocate the ttm_tt, leading to ttm
> performing a move when not needed, since the current placement is seen
> as not compatible.
>
> Suggested-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Fixes: 2ed38cec5606 ("drm/i915: opportunistically apply ALLOC_CONTIGIOUS")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index e4a06fcf741a..97e648fa76bd 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct intel_memory_region *mr,
> memset(place, 0, sizeof(*place));
> place->mem_type = intel_region_to_ttm_type(mr);
>
> + if (mr->type == INTEL_MEMORY_SYSTEM)
> + return;
> +
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> if (flags & I915_BO_ALLOC_CONTIGUOUS)
> place->flags |= TTM_PL_FLAG_CONTIGUOUS;
> if (offset != I915_BO_INVALID_OFFSET) {
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS
2022-03-25 7:16 ` [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Thomas Hellström
@ 2022-03-25 10:03 ` Das, Nirmoy
2022-03-25 10:05 ` [Intel-gfx] " Das, Nirmoy
0 siblings, 1 reply; 6+ messages in thread
From: Das, Nirmoy @ 2022-03-25 10:03 UTC (permalink / raw)
To: Thomas Hellström, Matthew Auld, intel-gfx; +Cc: dri-devel
On 3/25/2022 8:16 AM, Thomas Hellström wrote:
>
> On 3/24/22 18:21, Matthew Auld wrote:
>> We only need this when allocating device local-memory, where this
>> influences the drm_buddy. Currently there is some funny behaviour where
>> an "in limbo" system memory object is lacking the relevant placement
>> flags etc. before we first allocate the ttm_tt, leading to ttm
>> performing a move when not needed, since the current placement is seen
>> as not compatible.
>>
>> Suggested-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> Fixes: 2ed38cec5606 ("drm/i915: opportunistically apply
>> ALLOC_CONTIGIOUS")
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
>> ---
>> drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
>> b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
>> index e4a06fcf741a..97e648fa76bd 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
>> @@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct
>> intel_memory_region *mr,
>> memset(place, 0, sizeof(*place));
>> place->mem_type = intel_region_to_ttm_type(mr);
>> + if (mr->type == INTEL_MEMORY_SYSTEM)
>> + return;
>> +
>
> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@amd.com>
>
>> if (flags & I915_BO_ALLOC_CONTIGUOUS)
>> place->flags |= TTM_PL_FLAG_CONTIGUOUS;
>> if (offset != I915_BO_INVALID_OFFSET) {
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-03-25 10:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-24 17:21 [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Matthew Auld
2022-03-24 17:21 ` [PATCH 2/2] drm/i915/migrate: move the sanity check Matthew Auld
2022-03-25 7:17 ` Thomas Hellström
2022-03-25 7:16 ` [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS Thomas Hellström
2022-03-25 10:03 ` Das, Nirmoy
2022-03-25 10:05 ` [Intel-gfx] " Das, Nirmoy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox