From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexdeucher@gmail.com>, hongao <hongao@uniontech.com>
Cc: Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org,
lijo.lazar@amd.com, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, mario.limonciello@amd.com,
daniel@ffwll.ch, alexander.deucher@amd.com, airlied@gmail.com
Subject: Re: [PATCH] drm/amdgpu/gmc6: fix in case the PCI BAR is larger than the actual amount of vram
Date: Wed, 16 Aug 2023 11:44:48 +0200 [thread overview]
Message-ID: <fd477ce4-1726-b5a1-1826-8cc5245fcf89@gmail.com> (raw)
In-Reply-To: <CADnq5_N8nHV5ub0qf6ihU=+QKXOFfM4AnWbYmWf=EG8SbJXa8A@mail.gmail.com>
Wait a second.
This is unnecessary because we have this check in
amdgpu_gmc_vram_location():
if (mc->real_vram_size < mc->visible_vram_size)
mc->visible_vram_size = mc->real_vram_size;
Which makes sure that the visible VRAM size is never larger than the
actual size for all HW generations.
Regards,
Christian.
Am 15.08.23 um 17:50 schrieb Alex Deucher:
> Applied. Thanks!
>
> On Tue, Aug 15, 2023 at 3:13 AM hongao <hongao@uniontech.com> wrote:
>> [why]
>> limit visible_vram_size to real_vram_size in case
>> the PCI BAR is larger than the actual amount of vram.
>>
>> Signed-off-by: hongao <hongao@uniontech.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> index b7dad4e67813..c0de7496bfd1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> @@ -320,6 +320,8 @@ static int gmc_v6_0_mc_init(struct amdgpu_device *adev)
>> adev->gmc.aper_base = pci_resource_start(adev->pdev, 0);
>> adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
>> adev->gmc.visible_vram_size = adev->gmc.aper_size;
>> + if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
>> + adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
>>
>> /* set the gart size */
>> if (amdgpu_gart_size == -1) {
>> --
>> 2.20.1
>>
prev parent reply other threads:[~2023-08-16 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 6:54 hongao
2023-08-15 15:50 ` Alex Deucher
2023-08-16 9:44 ` 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=fd477ce4-1726-b5a1-1826-8cc5245fcf89@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hongao@uniontech.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@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
all inboxes | Powered by JetHome®