public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces
@ 2025-11-03  7:51 Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

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>
---
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              |   7 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c         |  47 ++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 144 +++++++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c |  75 ++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |   1 +
 drivers/gpu/drm/amd/amdgpu/atom.h                |   4 +
 drivers/gpu/drm/amd/include/amd_acpi.h           |  34 +++++-
 8 files changed, 330 insertions(+), 8 deletions(-)
---
base-commit: ac9914fa72a5a917bb61c5e87bee6b8f9b751f33
change-id: 20251103-vram-carveout-tuning-for-upstream-1d5189688d73

Best regards,
-- 
Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask
  2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
@ 2025-11-03  7:51 ` Yo-Jung Leo Lin (AMD)
  2025-11-03 21:23   ` Alex Deucher
  2025-11-03  7:51 ` [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info Yo-Jung Leo Lin (AMD)
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

The capabilities of getting and setting VRAM carveout size are exposed
in the ATCS mask. Parse and store these capabilities for future use.

Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 ++++
 drivers/gpu/drm/amd/include/amd_acpi.h   | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 6c62e27b9800..0743fd8620e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -116,7 +116,9 @@ struct amdgpu_atcs_functions {
 	bool pcie_perf_req;
 	bool pcie_dev_rdy;
 	bool pcie_bus_width;
+	bool get_uma_size;
 	bool power_shift_control;
+	bool set_uma_allocation_size;
 };
 
 struct amdgpu_atcs {
@@ -588,7 +590,9 @@ static void amdgpu_atcs_parse_functions(struct amdgpu_atcs_functions *f, u32 mas
 	f->pcie_perf_req = mask & ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED;
 	f->pcie_dev_rdy = mask & ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED;
 	f->pcie_bus_width = mask & ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED;
+	f->get_uma_size = mask & ACPI_ATCS_GET_UMA_SIZE_SUPPORTED;
 	f->power_shift_control = mask & ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED;
+	f->set_uma_allocation_size = mask & ACPI_ATCS_SET_UMA_ALLOCATION_SIZE_SUPPORTED;
 }
 
 /**
diff --git a/drivers/gpu/drm/amd/include/amd_acpi.h b/drivers/gpu/drm/amd/include/amd_acpi.h
index 06badbf0c5b9..e582339e8e8e 100644
--- a/drivers/gpu/drm/amd/include/amd_acpi.h
+++ b/drivers/gpu/drm/amd/include/amd_acpi.h
@@ -427,7 +427,9 @@ struct atcs_pwr_shift_input {
 #       define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED             (1 << 1)
 #       define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED       (1 << 2)
 #       define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED                   (1 << 3)
-#       define ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED		   (1 << 7)
+#       define ACPI_ATCS_GET_UMA_SIZE_SUPPORTED                    (1 << 5)
+#       define ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED              (1 << 7)
+#       define ACPI_ATCS_SET_UMA_ALLOCATION_SIZE_SUPPORTED         (1 << 9)
 #define ATCS_FUNCTION_GET_EXTERNAL_STATE                           0x1
 /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE
  * ARG1: none

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info
  2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
@ 2025-11-03  7:51 ` Yo-Jung Leo Lin (AMD)
  2025-11-03 21:22   ` Alex Deucher
  2025-11-03  7:51 ` [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

Currently, the available UMA allocation configs in the integrated system
information table have not been parsed. Add a helper function to retrieve
and store these configs.

Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 32 ++++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 75 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  1 +
 drivers/gpu/drm/amd/amdgpu/atom.h                |  4 ++
 4 files changed, 107 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 763f2b8dcf13..58cc3bc9d42d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -28,6 +28,7 @@
 #include "amdgpu.h"
 #include "amdgpu_atombios.h"
 #include "amdgpu_atomfirmware.h"
+#include "atomfirmware.h"
 #include "amdgpu_i2c.h"
 #include "amdgpu_display.h"
 
@@ -1877,6 +1878,10 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
 	if (adev->mode_info.atom_context) {
 		kfree(adev->mode_info.atom_context->scratch);
 		kfree(adev->mode_info.atom_context->iio);
+		kfree(adev->mode_info.atom_context->uma_carveout_options);
+		adev->mode_info.atom_context->uma_carveout_options = NULL;
+		adev->mode_info.atom_context->uma_carveout_nr = 0;
+		adev->mode_info.atom_context->uma_carveout_index = 0;
 	}
 	kfree(adev->mode_info.atom_context);
 	adev->mode_info.atom_context = NULL;
@@ -1891,16 +1896,19 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
  *
  * Initializes the driver info and register access callbacks for the
  * ATOM interpreter (r4xx+).
- * Returns 0 on sucess, -ENOMEM on failure.
+ * Returns 0 on success, -ENOMEM on memory allocation error, or -EINVAL on ATOM ROM parsing error
  * Called at driver startup.
  */
 int amdgpu_atombios_init(struct amdgpu_device *adev)
 {
 	struct card_info *atom_card_info =
 	    kzalloc(sizeof(struct card_info), GFP_KERNEL);
+	int rc;
 
-	if (!atom_card_info)
-		return -ENOMEM;
+	if (!atom_card_info) {
+		rc = -ENOMEM;
+		goto out_card_info;
+	}
 
 	adev->mode_info.atom_card_info = atom_card_info;
 	atom_card_info->dev = adev_to_drm(adev);
@@ -1913,8 +1921,16 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
 
 	adev->mode_info.atom_context = amdgpu_atom_parse(atom_card_info, adev->bios);
 	if (!adev->mode_info.atom_context) {
-		amdgpu_atombios_fini(adev);
-		return -ENOMEM;
+		rc = -ENOMEM;
+		goto out_atom_ctx;
+	}
+
+	rc = amdgpu_atomfirmware_get_uma_carveout_info(adev);
+
+	if (rc) {
+		drm_dbg(adev_to_drm(adev), "Failed to get UMA carveout info: %d\n", rc);
+		if (rc != -ENODEV)
+			goto out_uma_info;
 	}
 
 	mutex_init(&adev->mode_info.atom_context->mutex);
@@ -1930,6 +1946,12 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
 	}
 
 	return 0;
+
+out_uma_info:
+out_atom_ctx:
+	amdgpu_atombios_fini(adev);
+out_card_info:
+	return rc;
 }
 
 int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index 636385c80f64..698416e84f1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -21,12 +21,14 @@
  *
  */
 
+#include "linux/slab.h"
 #include <drm/amdgpu_drm.h>
 #include "amdgpu.h"
 #include "atomfirmware.h"
 #include "amdgpu_atomfirmware.h"
 #include "atom.h"
 #include "atombios.h"
+#include "atomfirmware.h"
 #include "soc15_hw_ip.h"
 
 union firmware_info {
@@ -296,6 +298,79 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
 	return vram_type;
 }
 
+static int __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(struct amdgpu_device *adev,
+							    union igp_info *igp_info)
+{
+	struct atom_context *ctx = adev->mode_info.atom_context;
+	struct uma_carveout_option *opts;
+
+	opts = kzalloc(sizeof(igp_info->v23.UMASizeControlOption), GFP_KERNEL);
+
+	if (!opts)
+		goto out_mem;
+
+	memcpy(opts, igp_info->v23.UMASizeControlOption,
+		sizeof(igp_info->v23.UMASizeControlOption));
+
+	ctx->uma_carveout_index = igp_info->v23.UMACarveoutIndex;
+	ctx->uma_carveout_nr = igp_info->v23.UMACarveoutIndexMax;
+	ctx->uma_carveout_options = opts;
+
+	return 0;
+
+out_mem:
+	return -ENOMEM;
+}
+
+static int __amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev,
+						       u8 frev, u8 crev,
+						       union igp_info *igp_info)
+{
+	switch (frev) {
+	case 2:
+		switch (crev) {
+		case 3:
+			return __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(adev, igp_info);
+		break;
+		default:
+			break;
+		}
+		break;
+	default:
+		break;
+	}
+	return -ENODEV;
+}
+
+int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev)
+{
+	struct amdgpu_mode_info *mode_info = &adev->mode_info;
+	union igp_info *igp_info;
+	u16 data_offset, size;
+	u8 frev, crev;
+	int index;
+
+	if (!(adev->flags & AMD_IS_APU))
+		return -ENODEV;
+
+	if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
+		return -ENODEV;
+
+	index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
+					    integratedsysteminfo);
+
+	if (!amdgpu_atom_parse_data_header(mode_info->atom_context,
+					  index, &size,
+					  &frev, &crev, &data_offset)) {
+		return -EINVAL;
+	}
+
+	igp_info = (union igp_info *)
+			(mode_info->atom_context->bios + data_offset);
+
+	return __amdgpu_atomfirmware_get_uma_carveout_info(adev, frev, crev, igp_info);
+}
+
 int
 amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
 				  int *vram_width, int *vram_type,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
index 649b5530d8ae..fb3f34a36569 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
@@ -32,6 +32,7 @@ void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
 int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
 	int *vram_width, int *vram_type, int *vram_vendor);
+int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev);
 int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
 int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
 bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h b/drivers/gpu/drm/amd/amdgpu/atom.h
index 825ff28731f5..f07c612f0386 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.h
+++ b/drivers/gpu/drm/amd/amdgpu/atom.h
@@ -153,6 +153,10 @@ struct atom_context {
 	uint8_t vbios_ver_str[STRLEN_NORMAL];
 	uint8_t date[STRLEN_NORMAL];
 	uint8_t build_num[STRLEN_NORMAL];
+
+	uint8_t uma_carveout_index;
+	uint8_t uma_carveout_nr;
+	struct uma_carveout_option *uma_carveout_options;
 };
 
 extern int amdgpu_atom_debug;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers
  2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info Yo-Jung Leo Lin (AMD)
@ 2025-11-03  7:51 ` Yo-Jung Leo Lin (AMD)
  2025-11-03 21:31   ` Alex Deucher
  2025-11-06  4:05   ` kernel test robot
  2025-11-03  7:51 ` [PATCH 4/5] drm/amdgpu: add UMA allocation interfaces to sysfs Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
  4 siblings, 2 replies; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

On some platforms, UMA allocation size can be set using the ATCS
methods. Add helper functions to interact with this functionality.

Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h      |  7 ++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 43 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/amd/include/amd_acpi.h   | 30 ++++++++++++++++++++++
 3 files changed, 80 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index a5574e84694b..3de520f0b5b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1686,12 +1686,14 @@ int amdgpu_acpi_init(struct amdgpu_device *adev);
 void amdgpu_acpi_fini(struct amdgpu_device *adev);
 bool amdgpu_acpi_is_pcie_performance_request_supported(struct amdgpu_device *adev);
 bool amdgpu_acpi_is_power_shift_control_supported(void);
+bool amdgpu_acpi_is_set_uma_allocation_size_supported(void);
 int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,
 						u8 perf_req, bool advertise);
 int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
 				    u8 dev_state, bool drv_state);
 int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
 				   enum amdgpu_ss ss_state);
+int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type);
 int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
 int amdgpu_acpi_get_tmr_info(struct amdgpu_device *adev, u64 *tmr_offset,
 			     u64 *tmr_size);
@@ -1720,6 +1722,7 @@ static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { re
 static inline void amdgpu_acpi_detect(void) { }
 static inline void amdgpu_acpi_release(void) { }
 static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
+static inline bool amdgpu_acpi_is_set_uma_allocation_size_supported(void) { return false; }
 static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
 						  u8 dev_state, bool drv_state) { return 0; }
 static inline int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
@@ -1727,6 +1730,10 @@ static inline int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
 {
 	return 0;
 }
+int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
+{
+	return -EINVAL;
+}
 static inline void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps) { }
 #endif
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 0743fd8620e4..d53f7b33d619 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -669,6 +669,11 @@ bool amdgpu_acpi_is_power_shift_control_supported(void)
 	return amdgpu_acpi_priv.atcs.functions.power_shift_control;
 }
 
+bool amdgpu_acpi_is_set_uma_allocation_size_supported(void)
+{
+	return amdgpu_acpi_priv.atcs.functions.set_uma_allocation_size;
+}
+
 /**
  * amdgpu_acpi_pcie_notify_device_ready
  *
@@ -909,6 +914,44 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm)
 }
 #endif
 
+/**
+ * amdgpu_acpi_set_uma_allocation_size - Set Unified Memory Architecture allocation size via ACPI
+ * @adev: Pointer to the amdgpu_device structure
+ * @index: Index specifying the UMA allocation
+ * @type: Type of UMA allocation
+ *
+ * This function configures the UMA allocation size for the specified device
+ * using ACPI methods. The allocation is determined by the provided index and type.
+ * Returns 0 on success or a negative error code on failure.
+ */
+int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
+{
+	struct atcs_set_uma_allocation_size_input atcs_input;
+	struct amdgpu_atcs *atcs = &amdgpu_acpi_priv.atcs;
+	struct acpi_buffer params;
+	union acpi_object *info;
+
+	if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
+		return -EINVAL;
+
+	atcs_input.size = sizeof(struct atcs_set_uma_allocation_size_input);
+	atcs_input.uma_size_index = index;
+	atcs_input.uma_size_type = type;
+
+	params.length = sizeof(struct atcs_set_uma_allocation_size_input);
+	params.pointer = &atcs_input;
+
+	info = amdgpu_atcs_call(atcs, ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE, &params);
+	if (!info) {
+		drm_err(adev_to_drm(adev), "ATCS UMA allocation size update failed\n");
+		return -EIO;
+	}
+
+	kfree(info);
+
+	return 0;
+}
+
 /**
  * amdgpu_acpi_get_node_id - obtain the NUMA node id for corresponding amdgpu
  * acpi device handle
diff --git a/drivers/gpu/drm/amd/include/amd_acpi.h b/drivers/gpu/drm/amd/include/amd_acpi.h
index e582339e8e8e..84933c07f720 100644
--- a/drivers/gpu/drm/amd/include/amd_acpi.h
+++ b/drivers/gpu/drm/amd/include/amd_acpi.h
@@ -24,6 +24,8 @@
 #ifndef AMD_ACPI_H
 #define AMD_ACPI_H
 
+#include <linux/types.h>
+
 #define ACPI_AC_CLASS           "ac_adapter"
 
 struct atif_verify_interface {
@@ -112,6 +114,17 @@ struct atcs_pwr_shift_input {
 	u8 drv_state;	/* 0 = operational, 1 = not operational */
 } __packed;
 
+struct atcs_get_uma_size_output {
+	u16 size;		/* structure size in bytes (includes size field) */
+	u32 uma_size_mb;	/* allocated UMA size in MB */
+} __packed;
+
+struct atcs_set_uma_allocation_size_input {
+	u16 size;		/* structure size in bytes (includes size field) */
+	u8 uma_size_index;	/* UMA size index */
+	u8 uma_size_type;	/* UMA size type */
+} __packed;
+
 /* AMD hw uses four ACPI control methods:
  * 1. ATIF
  * ARG0: (ACPI_INTEGER) function code
@@ -494,4 +507,21 @@ struct atcs_pwr_shift_input {
  * OUTPUT: none
  */
 
+#define ATCS_FUNCTION_GET_UMA_SIZE                                 0x6
+/* ARG0: ATCS_FUNCTION_GET_UMA_SIZE
+ * ARG1: none
+ * OUTPUT:
+ * WORD  - structure size in bytes (includes size field)
+ * DWORD - allocated UMA size in MB
+ */
+
+#define ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE                     0xA
+/* ARG0: ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE
+ * ARG1:
+ * WORD  - structure size in bytes (includes size field)
+ * BYTE  - UMA size index
+ * BYTE  - UMA size type
+ * OUTPUT: none
+ */
+
 #endif

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/5] drm/amdgpu: add UMA allocation interfaces to sysfs
  2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
                   ` (2 preceding siblings ...)
  2025-11-03  7:51 ` [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
@ 2025-11-03  7:51 ` Yo-Jung Leo Lin (AMD)
  2025-11-03  7:51 ` [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
  4 siblings, 0 replies; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

Add two sysfs files as interfaces to inspect or change UMA carveout
size. These files are:

- uma_carveout_options: a read-only file listing all the available
  UMA allocation options and their index.

- uma_carveout: a file that is both readable and writable. On read,
  it shows the index of the current setting. Writing a valid index
  into this file allows users to change the UMA carveout size to that
  option on the next boot.

Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 95 +++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 58cc3bc9d42d..1ebfd925b761 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1855,11 +1855,102 @@ const struct attribute_group amdgpu_vbios_version_attr_group = {
 	.is_visible = amdgpu_vbios_version_attrs_is_visible,
 };
 
+static ssize_t uma_carveout_show(struct device *dev,
+				 struct device_attribute *attr,
+				 char *buf)
+{
+	struct drm_device *ddev = dev_get_drvdata(dev);
+	struct amdgpu_device *adev = drm_to_adev(ddev);
+	struct atom_context *ctx = adev->mode_info.atom_context;
+
+	return sysfs_emit(buf, "%u\n", ctx->uma_carveout_index);
+}
+static ssize_t uma_carveout_store(struct device *dev,
+				  struct device_attribute *attr,
+				  const char *buf, size_t count)
+{
+	struct drm_device *ddev = dev_get_drvdata(dev);
+	struct amdgpu_device *adev = drm_to_adev(ddev);
+	struct atom_context *ctx = adev->mode_info.atom_context;
+	struct uma_carveout_option *opt;
+	unsigned long val;
+	uint8_t flags;
+	int r;
+
+	r = kstrtoul(buf, 10, &val);
+	if (r)
+		return r;
+
+	if (val >= ctx->uma_carveout_nr)
+		return -EINVAL;
+
+	opt = &ctx->uma_carveout_options[val];
+
+	if (!opt->uma_carveout_option_flags.flags.Auto &&
+	    !opt->uma_carveout_option_flags.flags.Custom) {
+		drm_err_once(ddev, "Option %ul not supported due to lack of Custom/Auto flag", r);
+		return -EINVAL;
+	}
+
+	flags = opt->uma_carveout_option_flags.all8;
+	flags &= ~((uint8_t)opt->uma_carveout_option_flags.flags.Custom);
+
+	r = amdgpu_acpi_set_uma_allocation_size(adev, val, flags);
+	if (r)
+		return r;
+	ctx->uma_carveout_index = val;
+
+	return count;
+}
+static DEVICE_ATTR_RW(uma_carveout);
+
+static ssize_t uma_carveout_options_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buf)
+{
+	struct drm_device *ddev = dev_get_drvdata(dev);
+	struct amdgpu_device *adev = drm_to_adev(ddev);
+	struct atom_context *ctx = adev->mode_info.atom_context;
+	ssize_t size = 0;
+
+	for (int i = 0; i < ctx->uma_carveout_nr; i++) {
+		size += sysfs_emit_at(buf, size, "%d: %s (%u GB)\n",
+				      i,
+				      ctx->uma_carveout_options[i].optionName,
+				      ctx->uma_carveout_options[i].memoryCarvedGb);
+	}
+
+	return size;
+}
+static DEVICE_ATTR_RO(uma_carveout_options);
+
+static struct attribute *amdgpu_uma_attrs[] = {
+	&dev_attr_uma_carveout.attr,
+	&dev_attr_uma_carveout_options.attr,
+	NULL
+};
+
+const struct attribute_group amdgpu_uma_attr_group = {
+	.attrs = amdgpu_uma_attrs
+};
+
 int amdgpu_atombios_sysfs_init(struct amdgpu_device *adev)
 {
-	if (adev->mode_info.atom_context)
-		return devm_device_add_group(adev->dev,
+	int r;
+
+	if (adev->mode_info.atom_context) {
+		r = devm_device_add_group(adev->dev,
 					     &amdgpu_vbios_version_attr_group);
+		if (r)
+			return r;
+	}
+	if (adev->mode_info.atom_context->uma_carveout_options &&
+	    adev->mode_info.atom_context->uma_carveout_nr) {
+		r = devm_device_add_group(adev->dev,
+					   &amdgpu_uma_attr_group);
+		if (r)
+			return r;
+	}
 
 	return 0;
 }

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details
  2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
                   ` (3 preceding siblings ...)
  2025-11-03  7:51 ` [PATCH 4/5] drm/amdgpu: add UMA allocation interfaces to sysfs Yo-Jung Leo Lin (AMD)
@ 2025-11-03  7:51 ` Yo-Jung Leo Lin (AMD)
  2025-11-03 17:45   ` Mario Limonciello (AMD) (kernel.org)
  2025-11-03 19:07   ` Randy Dunlap
  4 siblings, 2 replies; 14+ messages in thread
From: Yo-Jung Leo Lin (AMD) @ 2025-11-03  7:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

Add documentation for the uma_carveout_options and uma_carveout
attributes in sysfs

Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
---
 Documentation/gpu/amdgpu/driver-misc.rst     | 26 ++++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 17 +++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/Documentation/gpu/amdgpu/driver-misc.rst b/Documentation/gpu/amdgpu/driver-misc.rst
index 25b0c857816e..5a71fa9c6782 100644
--- a/Documentation/gpu/amdgpu/driver-misc.rst
+++ b/Documentation/gpu/amdgpu/driver-misc.rst
@@ -128,3 +128,29 @@ smartshift_bias
 
 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
    :doc: smartshift_bias
+
+UMA Carveout
+============
+
+Some versions of Atom ROM expose available options for the VRAM carveout sizes,
+and allow changes to the carveout size via the ATCS function code 0xA on supported
+BIOS implementation.
+
+For those platforms, users can use the following file to set the carveout size,
+in a way similar to what Windows users can do in the "Tuning" tab in AMD
+Adrenalin.
+
+Note that for BIOS implementations that don't support this, these files will not
+get created at all.
+
+uma_carveout_options
+--------------------
+
+.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+   :doc: uma_carveout_options
+
+uma_carveout
+--------------------
+
+.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+   :doc: uma_carveout
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 1ebfd925b761..e9f71888ce57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1855,6 +1855,17 @@ const struct attribute_group amdgpu_vbios_version_attr_group = {
 	.is_visible = amdgpu_vbios_version_attrs_is_visible,
 };
 
+/**
+ * DOC: uma_carveout
+ *
+ * This file is both readable and writable. When read, it shows the
+ * index of the current setting. Writing a valid index to this file
+ * allows users to change the UMA carveout size to the selected option
+ * on the next boot.
+ *
+ * The available options and their corresponding indices can be read
+ * from the uma_carveout_options file.
+ */
 static ssize_t uma_carveout_show(struct device *dev,
 				 struct device_attribute *attr,
 				 char *buf)
@@ -1904,6 +1915,12 @@ static ssize_t uma_carveout_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(uma_carveout);
 
+/**
+ * DOC: uma_carveout_options
+ *
+ * This is a read-only file that lists all available UMA allocation
+ * options and their corresponding indices.
+ */
 static ssize_t uma_carveout_options_show(struct device *dev,
 					 struct device_attribute *attr,
 					 char *buf)

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details
  2025-11-03  7:51 ` [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
@ 2025-11-03 17:45   ` Mario Limonciello (AMD) (kernel.org)
  2025-11-03 19:07   ` Randy Dunlap
  1 sibling, 0 replies; 14+ messages in thread
From: Mario Limonciello (AMD) (kernel.org) @ 2025-11-03 17:45 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD), Alex Deucher, Christian König,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc, anson.tsao



On 11/3/2025 1:51 AM, Yo-Jung Leo Lin (AMD) wrote:
> Add documentation for the uma_carveout_options and uma_carveout
> attributes in sysfs
> 
> Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> ---
>   Documentation/gpu/amdgpu/driver-misc.rst     | 26 ++++++++++++++++++++++++++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 17 +++++++++++++++++
>   2 files changed, 43 insertions(+)
> 
> diff --git a/Documentation/gpu/amdgpu/driver-misc.rst b/Documentation/gpu/amdgpu/driver-misc.rst
> index 25b0c857816e..5a71fa9c6782 100644
> --- a/Documentation/gpu/amdgpu/driver-misc.rst
> +++ b/Documentation/gpu/amdgpu/driver-misc.rst
> @@ -128,3 +128,29 @@ smartshift_bias
>   
>   .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
>      :doc: smartshift_bias
> +
> +UMA Carveout
> +============
> +
> +Some versions of Atom ROM expose available options for the VRAM carveout sizes,
> +and allow changes to the carveout size via the ATCS function code 0xA on supported
> +BIOS implementation.
> +
> +For those platforms, users can use the following file to set the carveout size,
> +in a way similar to what Windows users can do in the "Tuning" tab in AMD
> +Adrenalin.
> +
> +Note that for BIOS implementations that don't support this, these files will not
> +get created at all.
> +
> +uma_carveout_options
> +--------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +   :doc: uma_carveout_options
> +
> +uma_carveout
> +--------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +   :doc: uma_carveout

How do you feel about adding some sample output from a test system for 
both files?  This might make it easier for userspace to implement 
parsing it.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> index 1ebfd925b761..e9f71888ce57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> @@ -1855,6 +1855,17 @@ const struct attribute_group amdgpu_vbios_version_attr_group = {
>   	.is_visible = amdgpu_vbios_version_attrs_is_visible,
>   };
>   
> +/**
> + * DOC: uma_carveout
> + *
> + * This file is both readable and writable. When read, it shows the
> + * index of the current setting. Writing a valid index to this file
> + * allows users to change the UMA carveout size to the selected option
> + * on the next boot.
> + *
> + * The available options and their corresponding indices can be read
> + * from the uma_carveout_options file.
> + */
>   static ssize_t uma_carveout_show(struct device *dev,
>   				 struct device_attribute *attr,
>   				 char *buf)
> @@ -1904,6 +1915,12 @@ static ssize_t uma_carveout_store(struct device *dev,
>   }
>   static DEVICE_ATTR_RW(uma_carveout);
>   
> +/**
> + * DOC: uma_carveout_options
> + *
> + * This is a read-only file that lists all available UMA allocation
> + * options and their corresponding indices.
> + */
>   static ssize_t uma_carveout_options_show(struct device *dev,
>   					 struct device_attribute *attr,
>   					 char *buf)
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details
  2025-11-03  7:51 ` [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
  2025-11-03 17:45   ` Mario Limonciello (AMD) (kernel.org)
@ 2025-11-03 19:07   ` Randy Dunlap
  1 sibling, 0 replies; 14+ messages in thread
From: Randy Dunlap @ 2025-11-03 19:07 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD), Alex Deucher, Christian König,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Jonathan Corbet
  Cc: amd-gfx, dri-devel, linux-kernel, linux-doc, anson.tsao, superm1



On 11/2/25 11:51 PM, Yo-Jung Leo Lin (AMD) wrote:
> Add documentation for the uma_carveout_options and uma_carveout
> attributes in sysfs
> 
> Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> ---
>  Documentation/gpu/amdgpu/driver-misc.rst     | 26 ++++++++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 17 +++++++++++++++++
>  2 files changed, 43 insertions(+)
> 
> diff --git a/Documentation/gpu/amdgpu/driver-misc.rst b/Documentation/gpu/amdgpu/driver-misc.rst
> index 25b0c857816e..5a71fa9c6782 100644
> --- a/Documentation/gpu/amdgpu/driver-misc.rst
> +++ b/Documentation/gpu/amdgpu/driver-misc.rst
> @@ -128,3 +128,29 @@ smartshift_bias
>  
>  .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
>     :doc: smartshift_bias
> +
> +UMA Carveout
> +============
> +
> +Some versions of Atom ROM expose available options for the VRAM carveout sizes,
> +and allow changes to the carveout size via the ATCS function code 0xA on supported
> +BIOS implementation.

        implementations.

> +
> +For those platforms, users can use the following file to set the carveout size,
> +in a way similar to what Windows users can do in the "Tuning" tab in AMD
> +Adrenalin.
> +
> +Note that for BIOS implementations that don't support this, these files will not
> +get created at all.

   be created at all.
or
   exist.
or
   be present.

> +
> +uma_carveout_options
> +--------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +   :doc: uma_carveout_options
> +
> +uma_carveout
> +--------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +   :doc: uma_carveout
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> index 1ebfd925b761..e9f71888ce57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> @@ -1855,6 +1855,17 @@ const struct attribute_group amdgpu_vbios_version_attr_group = {
>  	.is_visible = amdgpu_vbios_version_attrs_is_visible,
>  };
>  
> +/**
> + * DOC: uma_carveout
> + *
> + * This file is both readable and writable. When read, it shows the
> + * index of the current setting. Writing a valid index to this file
> + * allows users to change the UMA carveout size to the selected option
> + * on the next boot.
> + *
> + * The available options and their corresponding indices can be read
> + * from the uma_carveout_options file.
> + */
>  static ssize_t uma_carveout_show(struct device *dev,
>  				 struct device_attribute *attr,
>  				 char *buf)
> @@ -1904,6 +1915,12 @@ static ssize_t uma_carveout_store(struct device *dev,
>  }
>  static DEVICE_ATTR_RW(uma_carveout);
>  
> +/**
> + * DOC: uma_carveout_options
> + *
> + * This is a read-only file that lists all available UMA allocation
> + * options and their corresponding indices.
> + */
>  static ssize_t uma_carveout_options_show(struct device *dev,
>  					 struct device_attribute *attr,
>  					 char *buf)
> 
Some examples like Mario mentioned would be nice.
-- 
~Randy


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info
  2025-11-03  7:51 ` [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info Yo-Jung Leo Lin (AMD)
@ 2025-11-03 21:22   ` Alex Deucher
  2025-11-03 21:29     ` Alex Deucher
  2025-11-04 10:21     ` Lin, Leo
  0 siblings, 2 replies; 14+ messages in thread
From: Alex Deucher @ 2025-11-03 21:22 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD)
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet, amd-gfx, dri-devel, linux-kernel, linux-doc,
	anson.tsao, superm1

On Mon, Nov 3, 2025 at 2:54 AM Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com> wrote:
>
> Currently, the available UMA allocation configs in the integrated system
> information table have not been parsed. Add a helper function to retrieve
> and store these configs.
>
> Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 32 ++++++++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 75 ++++++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  1 +
>  drivers/gpu/drm/amd/amdgpu/atom.h                |  4 ++
>  4 files changed, 107 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> index 763f2b8dcf13..58cc3bc9d42d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> @@ -28,6 +28,7 @@
>  #include "amdgpu.h"
>  #include "amdgpu_atombios.h"
>  #include "amdgpu_atomfirmware.h"
> +#include "atomfirmware.h"
>  #include "amdgpu_i2c.h"
>  #include "amdgpu_display.h"
>
> @@ -1877,6 +1878,10 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
>         if (adev->mode_info.atom_context) {
>                 kfree(adev->mode_info.atom_context->scratch);
>                 kfree(adev->mode_info.atom_context->iio);
> +               kfree(adev->mode_info.atom_context->uma_carveout_options);
> +               adev->mode_info.atom_context->uma_carveout_options = NULL;
> +               adev->mode_info.atom_context->uma_carveout_nr = 0;
> +               adev->mode_info.atom_context->uma_carveout_index = 0;
>         }
>         kfree(adev->mode_info.atom_context);
>         adev->mode_info.atom_context = NULL;
> @@ -1891,16 +1896,19 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
>   *
>   * Initializes the driver info and register access callbacks for the
>   * ATOM interpreter (r4xx+).
> - * Returns 0 on sucess, -ENOMEM on failure.
> + * Returns 0 on success, -ENOMEM on memory allocation error, or -EINVAL on ATOM ROM parsing error
>   * Called at driver startup.
>   */
>  int amdgpu_atombios_init(struct amdgpu_device *adev)
>  {
>         struct card_info *atom_card_info =
>             kzalloc(sizeof(struct card_info), GFP_KERNEL);
> +       int rc;
>
> -       if (!atom_card_info)
> -               return -ENOMEM;
> +       if (!atom_card_info) {
> +               rc = -ENOMEM;
> +               goto out_card_info;
> +       }
>
>         adev->mode_info.atom_card_info = atom_card_info;
>         atom_card_info->dev = adev_to_drm(adev);
> @@ -1913,8 +1921,16 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
>
>         adev->mode_info.atom_context = amdgpu_atom_parse(atom_card_info, adev->bios);
>         if (!adev->mode_info.atom_context) {
> -               amdgpu_atombios_fini(adev);
> -               return -ENOMEM;
> +               rc = -ENOMEM;
> +               goto out_atom_ctx;
> +       }
> +
> +       rc = amdgpu_atomfirmware_get_uma_carveout_info(adev);
> +
> +       if (rc) {
> +               drm_dbg(adev_to_drm(adev), "Failed to get UMA carveout info: %d\n", rc);
> +               if (rc != -ENODEV)
> +                       goto out_uma_info;
>         }
>
>         mutex_init(&adev->mode_info.atom_context->mutex);
> @@ -1930,6 +1946,12 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
>         }
>
>         return 0;
> +
> +out_uma_info:
> +out_atom_ctx:
> +       amdgpu_atombios_fini(adev);
> +out_card_info:
> +       return rc;
>  }
>
>  int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> index 636385c80f64..698416e84f1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> @@ -21,12 +21,14 @@
>   *
>   */
>
> +#include "linux/slab.h"
>  #include <drm/amdgpu_drm.h>
>  #include "amdgpu.h"
>  #include "atomfirmware.h"
>  #include "amdgpu_atomfirmware.h"
>  #include "atom.h"
>  #include "atombios.h"
> +#include "atomfirmware.h"
>  #include "soc15_hw_ip.h"
>
>  union firmware_info {
> @@ -296,6 +298,79 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
>         return vram_type;
>  }
>
> +static int __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(struct amdgpu_device *adev,
> +                                                           union igp_info *igp_info)
> +{
> +       struct atom_context *ctx = adev->mode_info.atom_context;
> +       struct uma_carveout_option *opts;
> +
> +       opts = kzalloc(sizeof(igp_info->v23.UMASizeControlOption), GFP_KERNEL);
> +
> +       if (!opts)
> +               goto out_mem;
> +
> +       memcpy(opts, igp_info->v23.UMASizeControlOption,
> +               sizeof(igp_info->v23.UMASizeControlOption));
> +
> +       ctx->uma_carveout_index = igp_info->v23.UMACarveoutIndex;
> +       ctx->uma_carveout_nr = igp_info->v23.UMACarveoutIndexMax;
> +       ctx->uma_carveout_options = opts;
> +
> +       return 0;
> +
> +out_mem:
> +       return -ENOMEM;
> +}
> +
> +static int __amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev,
> +                                                      u8 frev, u8 crev,
> +                                                      union igp_info *igp_info)
> +{
> +       switch (frev) {
> +       case 2:
> +               switch (crev) {
> +               case 3:
> +                       return __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(adev, igp_info);
> +               break;
> +               default:
> +                       break;
> +               }
> +               break;
> +       default:
> +               break;
> +       }
> +       return -ENODEV;
> +}

I think this function can be moved into
amdgpu_atomfirmware_get_uma_carveout_info().

> +
> +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev)
> +{
> +       struct amdgpu_mode_info *mode_info = &adev->mode_info;
> +       union igp_info *igp_info;
> +       u16 data_offset, size;
> +       u8 frev, crev;
> +       int index;
> +
> +       if (!(adev->flags & AMD_IS_APU))
> +               return -ENODEV;
> +
> +       if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
> +               return -ENODEV;
> +
> +       index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
> +                                           integratedsysteminfo);
> +
> +       if (!amdgpu_atom_parse_data_header(mode_info->atom_context,
> +                                         index, &size,
> +                                         &frev, &crev, &data_offset)) {
> +               return -EINVAL;
> +       }
> +
> +       igp_info = (union igp_info *)
> +                       (mode_info->atom_context->bios + data_offset);
> +
> +       return __amdgpu_atomfirmware_get_uma_carveout_info(adev, frev, crev, igp_info);
> +}
> +
>  int
>  amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
>                                   int *vram_width, int *vram_type,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> index 649b5530d8ae..fb3f34a36569 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> @@ -32,6 +32,7 @@ void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
>  int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
>         int *vram_width, int *vram_type, int *vram_vendor);
> +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev);
>  int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
>  int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
>  bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h b/drivers/gpu/drm/amd/amdgpu/atom.h
> index 825ff28731f5..f07c612f0386 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atom.h
> +++ b/drivers/gpu/drm/amd/amdgpu/atom.h
> @@ -153,6 +153,10 @@ struct atom_context {
>         uint8_t vbios_ver_str[STRLEN_NORMAL];
>         uint8_t date[STRLEN_NORMAL];
>         uint8_t build_num[STRLEN_NORMAL];
> +
> +       uint8_t uma_carveout_index;
> +       uint8_t uma_carveout_nr;
> +       struct uma_carveout_option *uma_carveout_options;

I don't think these really belong in the atom context.  They don't
really have anything to do with atombios.  I think it makes more sense
to do this in amdgpu_acpi_init() if atcs supports uma resizing.  If
the atcs support is present, then call the atomfirmware function to
parse the atom table and if all of that is ok, then register the sysfs
interface.

Alex


>  };
>
>  extern int amdgpu_atom_debug;
>
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask
  2025-11-03  7:51 ` [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
@ 2025-11-03 21:23   ` Alex Deucher
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2025-11-03 21:23 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD)
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet, amd-gfx, dri-devel, linux-kernel, linux-doc,
	anson.tsao, superm1

On Mon, Nov 3, 2025 at 3:01 AM Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com> wrote:
>
> The capabilities of getting and setting VRAM carveout size are exposed
> in the ATCS mask. Parse and store these capabilities for future use.
>
> Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>

This patch is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 ++++
>  drivers/gpu/drm/amd/include/amd_acpi.h   | 4 +++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 6c62e27b9800..0743fd8620e4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -116,7 +116,9 @@ struct amdgpu_atcs_functions {
>         bool pcie_perf_req;
>         bool pcie_dev_rdy;
>         bool pcie_bus_width;
> +       bool get_uma_size;
>         bool power_shift_control;
> +       bool set_uma_allocation_size;
>  };
>
>  struct amdgpu_atcs {
> @@ -588,7 +590,9 @@ static void amdgpu_atcs_parse_functions(struct amdgpu_atcs_functions *f, u32 mas
>         f->pcie_perf_req = mask & ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED;
>         f->pcie_dev_rdy = mask & ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED;
>         f->pcie_bus_width = mask & ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED;
> +       f->get_uma_size = mask & ACPI_ATCS_GET_UMA_SIZE_SUPPORTED;
>         f->power_shift_control = mask & ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED;
> +       f->set_uma_allocation_size = mask & ACPI_ATCS_SET_UMA_ALLOCATION_SIZE_SUPPORTED;
>  }
>
>  /**
> diff --git a/drivers/gpu/drm/amd/include/amd_acpi.h b/drivers/gpu/drm/amd/include/amd_acpi.h
> index 06badbf0c5b9..e582339e8e8e 100644
> --- a/drivers/gpu/drm/amd/include/amd_acpi.h
> +++ b/drivers/gpu/drm/amd/include/amd_acpi.h
> @@ -427,7 +427,9 @@ struct atcs_pwr_shift_input {
>  #       define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED             (1 << 1)
>  #       define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED       (1 << 2)
>  #       define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED                   (1 << 3)
> -#       define ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED             (1 << 7)
> +#       define ACPI_ATCS_GET_UMA_SIZE_SUPPORTED                    (1 << 5)
> +#       define ATCS_SET_POWER_SHIFT_CONTROL_SUPPORTED              (1 << 7)
> +#       define ACPI_ATCS_SET_UMA_ALLOCATION_SIZE_SUPPORTED         (1 << 9)
>  #define ATCS_FUNCTION_GET_EXTERNAL_STATE                           0x1
>  /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE
>   * ARG1: none
>
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info
  2025-11-03 21:22   ` Alex Deucher
@ 2025-11-03 21:29     ` Alex Deucher
  2025-11-04 10:21     ` Lin, Leo
  1 sibling, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2025-11-03 21:29 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD)
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet, amd-gfx, dri-devel, linux-kernel, linux-doc,
	anson.tsao, superm1

On Mon, Nov 3, 2025 at 4:22 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Mon, Nov 3, 2025 at 2:54 AM Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com> wrote:
> >
> > Currently, the available UMA allocation configs in the integrated system
> > information table have not been parsed. Add a helper function to retrieve
> > and store these configs.
> >
> > Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> > Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 32 ++++++++--
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 75 ++++++++++++++++++++++++
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  1 +
> >  drivers/gpu/drm/amd/amdgpu/atom.h                |  4 ++
> >  4 files changed, 107 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > index 763f2b8dcf13..58cc3bc9d42d 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > @@ -28,6 +28,7 @@
> >  #include "amdgpu.h"
> >  #include "amdgpu_atombios.h"
> >  #include "amdgpu_atomfirmware.h"
> > +#include "atomfirmware.h"
> >  #include "amdgpu_i2c.h"
> >  #include "amdgpu_display.h"
> >
> > @@ -1877,6 +1878,10 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
> >         if (adev->mode_info.atom_context) {
> >                 kfree(adev->mode_info.atom_context->scratch);
> >                 kfree(adev->mode_info.atom_context->iio);
> > +               kfree(adev->mode_info.atom_context->uma_carveout_options);
> > +               adev->mode_info.atom_context->uma_carveout_options = NULL;
> > +               adev->mode_info.atom_context->uma_carveout_nr = 0;
> > +               adev->mode_info.atom_context->uma_carveout_index = 0;
> >         }
> >         kfree(adev->mode_info.atom_context);
> >         adev->mode_info.atom_context = NULL;
> > @@ -1891,16 +1896,19 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev)
> >   *
> >   * Initializes the driver info and register access callbacks for the
> >   * ATOM interpreter (r4xx+).
> > - * Returns 0 on sucess, -ENOMEM on failure.
> > + * Returns 0 on success, -ENOMEM on memory allocation error, or -EINVAL on ATOM ROM parsing error
> >   * Called at driver startup.
> >   */
> >  int amdgpu_atombios_init(struct amdgpu_device *adev)
> >  {
> >         struct card_info *atom_card_info =
> >             kzalloc(sizeof(struct card_info), GFP_KERNEL);
> > +       int rc;
> >
> > -       if (!atom_card_info)
> > -               return -ENOMEM;
> > +       if (!atom_card_info) {
> > +               rc = -ENOMEM;
> > +               goto out_card_info;
> > +       }
> >
> >         adev->mode_info.atom_card_info = atom_card_info;
> >         atom_card_info->dev = adev_to_drm(adev);
> > @@ -1913,8 +1921,16 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
> >
> >         adev->mode_info.atom_context = amdgpu_atom_parse(atom_card_info, adev->bios);
> >         if (!adev->mode_info.atom_context) {
> > -               amdgpu_atombios_fini(adev);
> > -               return -ENOMEM;
> > +               rc = -ENOMEM;
> > +               goto out_atom_ctx;
> > +       }
> > +
> > +       rc = amdgpu_atomfirmware_get_uma_carveout_info(adev);
> > +
> > +       if (rc) {
> > +               drm_dbg(adev_to_drm(adev), "Failed to get UMA carveout info: %d\n", rc);
> > +               if (rc != -ENODEV)
> > +                       goto out_uma_info;
> >         }
> >
> >         mutex_init(&adev->mode_info.atom_context->mutex);
> > @@ -1930,6 +1946,12 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
> >         }
> >
> >         return 0;
> > +
> > +out_uma_info:
> > +out_atom_ctx:
> > +       amdgpu_atombios_fini(adev);
> > +out_card_info:
> > +       return rc;
> >  }
> >
> >  int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > index 636385c80f64..698416e84f1f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > @@ -21,12 +21,14 @@
> >   *
> >   */
> >
> > +#include "linux/slab.h"
> >  #include <drm/amdgpu_drm.h>
> >  #include "amdgpu.h"
> >  #include "atomfirmware.h"
> >  #include "amdgpu_atomfirmware.h"
> >  #include "atom.h"
> >  #include "atombios.h"
> > +#include "atomfirmware.h"
> >  #include "soc15_hw_ip.h"
> >
> >  union firmware_info {
> > @@ -296,6 +298,79 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
> >         return vram_type;
> >  }
> >
> > +static int __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(struct amdgpu_device *adev,
> > +                                                           union igp_info *igp_info)
> > +{
> > +       struct atom_context *ctx = adev->mode_info.atom_context;
> > +       struct uma_carveout_option *opts;
> > +
> > +       opts = kzalloc(sizeof(igp_info->v23.UMASizeControlOption), GFP_KERNEL);
> > +
> > +       if (!opts)
> > +               goto out_mem;
> > +
> > +       memcpy(opts, igp_info->v23.UMASizeControlOption,
> > +               sizeof(igp_info->v23.UMASizeControlOption));
> > +
> > +       ctx->uma_carveout_index = igp_info->v23.UMACarveoutIndex;
> > +       ctx->uma_carveout_nr = igp_info->v23.UMACarveoutIndexMax;
> > +       ctx->uma_carveout_options = opts;
> > +
> > +       return 0;
> > +
> > +out_mem:
> > +       return -ENOMEM;
> > +}
> > +
> > +static int __amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev,
> > +                                                      u8 frev, u8 crev,
> > +                                                      union igp_info *igp_info)
> > +{
> > +       switch (frev) {
> > +       case 2:
> > +               switch (crev) {
> > +               case 3:
> > +                       return __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(adev, igp_info);
> > +               break;
> > +               default:
> > +                       break;
> > +               }
> > +               break;
> > +       default:
> > +               break;
> > +       }
> > +       return -ENODEV;
> > +}
>
> I think this function can be moved into
> amdgpu_atomfirmware_get_uma_carveout_info().
>
> > +
> > +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev)
> > +{
> > +       struct amdgpu_mode_info *mode_info = &adev->mode_info;
> > +       union igp_info *igp_info;
> > +       u16 data_offset, size;
> > +       u8 frev, crev;
> > +       int index;
> > +
> > +       if (!(adev->flags & AMD_IS_APU))
> > +               return -ENODEV;
> > +
> > +       if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
> > +               return -ENODEV;
> > +
> > +       index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
> > +                                           integratedsysteminfo);
> > +
> > +       if (!amdgpu_atom_parse_data_header(mode_info->atom_context,
> > +                                         index, &size,
> > +                                         &frev, &crev, &data_offset)) {
> > +               return -EINVAL;
> > +       }
> > +
> > +       igp_info = (union igp_info *)
> > +                       (mode_info->atom_context->bios + data_offset);
> > +
> > +       return __amdgpu_atomfirmware_get_uma_carveout_info(adev, frev, crev, igp_info);
> > +}
> > +
> >  int
> >  amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
> >                                   int *vram_width, int *vram_type,
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > index 649b5530d8ae..fb3f34a36569 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > @@ -32,6 +32,7 @@ void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
> >  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
> >  int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
> >         int *vram_width, int *vram_type, int *vram_vendor);
> > +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev);
> >  int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
> >  int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
> >  bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h b/drivers/gpu/drm/amd/amdgpu/atom.h
> > index 825ff28731f5..f07c612f0386 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atom.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/atom.h
> > @@ -153,6 +153,10 @@ struct atom_context {
> >         uint8_t vbios_ver_str[STRLEN_NORMAL];
> >         uint8_t date[STRLEN_NORMAL];
> >         uint8_t build_num[STRLEN_NORMAL];
> > +
> > +       uint8_t uma_carveout_index;
> > +       uint8_t uma_carveout_nr;
> > +       struct uma_carveout_option *uma_carveout_options;
>
> I don't think these really belong in the atom context.  They don't
> really have anything to do with atombios.  I think it makes more sense
> to do this in amdgpu_acpi_init() if atcs supports uma resizing.  If
> the atcs support is present, then call the atomfirmware function to
> parse the atom table and if all of that is ok, then register the sysfs
> interface.

Also, I think it would be better to abstract struct
uma_carveout_option in case the structure changes in future vbios
tables.

Alex

>
> Alex
>
>
> >  };
> >
> >  extern int amdgpu_atom_debug;
> >
> > --
> > 2.43.0
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers
  2025-11-03  7:51 ` [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
@ 2025-11-03 21:31   ` Alex Deucher
  2025-11-06  4:05   ` kernel test robot
  1 sibling, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2025-11-03 21:31 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD)
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Jonathan Corbet, amd-gfx, dri-devel, linux-kernel, linux-doc,
	anson.tsao, superm1

On Mon, Nov 3, 2025 at 3:11 AM Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com> wrote:
>
> On some platforms, UMA allocation size can be set using the ATCS
> methods. Add helper functions to interact with this functionality.
>
> Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h      |  7 ++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 43 ++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/amd/include/amd_acpi.h   | 30 ++++++++++++++++++++++
>  3 files changed, 80 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index a5574e84694b..3de520f0b5b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1686,12 +1686,14 @@ int amdgpu_acpi_init(struct amdgpu_device *adev);
>  void amdgpu_acpi_fini(struct amdgpu_device *adev);
>  bool amdgpu_acpi_is_pcie_performance_request_supported(struct amdgpu_device *adev);
>  bool amdgpu_acpi_is_power_shift_control_supported(void);
> +bool amdgpu_acpi_is_set_uma_allocation_size_supported(void);
>  int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,
>                                                 u8 perf_req, bool advertise);
>  int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
>                                     u8 dev_state, bool drv_state);
>  int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
>                                    enum amdgpu_ss ss_state);
> +int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type);
>  int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
>  int amdgpu_acpi_get_tmr_info(struct amdgpu_device *adev, u64 *tmr_offset,
>                              u64 *tmr_size);
> @@ -1720,6 +1722,7 @@ static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { re
>  static inline void amdgpu_acpi_detect(void) { }
>  static inline void amdgpu_acpi_release(void) { }
>  static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
> +static inline bool amdgpu_acpi_is_set_uma_allocation_size_supported(void) { return false; }
>  static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
>                                                   u8 dev_state, bool drv_state) { return 0; }
>  static inline int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
> @@ -1727,6 +1730,10 @@ static inline int amdgpu_acpi_smart_shift_update(struct amdgpu_device *adev,
>  {
>         return 0;
>  }
> +int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
> +{
> +       return -EINVAL;
> +}
>  static inline void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps) { }
>  #endif
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 0743fd8620e4..d53f7b33d619 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -669,6 +669,11 @@ bool amdgpu_acpi_is_power_shift_control_supported(void)
>         return amdgpu_acpi_priv.atcs.functions.power_shift_control;
>  }
>
> +bool amdgpu_acpi_is_set_uma_allocation_size_supported(void)
> +{
> +       return amdgpu_acpi_priv.atcs.functions.set_uma_allocation_size;
> +}
> +
>  /**
>   * amdgpu_acpi_pcie_notify_device_ready
>   *
> @@ -909,6 +914,44 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm)
>  }
>  #endif
>
> +/**
> + * amdgpu_acpi_set_uma_allocation_size - Set Unified Memory Architecture allocation size via ACPI
> + * @adev: Pointer to the amdgpu_device structure
> + * @index: Index specifying the UMA allocation
> + * @type: Type of UMA allocation
> + *
> + * This function configures the UMA allocation size for the specified device
> + * using ACPI methods. The allocation is determined by the provided index and type.
> + * Returns 0 on success or a negative error code on failure.
> + */
> +int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
> +{
> +       struct atcs_set_uma_allocation_size_input atcs_input;
> +       struct amdgpu_atcs *atcs = &amdgpu_acpi_priv.atcs;
> +       struct acpi_buffer params;
> +       union acpi_object *info;
> +
> +       if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
> +               return -EINVAL;
> +
> +       atcs_input.size = sizeof(struct atcs_set_uma_allocation_size_input);
> +       atcs_input.uma_size_index = index;
> +       atcs_input.uma_size_type = type;
> +
> +       params.length = sizeof(struct atcs_set_uma_allocation_size_input);
> +       params.pointer = &atcs_input;
> +
> +       info = amdgpu_atcs_call(atcs, ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE, &params);
> +       if (!info) {
> +               drm_err(adev_to_drm(adev), "ATCS UMA allocation size update failed\n");
> +               return -EIO;
> +       }
> +
> +       kfree(info);
> +
> +       return 0;
> +}
> +
>  /**
>   * amdgpu_acpi_get_node_id - obtain the NUMA node id for corresponding amdgpu
>   * acpi device handle
> diff --git a/drivers/gpu/drm/amd/include/amd_acpi.h b/drivers/gpu/drm/amd/include/amd_acpi.h
> index e582339e8e8e..84933c07f720 100644
> --- a/drivers/gpu/drm/amd/include/amd_acpi.h
> +++ b/drivers/gpu/drm/amd/include/amd_acpi.h
> @@ -24,6 +24,8 @@
>  #ifndef AMD_ACPI_H
>  #define AMD_ACPI_H
>
> +#include <linux/types.h>
> +
>  #define ACPI_AC_CLASS           "ac_adapter"
>
>  struct atif_verify_interface {
> @@ -112,6 +114,17 @@ struct atcs_pwr_shift_input {
>         u8 drv_state;   /* 0 = operational, 1 = not operational */
>  } __packed;
>
> +struct atcs_get_uma_size_output {
> +       u16 size;               /* structure size in bytes (includes size field) */
> +       u32 uma_size_mb;        /* allocated UMA size in MB */
> +} __packed;
> +
> +struct atcs_set_uma_allocation_size_input {
> +       u16 size;               /* structure size in bytes (includes size field) */
> +       u8 uma_size_index;      /* UMA size index */
> +       u8 uma_size_type;       /* UMA size type */
> +} __packed;
> +
>  /* AMD hw uses four ACPI control methods:
>   * 1. ATIF
>   * ARG0: (ACPI_INTEGER) function code
> @@ -494,4 +507,21 @@ struct atcs_pwr_shift_input {
>   * OUTPUT: none
>   */
>
> +#define ATCS_FUNCTION_GET_UMA_SIZE                                 0x6
> +/* ARG0: ATCS_FUNCTION_GET_UMA_SIZE
> + * ARG1: none
> + * OUTPUT:
> + * WORD  - structure size in bytes (includes size field)
> + * DWORD - allocated UMA size in MB
> + */
> +
> +#define ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE                     0xA
> +/* ARG0: ATCS_FUNCTION_SET_UMA_ALLOCATION_SIZE
> + * ARG1:
> + * WORD  - structure size in bytes (includes size field)
> + * BYTE  - UMA size index
> + * BYTE  - UMA size type
> + * OUTPUT: none
> + */
> +
>  #endif
>
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info
  2025-11-03 21:22   ` Alex Deucher
  2025-11-03 21:29     ` Alex Deucher
@ 2025-11-04 10:21     ` Lin, Leo
  1 sibling, 0 replies; 14+ messages in thread
From: Lin, Leo @ 2025-11-04 10:21 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Deucher, Alexander, Koenig, Christian, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Jonathan Corbet, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, Tsao, Anson, superm1@kernel.org

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Alex Deucher <alexdeucher@gmail.com>
> Sent: Tuesday, November 4, 2025 5:22 AM
> To: Lin, Leo <Leo.Lin@amd.com>
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <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>; 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>;
> superm1@kernel.org
> Subject: Re: [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info
>
> On Mon, Nov 3, 2025 at 2:54 AM Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> wrote:
> >
> > Currently, the available UMA allocation configs in the integrated
> > system information table have not been parsed. Add a helper function
> > to retrieve and store these configs.
> >
> > Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> > Signed-off-by: Yo-Jung Leo Lin (AMD) <Leo.Lin@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 32 ++++++++--
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 75
> > ++++++++++++++++++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  1 +
> >  drivers/gpu/drm/amd/amdgpu/atom.h                |  4 ++
> >  4 files changed, 107 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > index 763f2b8dcf13..58cc3bc9d42d 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
> > @@ -28,6 +28,7 @@
> >  #include "amdgpu.h"
> >  #include "amdgpu_atombios.h"
> >  #include "amdgpu_atomfirmware.h"
> > +#include "atomfirmware.h"
> >  #include "amdgpu_i2c.h"
> >  #include "amdgpu_display.h"
> >
> > @@ -1877,6 +1878,10 @@ void amdgpu_atombios_fini(struct
> amdgpu_device *adev)
> >         if (adev->mode_info.atom_context) {
> >                 kfree(adev->mode_info.atom_context->scratch);
> >                 kfree(adev->mode_info.atom_context->iio);
> > +               kfree(adev->mode_info.atom_context->uma_carveout_options);
> > +               adev->mode_info.atom_context->uma_carveout_options = NULL;
> > +               adev->mode_info.atom_context->uma_carveout_nr = 0;
> > +               adev->mode_info.atom_context->uma_carveout_index = 0;
> >         }
> >         kfree(adev->mode_info.atom_context);
> >         adev->mode_info.atom_context = NULL; @@ -1891,16 +1896,19 @@
> > void amdgpu_atombios_fini(struct amdgpu_device *adev)
> >   *
> >   * Initializes the driver info and register access callbacks for the
> >   * ATOM interpreter (r4xx+).
> > - * Returns 0 on sucess, -ENOMEM on failure.
> > + * Returns 0 on success, -ENOMEM on memory allocation error, or
> > + -EINVAL on ATOM ROM parsing error
> >   * Called at driver startup.
> >   */
> >  int amdgpu_atombios_init(struct amdgpu_device *adev)  {
> >         struct card_info *atom_card_info =
> >             kzalloc(sizeof(struct card_info), GFP_KERNEL);
> > +       int rc;
> >
> > -       if (!atom_card_info)
> > -               return -ENOMEM;
> > +       if (!atom_card_info) {
> > +               rc = -ENOMEM;
> > +               goto out_card_info;
> > +       }
> >
> >         adev->mode_info.atom_card_info = atom_card_info;
> >         atom_card_info->dev = adev_to_drm(adev);
> > @@ -1913,8 +1921,16 @@ int amdgpu_atombios_init(struct
> amdgpu_device *adev)
> >
> >         adev->mode_info.atom_context =
> amdgpu_atom_parse(atom_card_info, adev->bios);
> >         if (!adev->mode_info.atom_context) {
> > -               amdgpu_atombios_fini(adev);
> > -               return -ENOMEM;
> > +               rc = -ENOMEM;
> > +               goto out_atom_ctx;
> > +       }
> > +
> > +       rc = amdgpu_atomfirmware_get_uma_carveout_info(adev);
> > +
> > +       if (rc) {
> > +               drm_dbg(adev_to_drm(adev), "Failed to get UMA carveout info:
> %d\n", rc);
> > +               if (rc != -ENODEV)
> > +                       goto out_uma_info;
> >         }
> >
> >         mutex_init(&adev->mode_info.atom_context->mutex);
> > @@ -1930,6 +1946,12 @@ int amdgpu_atombios_init(struct
> amdgpu_device *adev)
> >         }
> >
> >         return 0;
> > +
> > +out_uma_info:
> > +out_atom_ctx:
> > +       amdgpu_atombios_fini(adev);
> > +out_card_info:
> > +       return rc;
> >  }
> >
> >  int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > index 636385c80f64..698416e84f1f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> > @@ -21,12 +21,14 @@
> >   *
> >   */
> >
> > +#include "linux/slab.h"
> >  #include <drm/amdgpu_drm.h>
> >  #include "amdgpu.h"
> >  #include "atomfirmware.h"
> >  #include "amdgpu_atomfirmware.h"
> >  #include "atom.h"
> >  #include "atombios.h"
> > +#include "atomfirmware.h"
> >  #include "soc15_hw_ip.h"
> >
> >  union firmware_info {
> > @@ -296,6 +298,79 @@ static int
> convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
> >         return vram_type;
> >  }
> >
> > +static int __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(struct
> amdgpu_device *adev,
> > +                                                           union igp_info *igp_info)
> > +{
> > +       struct atom_context *ctx = adev->mode_info.atom_context;
> > +       struct uma_carveout_option *opts;
> > +
> > +       opts = kzalloc(sizeof(igp_info->v23.UMASizeControlOption),
> GFP_KERNEL);
> > +
> > +       if (!opts)
> > +               goto out_mem;
> > +
> > +       memcpy(opts, igp_info->v23.UMASizeControlOption,
> > +               sizeof(igp_info->v23.UMASizeControlOption));
> > +
> > +       ctx->uma_carveout_index = igp_info->v23.UMACarveoutIndex;
> > +       ctx->uma_carveout_nr = igp_info->v23.UMACarveoutIndexMax;
> > +       ctx->uma_carveout_options = opts;
> > +
> > +       return 0;
> > +
> > +out_mem:
> > +       return -ENOMEM;
> > +}
> > +
> > +static int __amdgpu_atomfirmware_get_uma_carveout_info(struct
> amdgpu_device *adev,
> > +                                                      u8 frev, u8 crev,
> > +                                                      union igp_info *igp_info)
> > +{
> > +       switch (frev) {
> > +       case 2:
> > +               switch (crev) {
> > +               case 3:
> > +                       return
> __amdgpu_atomfirmware_get_uma_carveout_info_v2_3(adev, igp_info);
> > +               break;
> > +               default:
> > +                       break;
> > +               }
> > +               break;
> > +       default:
> > +               break;
> > +       }
> > +       return -ENODEV;
> > +}
>
> I think this function can be moved into
> amdgpu_atomfirmware_get_uma_carveout_info().
>
> > +
> > +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device
> *adev)
> > +{
> > +       struct amdgpu_mode_info *mode_info = &adev->mode_info;
> > +       union igp_info *igp_info;
> > +       u16 data_offset, size;
> > +       u8 frev, crev;
> > +       int index;
> > +
> > +       if (!(adev->flags & AMD_IS_APU))
> > +               return -ENODEV;
> > +
> > +       if (!amdgpu_acpi_is_set_uma_allocation_size_supported())
> > +               return -ENODEV;
> > +
> > +       index =
> get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
> > +                                           integratedsysteminfo);
> > +
> > +       if (!amdgpu_atom_parse_data_header(mode_info->atom_context,
> > +                                         index, &size,
> > +                                         &frev, &crev, &data_offset)) {
> > +               return -EINVAL;
> > +       }
> > +
> > +       igp_info = (union igp_info *)
> > +                       (mode_info->atom_context->bios + data_offset);
> > +
> > +       return __amdgpu_atomfirmware_get_uma_carveout_info(adev, frev,
> crev, igp_info);
> > +}
> > +
> >  int
> >  amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
> >                                   int *vram_width, int *vram_type,
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > index 649b5530d8ae..fb3f34a36569 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> > @@ -32,6 +32,7 @@ void amdgpu_atomfirmware_scratch_regs_init(struct
> amdgpu_device *adev);
> >  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device
> *adev);
> >  int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
> >         int *vram_width, int *vram_type, int *vram_vendor);
> > +int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device
> *adev);
> >  int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
> >  int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
> >  bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device
> *adev);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h
> b/drivers/gpu/drm/amd/amdgpu/atom.h
> > index 825ff28731f5..f07c612f0386 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atom.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/atom.h
> > @@ -153,6 +153,10 @@ struct atom_context {
> >         uint8_t vbios_ver_str[STRLEN_NORMAL];
> >         uint8_t date[STRLEN_NORMAL];
> >         uint8_t build_num[STRLEN_NORMAL];
> > +
> > +       uint8_t uma_carveout_index;
> > +       uint8_t uma_carveout_nr;
> > +       struct uma_carveout_option *uma_carveout_options;
>
> I don't think these really belong in the atom context.  They don't
> really have anything to do with atombios.  I think it makes more sense
> to do this in amdgpu_acpi_init() if atcs supports uma resizing.  If
> the atcs support is present, then call the atomfirmware function to
> parse the atom table and if all of that is ok, then register the sysfs
> interface.
>
> Alex

Thanks for reviewing. Will refactor toward that direction in the next version.

BR,
Leo
>
>
> >  };
> >
> >  extern int amdgpu_atom_debug;
> >
> > --
> > 2.43.0
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers
  2025-11-03  7:51 ` [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
  2025-11-03 21:31   ` Alex Deucher
@ 2025-11-06  4:05   ` kernel test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-11-06  4:05 UTC (permalink / raw)
  To: Yo-Jung Leo Lin (AMD), Alex Deucher, Christian König,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Jonathan Corbet
  Cc: oe-kbuild-all, amd-gfx, dri-devel, linux-kernel, linux-doc,
	Yo-Jung Leo Lin (AMD), anson.tsao, superm1

Hi Yo-Jung,

kernel test robot noticed the following build errors:

[auto build test ERROR on ac9914fa72a5a917bb61c5e87bee6b8f9b751f33]

url:    https://github.com/intel-lab-lkp/linux/commits/Yo-Jung-Leo-Lin-AMD/drm-amdgpu-parse-UMA-size-getting-setting-bits-in-ATCS-mask/20251103-155539
base:   ac9914fa72a5a917bb61c5e87bee6b8f9b751f33
patch link:    https://lore.kernel.org/r/20251103-vram-carveout-tuning-for-upstream-v1-3-17e2a72639c5%40amd.com
patch subject: [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers
config: x86_64-buildonly-randconfig-002-20251106 (https://download.01.org/0day-ci/archive/20251106/202511061141.OaKEdSVv-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251106/202511061141.OaKEdSVv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511061141.OaKEdSVv-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/ras_sys.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras.h:27,
                    from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cmd.c:24:
>> drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:1733:5: warning: no previous prototype for 'amdgpu_acpi_set_uma_allocation_size' [-Wmissing-prototypes]
    1733 | int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c:23:
>> drivers/gpu/drm/amd/amdgpu/amdgpu.h:1733:5: warning: no previous prototype for 'amdgpu_acpi_set_uma_allocation_size' [-Wmissing-prototypes]
    1733 | int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/ras_sys.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras.h:27,
                    from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:24:
>> drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:1733:5: warning: no previous prototype for 'amdgpu_acpi_set_uma_allocation_size' [-Wmissing-prototypes]
    1733 | int amdgpu_acpi_set_uma_allocation_size(struct amdgpu_device *adev, u8 index, u8 type)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c: In function 'cper_generate_runtime_record.isra':
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:36: warning: '%llX' directive output may be truncated writing between 1 and 14 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |                                    ^~~~
   In function 'fill_section_hdr',
       inlined from 'cper_generate_runtime_record.isra' at drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:180:2:
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:32: note: directive argument in the range [0, 72057594037927935]
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |                                ^~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:9: note: 'snprintf' output between 4 and 27 bytes into a destination of size 9
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      76 |                     RAS_LOG_SEQNO_TO_BATCH_IDX(trace->seqno));
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c: In function 'cper_generate_fatal_record.isra':
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:36: warning: '%llX' directive output may be truncated writing between 1 and 14 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |                                    ^~~~
   In function 'fill_section_hdr',
       inlined from 'cper_generate_fatal_record.isra' at drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:205:3:
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:32: note: directive argument in the range [0, 72057594037927935]
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |                                ^~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_cper.c:75:9: note: 'snprintf' output between 4 and 27 bytes into a destination of size 9
      75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      76 |                     RAS_LOG_SEQNO_TO_BATCH_IDX(trace->seqno));
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_device.o: in function `amdgpu_acpi_set_uma_allocation_size':
>> amdgpu_device.c:(.text+0x11f0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_doorbell_mgr.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_kms.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_kms.c:(.text+0x1e20): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_atombios.c:(.text+0x8b0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/atombios_crtc.o: in function `amdgpu_acpi_set_uma_allocation_size':
   atombios_crtc.c:(.text+0x7d0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_connectors.c:(.text+0x1950): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/atom.o: in function `amdgpu_acpi_set_uma_allocation_size':
   atom.c:(.text+0x4400): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_fence.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_fence.c:(.text+0x3c0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ttm.c:(.text+0x28b0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_object.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_object.c:(.text+0x70): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_gart.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_gart.c:(.text+0xe0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_encoders.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_display.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_display.c:(.text+0xc90): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_i2c.c:(.text+0x830): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_gem.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_gem.c:(.text+0xab0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ring.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ring.c:(.text+0x660): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_cs.c:(.text+0x3380): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_bios.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_bios.c:(.text+0x790): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_benchmark.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/atombios_dp.o: in function `amdgpu_acpi_set_uma_allocation_size':
   atombios_dp.c:(.text+0x7e0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_afmt.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_afmt.c:(.text+0x100): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_trace_points.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_trace_points.c:(.text+0x78a0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/atombios_encoders.o: in function `amdgpu_acpi_set_uma_allocation_size':
   atombios_encoders.c:(.text+0x440): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_sa.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_sa.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/atombios_i2c.o: in function `amdgpu_acpi_set_uma_allocation_size':
   atombios_i2c.c:(.text+0x280): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_dma_buf.c:(.text+0x6c0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vm.c:(.text+0x1740): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vm_pt.c:(.text+0x830): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vm_tlb_fence.c:(.text+0x190): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ib.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ib.c:(.text+0xd0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_pll.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_pll.c:(.text+0x240): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ucode.c:(.text+0x1a80): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_bo_list.c:(.text+0x60): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ctx.c:(.text+0xca0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_sync.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_sync.c:(.text+0xc0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_gtt_mgr.c:(.text+0x410): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_preempt_mgr.c:(.text+0x100): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vram_mgr.c:(.text+0x1340): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_virt.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_virt.c:(.text+0x1800): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_atomfirmware.c:(.text+0xe0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vf_error.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_sched.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_sched.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_debugfs.c:(.text+0x4b10): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ids.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ids.c:(.text+0x560): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_gmc.c:(.text+0x3c0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_mmhub.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_hdp.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_xgmi.c:(.text+0x1a20): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_csa.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_csa.c:(.text+0x0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_ras.c:(.text+0x23a0): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here
   ld: drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.o: in function `amdgpu_acpi_set_uma_allocation_size':
   amdgpu_vm_cpu.c:(.text+0x230): multiple definition of `amdgpu_acpi_set_uma_allocation_size'; drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o:amdgpu_drv.c:(.text+0x14a0): first defined here

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-06  4:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03  7:51 [PATCH 0/5] drm/amdgpu: add UMA carveout tuning interfaces Yo-Jung Leo Lin (AMD)
2025-11-03  7:51 ` [PATCH 1/5] drm/amdgpu: parse UMA size-getting/setting bits in ATCS mask Yo-Jung Leo Lin (AMD)
2025-11-03 21:23   ` Alex Deucher
2025-11-03  7:51 ` [PATCH 2/5] drm/amdgpu: add helper to read UMA carveout info Yo-Jung Leo Lin (AMD)
2025-11-03 21:22   ` Alex Deucher
2025-11-03 21:29     ` Alex Deucher
2025-11-04 10:21     ` Lin, Leo
2025-11-03  7:51 ` [PATCH 3/5] drm/amdgpu: add UMA allocation setting helpers Yo-Jung Leo Lin (AMD)
2025-11-03 21:31   ` Alex Deucher
2025-11-06  4:05   ` kernel test robot
2025-11-03  7:51 ` [PATCH 4/5] drm/amdgpu: add UMA allocation interfaces to sysfs Yo-Jung Leo Lin (AMD)
2025-11-03  7:51 ` [PATCH 5/5] Documentation/amdgpu: Add UMA carveout details Yo-Jung Leo Lin (AMD)
2025-11-03 17:45   ` Mario Limonciello (AMD) (kernel.org)
2025-11-03 19:07   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox