From: Samuel Pitoiset <samuel.pitoiset@gmail.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
mesa-dev@lists.freedesktop.org
Cc: ckoenig.leichtzumerken@gmail.com, Marek.Olsak@amd.com,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] amdgpu: Add R600_DEBUG flag to reserve VMID per ctx.
Date: Tue, 31 Oct 2017 16:50:43 +0100 [thread overview]
Message-ID: <078f3ca7-e108-6ce6-4e07-65d8f569eb45@gmail.com> (raw)
In-Reply-To: <1509464412-30394-1-git-send-email-andrey.grodzovsky@amd.com>
On 10/31/2017 04:40 PM, Andrey Grodzovsky wrote:
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> ---
> configure.ac | 2 +-
> src/gallium/drivers/radeon/r600_pipe_common.c | 1 +
> src/gallium/drivers/radeon/r600_pipe_common.h | 1 +
> src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 8 ++++++++
> src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 3 +++
> src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 1 +
> src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h | 1 +
> 7 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 9aa02f5..efc653a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -74,7 +74,7 @@ AC_SUBST([OPENCL_VERSION])
> # in the first entry.
> LIBDRM_REQUIRED=2.4.75
> LIBDRM_RADEON_REQUIRED=2.4.71
> -LIBDRM_AMDGPU_REQUIRED=2.4.85
> +LIBDRM_AMDGPU_REQUIRED=2.4.86
> LIBDRM_INTEL_REQUIRED=2.4.75
> LIBDRM_NVVIEUX_REQUIRED=2.4.66
> LIBDRM_NOUVEAU_REQUIRED=2.4.66
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index b77d859..3364dac 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -851,6 +851,7 @@ static const struct debug_named_value common_debug_options[] = {
> { "dpbb", DBG(DPBB), "Enable DPBB." },
> { "dfsm", DBG(DFSM), "Enable DFSM." },
> { "nooutoforder", DBG(NO_OUT_OF_ORDER), "Disable out-of-order rasterization" },
> + { "reserve_vmid", DBG(RESERVE_VMID), "Force VMID resrvation per context." },
"reservation".
Can you also explain a bit what that stuff is? :)
Thanks!
>
> DEBUG_NAMED_VALUE_END /* must be last */
> };
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
> index a7c91cb..94c8d4f 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -107,6 +107,7 @@ enum {
> DBG_NO_DISCARD_RANGE,
> DBG_NO_WC,
> DBG_CHECK_VM,
> + DBG_RESERVE_VMID,
>
> /* 3D engine options: */
> DBG_SWITCH_ON_EOP,
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> index 8f43e93..1155492 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> @@ -256,6 +256,14 @@ static struct radeon_winsys_ctx *amdgpu_ctx_create(struct radeon_winsys *ws)
> goto error_create;
> }
>
> + if (ctx->ws->reserve_vmid) {
> + r = amdgpu_vm_reserve_vmid(ctx->ctx, 0);
> + if (r) {
> + fprintf(stderr, "amdgpu: amdgpu_cs_ctx_create failed. (%i)\n", r);
> + goto error_create;
> + }
> + }
> +
> alloc_buffer.alloc_size = ctx->ws->info.gart_page_size;
> alloc_buffer.phys_alignment = ctx->ws->info.gart_page_size;
> alloc_buffer.preferred_heap = AMDGPU_GEM_DOMAIN_GTT;
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
> index 1c3d0f0..d023841 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
> @@ -162,6 +162,9 @@ static inline bool amdgpu_fence_is_syncobj(struct amdgpu_fence *fence)
> static inline void amdgpu_ctx_unref(struct amdgpu_ctx *ctx)
> {
> if (p_atomic_dec_zero(&ctx->refcount)) {
> + if (ctx->ws->reserve_vmid)
> + amdgpu_vm_unreserve_vmid(ctx->ctx, 0);
> +
> amdgpu_cs_ctx_free(ctx->ctx);
> amdgpu_bo_free(ctx->user_fence_bo);
> FREE(ctx);
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> index a210a27..b80a988 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> @@ -73,6 +73,7 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
>
> ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL;
> ws->debug_all_bos = debug_get_option_all_bos();
> + ws->reserve_vmid = strstr(debug_get_option("R600_DEBUG", ""), "reserve_vmid") != NULL;
>
> return true;
>
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
> index 8b62e2d..b4a3422 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
> @@ -81,6 +81,7 @@ struct amdgpu_winsys {
>
> bool check_vm;
> bool debug_all_bos;
> + bool reserve_vmid;
>
> /* List of all allocated buffers */
> mtx_t global_bo_list_lock;
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
next prev parent reply other threads:[~2017-10-31 15:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 15:40 [PATCH] amdgpu: Add R600_DEBUG flag to reserve VMID per ctx Andrey Grodzovsky
2017-10-31 15:50 ` Samuel Pitoiset [this message]
[not found] ` <078f3ca7-e108-6ce6-4e07-65d8f569eb45-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-31 15:56 ` Andrey Grodzovsky
2017-10-31 15:50 ` Michel Dänzer
[not found] ` <b269c18b-5520-2f26-2545-2b742ee34f2f-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-10-31 15:57 ` [Mesa-dev] " Marek Olšák
[not found] ` <CAAxE2A4SM3ZZTrN+UUw5mncdSx8e7zMiSGvEE7BgssyVrnyNyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 8:49 ` Christian König
2017-11-01 13:39 ` Marek Olšák
2017-11-01 8:43 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2017-11-02 14:50 Andrey Grodzovsky
[not found] ` <1509634239-10807-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2017-11-03 17:26 ` Marek Olšák
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=078f3ca7-e108-6ce6-4e07-65d8f569eb45@gmail.com \
--to=samuel.pitoiset@gmail.com \
--cc=Marek.Olsak@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrey.grodzovsky@amd.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=mesa-dev@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.