From: "Yo-Jung Leo Lin (AMD)" <Leo.Lin@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Jonathan Corbet" <corbet@lwn.net>
Cc: <amd-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<linux-doc@vger.kernel.org>, "Tsao, Anson" <anson.tsao@amd.com>,
"Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>,
"Yo-Jung Leo Lin (AMD)" <Leo.Lin@amd.com>
Subject: [PATCH v6 0/5] drm/amdgpu: add UMA carveout tuning interfaces
Date: Fri, 12 Dec 2025 15:59:12 +0800 [thread overview]
Message-ID: <20251212-vram-carveout-tuning-for-upstream-v6-0-50c02fd180c9@amd.com> (raw)
The integrated info v2.3 table in the Atom ROM exposes available
options for the VRAM carveout sizes. The carveout size can be changed
using the ATCS function code 0xA for BIOS that supports this.
Make these features available as sysfs files, so that users can set
the carveout size in a way similar to what a Windows user can do in
the "Tuning" tab in the AMD Adrenalin. The newly added sysfs files
are:
- uma/carveout_options: this a read-only file listing all available
carveout options. They are fetched from the Atom ROM on driver
initialization.
- uma/carveout: this shows the index of the currently selected option,
as shown in the uma_carveout_options. Writing a valid option index
to this file will change the carveout option on next boot.
Note that above files are created only if BIOS indicates support for
it, i.e. where the table shows non-zero UMACarveoutIndexMax.
Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
Changes in v6:
- Rename sysfs init/fini function to amdgpu_uma_sysfs_init/fini.
- Initialize sysfs interface in amdgpu_device_sys_interface_init/fini
in amdgpu_device.c, instead of amdgpu_acpi_init() in amdgpu_acpi.c
- Return early from amdgpu_uma_sysfs_init() if this is not an APU.
This avoids the failure message show up in the debug log on dGPU.
(Per talk offline with Lijo these checks combined may be sufficient.)
- Note: code changes are made only to patch 4 compared to last version.
- Rebase to latest asdn
- Link to v5: https://lore.kernel.org/r/20251205-vram-carveout-tuning-for-upstream-v5-0-1e87cf3b57be@amd.com
Changes in v5:
- Move uma_info from struct amdgpu_atcs to struct amdgpu_device.
- Move implementation of sysfs entry initialization functions from amdgpu_acpi.c
to amdgpu_device.c
- Adjust function prototypes and how they access uma_info and amdgpu_atcs in accordance
with the changes above
- Do clean up for uma_info in amdgpu_acpi_uma_option_fini() only if allocation size
setting is supported, for uma_info is initialized only when this is supported
- Link to v4: https://lore.kernel.org/r/20251201-vram-carveout-tuning-for-upstream-v4-0-9e151363b5ab@amd.com
---
Yo-Jung Leo Lin (AMD) (5):
drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask
drm/amdgpu: add helper to read UMA carveout info
drm/amdgpu: add UMA allocation setting helpers
drm/amdgpu: add UMA allocation interfaces to sysfs
Documentation/amdgpu: Add UMA carveout details
Documentation/gpu/amdgpu/driver-misc.rst | 26 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 41 ++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 47 +++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 77 ++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h | 2 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 172 +++++++++++++++++++++++
drivers/gpu/drm/amd/include/amd_acpi.h | 34 ++++-
7 files changed, 398 insertions(+), 1 deletion(-)
---
base-commit: 3925683515e93844be204381d2d5a1df5de34f31
change-id: 20251103-vram-carveout-tuning-for-upstream-1d5189688d73
Best regards,
--
Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
next reply other threads:[~2025-12-12 7:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 7:59 Yo-Jung Leo Lin (AMD) [this message]
2025-12-12 7:59 ` [PATCH v6 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
2025-12-12 7:59 ` [PATCH v6 2/5] drm/amdgpu: add helper to read UMA carveout info Yo-Jung Leo Lin (AMD)
2025-12-12 7:59 ` [PATCH v6 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
2025-12-12 7:59 ` [PATCH v6 4/5] drm/amdgpu: add UMA allocation interfaces to sysfs Yo-Jung Leo Lin (AMD)
2025-12-12 7:59 ` [PATCH v6 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
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=20251212-vram-carveout-tuning-for-upstream-v6-0-50c02fd180c9@amd.com \
--to=leo.lin@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=anson.tsao@amd.com \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=superm1@kernel.org \
--cc=tzimmermann@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).