From: "Christian König" <christian.koenig@amd.com>
To: dri-devel@lists.freedesktop.org,
"Intel Graphics" <intel-gfx@lists.freedesktop.org>,
"Matthew Auld" <matthew.auld@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: Luben Tuikov <luben.tuikov@amd.com>
Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915: audit bo->resource usage
Date: Tue, 30 Aug 2022 09:33:49 +0200 [thread overview]
Message-ID: <1de21f6e-4b11-ee9b-1b54-fd67728766ad@amd.com> (raw)
In-Reply-To: <20220824142353.10293-1-luben.tuikov@amd.com>
Hi guys,
can we get an rb/acked-by for this i915 change?
Basically we are just making sure that the driver doesn't crash when
bo->resource is NULL and a bo doesn't have any backing store assigned to it.
The Intel CI seems to be happy with this change, so I'm pretty sure it
is correct.
Thanks,
Christian.
Am 24.08.22 um 16:23 schrieb Luben Tuikov:
> From: Christian König <christian.koenig@amd.com>
>
> Make sure we can at least move and alloc TT objects without backing store.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 6 ++----
> drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 2 +-
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index bc9c432edffe03..45ce2d1f754cc4 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -271,8 +271,6 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo,
> {
> struct drm_i915_private *i915 = container_of(bo->bdev, typeof(*i915),
> bdev);
> - struct ttm_resource_manager *man =
> - ttm_manager_type(bo->bdev, bo->resource->mem_type);
> struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
> unsigned long ccs_pages = 0;
> enum ttm_caching caching;
> @@ -286,8 +284,8 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo,
> if (!i915_tt)
> return NULL;
>
> - if (obj->flags & I915_BO_ALLOC_CPU_CLEAR &&
> - man->use_tt)
> + if (obj->flags & I915_BO_ALLOC_CPU_CLEAR && bo->resource &&
> + ttm_manager_type(bo->bdev, bo->resource->mem_type)->use_tt)
> page_flags |= TTM_TT_FLAG_ZERO_ALLOC;
>
> caching = i915_ttm_select_tt_caching(obj);
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> index 9a7e50534b84bb..c420d1ab605b6f 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> @@ -560,7 +560,7 @@ int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
> bool clear;
> int ret;
>
> - if (GEM_WARN_ON(!obj)) {
> + if (GEM_WARN_ON(!obj) || !bo->resource) {
> ttm_bo_move_null(bo, dst_mem);
> return 0;
> }
next prev parent reply other threads:[~2022-08-30 7:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 14:23 [Intel-gfx] [PATCH 1/3] drm/i915: audit bo->resource usage Luben Tuikov
2022-08-24 14:23 ` [Intel-gfx] [PATCH 2/3] drm/ttm: stop allocating dummy resources during BO creation Luben Tuikov
2022-08-24 14:23 ` [Intel-gfx] [PATCH 3/3] drm/ttm: stop allocating a dummy resource for pipelined gutting Luben Tuikov
2022-08-24 16:21 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915: audit bo->resource usage Patchwork
2022-08-24 16:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-08-30 7:33 ` Christian König [this message]
2022-08-30 10:45 ` [Intel-gfx] [PATCH 1/3] " Matthew Auld
2022-08-31 8:16 ` Christian König
2022-08-31 9:26 ` Matthew Auld
2022-08-31 9:38 ` Christian König
2022-08-31 10:37 ` Matthew Auld
2022-08-31 11:03 ` Christian König
2022-08-31 12:06 ` Matthew Auld
2022-08-31 12:35 ` Christian König
2022-08-31 12:50 ` Matthew Auld
2022-08-31 13:34 ` Christian König
2022-08-31 14:53 ` Matthew Auld
2022-08-31 16:32 ` Matthew Auld
2022-09-01 8:00 ` Christian König
2022-09-01 12:52 ` Matthew Auld
2022-09-01 17:48 ` Thomas Hellström
2022-09-01 8:43 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/3] drm/i915: audit bo->resource usage (rev2) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-07-12 11:46 [Intel-gfx] [PATCH 1/3] drm/i915: audit bo->resource usage Christian König
2022-07-13 10:08 ` Matthew Auld
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=1de21f6e-4b11-ee9b-1b54-fd67728766ad@amd.com \
--to=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luben.tuikov@amd.com \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@linux.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