From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Alex Deucher
<alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/3] drm/amdgpu: add smu_memory_pool_size module parameter
Date: Tue, 10 Oct 2017 18:40:46 +0200 [thread overview]
Message-ID: <4030ab29-e922-648f-aa6d-96e98fee893d@gmail.com> (raw)
In-Reply-To: <CADnq5_P4P_A4wNchSb5qk=65c-qJtnDQS+H1yZXzL4gv+qajFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Am 10.10.2017 um 18:33 schrieb Alex Deucher:
> On Tue, Oct 10, 2017 at 6:39 AM, Rex Zhu <Rex.Zhu@amd.com> wrote:
>> used to clamp system memmoy for smu debug usage.
>>
>> Change-Id: I8399f55069b8dcc05a3a79f9285744fcc8549af0
>> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +++++
>> 2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index da48f97..43fbcfe 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -132,6 +132,7 @@
>> #ifdef CONFIG_DRM_AMDGPU_CIK
>> extern int amdgpu_cik_support;
>> #endif
>> +extern uint amdgpu_smu_memory_pool_size;
>>
>> #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */
>> #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index ebcba56..d033904 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -126,6 +126,7 @@
>> int amdgpu_job_hang_limit = 0;
>> int amdgpu_lbpw = -1;
>> int amdgpu_compute_multipipe = -1;
>> +uint amdgpu_smu_memory_pool_size = 0;
>>
>> MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
>> module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
>> @@ -301,6 +302,10 @@
>> module_param_named(cik_support, amdgpu_cik_support, int, 0444);
>> #endif
>>
>> +MODULE_PARM_DESC(smu_memory_pool_size,
>> + "clamp max system memory for smu debug usage, 0 = disable,"
>> + "0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte");
>> +module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444);
> Sorry, I should have been more clear. I want to avoid adding another
> module parameter. I was thinking of a debugfs file (e.g.,
> amdgpu_smu_log_size or something like that) and if you set the file to
> 0, it would disable smu power logging and if you set it to a different
> size, it would allocate the memory and then send the smu messages to
> enable the logging. Within the debugfs handler it would check the
> size against the current gart size and return an error (-ENOMEM) if
> the gart wasn't big enough or the allocation failed.
>
> to disable:
> echo 0 > /sys/kernel/debug/dri/0/amdgpu_smu_log_size
> to enable a 64M SMU log:
> echo 64 > /sys/kernel/debug/dri/0/amdgpu_smu_log_size
Seconded, assuming that you can send the message to the SMU while it is
running that sounds like a much better approach.
You also don't need to really check the size, allocating and pinning a
buffer which is bigger than GART should fail no matter what.
Christian.
>
> Alex
>
>> static const struct pci_device_id pciidlist[] = {
>> #ifdef CONFIG_DRM_AMDGPU_SI
>> --
>> 1.9.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2017-10-10 16:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 10:39 [PATCH 1/3] drm/amdgpu: add smu_memory_pool_size module parameter Rex Zhu
[not found] ` <1507631973-14165-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2017-10-10 10:39 ` [PATCH 2/3] drm/amdgpu: validate module parameter smu_prv_buffer_size Rex Zhu
2017-10-10 10:39 ` [PATCH 3/3] drm/amd/powerplay: add new sysfs pp_alloc_mem_for_smu Rex Zhu
2017-10-10 16:33 ` [PATCH 1/3] drm/amdgpu: add smu_memory_pool_size module parameter Alex Deucher
[not found] ` <CADnq5_P4P_A4wNchSb5qk=65c-qJtnDQS+H1yZXzL4gv+qajFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-10 16:40 ` 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=4030ab29-e922-648f-aa6d-96e98fee893d@gmail.com \
--to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
--cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox