Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/amdgpu: Add Descriptions to Process Isolation and Cleaner Shader Sysfs Functions

This update adds explanations to key functions related to process
isolation and cleaner shader execution sysfs interfaces.

- `amdgpu_gfx_set_run_cleaner_shader`: Describes how to manually run a
cleaner shader, which clears the Local Data Store (LDS) and General
Purpose Registers (GPRs) to ensure data isolation between GPU workloads.

- `amdgpu_gfx_get_enforce_isolation`: Describes how to query the current
settings of the 'enforce_isolation' feature for each GPU partition.

- `amdgpu_gfx_set_enforce_isolation`: Describes how to enable or disable
process isolation for GPU partitions through the sysfs interface.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
a69f4cc2 9a826c4a

+45
+45
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
··· 1484 1484 return 0; 1485 1485 } 1486 1486 1487 + /** 1488 + * amdgpu_gfx_set_run_cleaner_shader - Execute the AMDGPU GFX Cleaner Shader 1489 + * @dev: The device structure 1490 + * @attr: The device attribute structure 1491 + * @buf: The buffer containing the input data 1492 + * @count: The size of the input data 1493 + * 1494 + * Provides the sysfs interface to manually run a cleaner shader, which is 1495 + * used to clear the GPU state between different tasks. Writing a value to the 1496 + * 'run_cleaner_shader' sysfs file triggers the cleaner shader execution. 1497 + * The value written corresponds to the partition index on multi-partition 1498 + * devices. On single-partition devices, the value should be '0'. 1499 + * 1500 + * The cleaner shader clears the Local Data Store (LDS) and General Purpose 1501 + * Registers (GPRs) to ensure data isolation between GPU workloads. 1502 + * 1503 + * Return: The number of bytes written to the sysfs file. 1504 + */ 1487 1505 static ssize_t amdgpu_gfx_set_run_cleaner_shader(struct device *dev, 1488 1506 struct device_attribute *attr, 1489 1507 const char *buf, ··· 1550 1532 return count; 1551 1533 } 1552 1534 1535 + /** 1536 + * amdgpu_gfx_get_enforce_isolation - Query AMDGPU GFX Enforce Isolation Settings 1537 + * @dev: The device structure 1538 + * @attr: The device attribute structure 1539 + * @buf: The buffer to store the output data 1540 + * 1541 + * Provides the sysfs read interface to get the current settings of the 'enforce_isolation' 1542 + * feature for each GPU partition. Reading from the 'enforce_isolation' 1543 + * sysfs file returns the isolation settings for all partitions, where '0' 1544 + * indicates disabled and '1' indicates enabled. 1545 + * 1546 + * Return: The number of bytes read from the sysfs file. 1547 + */ 1553 1548 static ssize_t amdgpu_gfx_get_enforce_isolation(struct device *dev, 1554 1549 struct device_attribute *attr, 1555 1550 char *buf) ··· 1586 1555 return size; 1587 1556 } 1588 1557 1558 + /** 1559 + * amdgpu_gfx_set_enforce_isolation - Control AMDGPU GFX Enforce Isolation 1560 + * @dev: The device structure 1561 + * @attr: The device attribute structure 1562 + * @buf: The buffer containing the input data 1563 + * @count: The size of the input data 1564 + * 1565 + * This function allows control over the 'enforce_isolation' feature, which 1566 + * serializes access to the graphics engine. Writing '1' or '0' to the 1567 + * 'enforce_isolation' sysfs file enables or disables process isolation for 1568 + * each partition. The input should specify the setting for all partitions. 1569 + * 1570 + * Return: The number of bytes written to the sysfs file. 1571 + */ 1589 1572 static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev, 1590 1573 struct device_attribute *attr, 1591 1574 const char *buf, size_t count)