From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Nirmoy Das <nirmoy.das@amd.com>, dri-devel@lists.freedesktop.org
Cc: Felix.Kuehling@amd.com, Christian.Koenig@amd.com,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/amdgpu: return early for preempt type BOs
Date: Mon, 28 Jun 2021 17:24:12 +0200 [thread overview]
Message-ID: <fd8b70cd-dca9-ffe8-cfb0-c7a8859b16f0@gmail.com> (raw)
In-Reply-To: <20210625172804.3193-1-nirmoy.das@amd.com>
Am 25.06.21 um 19:28 schrieb Nirmoy Das:
> Return early for AMDGPU_PL_PREEMPT BOs so that we don't pass
> wrong pointer to amdgpu_gtt_mgr_has_gart_addr() which assumes
> ttm_resource argument to be TTM_PL_TT type BO's.
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index b46726e47bce..3df06772a425 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -926,6 +926,11 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
> bo_mem->mem_type == AMDGPU_PL_OA)
> return -EINVAL;
>
> + if (bo_mem->mem_type == AMDGPU_PL_PREEMPT) {
Probably better to merge that into the if below.
E.g. if bo_mem->mem_type != TTM_PL_TT || .....
Christian.
> + gtt->offset = AMDGPU_BO_INVALID_OFFSET;
> + return 0;
> + }
> +
> if (!amdgpu_gtt_mgr_has_gart_addr(bo_mem)) {
> gtt->offset = AMDGPU_BO_INVALID_OFFSET;
> return 0;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2021-06-28 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-25 17:28 [PATCH 1/2] drm/amdgpu: return early for preempt type BOs Nirmoy Das
2021-06-25 17:28 ` [PATCH 2/2] drm/amdgpu: raise error on incorrect mem_type Nirmoy Das
2021-06-28 15:24 ` Christian König [this message]
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=fd8b70cd-dca9-ffe8-cfb0-c7a8859b16f0@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Christian.Koenig@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=nirmoy.das@amd.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