[v4,11/11] drm/xe/vrsr: Introduce a debugfs node named vrsr_capable
Poosa, Karthik
karthik.poosa at intel.com
Tue Jun 24 11:14:48 UTC 2025
On 29-05-2025 16:46, Badal Nilawar wrote:
> Add a debugfs node named vrsr_capable to check if the device
> supports VRSR.
>
> Signed-off-by: Badal Nilawar<badal.nilawar at intel.com>
> ---
> drivers/gpu/drm/xe/xe_debugfs.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index d83cd6ed3fa8..d969a8f6d430 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -226,6 +226,23 @@ static const struct file_operations atomic_svm_timeslice_ms_fops = {
> .write = atomic_svm_timeslice_ms_set,
> };
>
> +static ssize_t vrsr_capable_show(struct file *f, char __user *ubuf,
> + size_t size, loff_t *pos)
> +{
> + struct xe_device *xe = file_inode(f)->i_private;
> + char buf[32];
> + int len = 0;
> +
> + len = scnprintf(buf, sizeof(buf), "%s\n", xe->d3cold.vrsr_capable ? "true" : "false");
> +
> + return simple_read_from_buffer(ubuf, size, pos, buf, len);
> +}
> +
> +static const struct file_operations vrsr_capable_fops = {
> + .owner = THIS_MODULE,
> + .read = vrsr_capable_show,
> +};
> +
> void xe_debugfs_register(struct xe_device *xe)
> {
> struct ttm_device *bdev = &xe->ttm;
> @@ -249,6 +266,9 @@ void xe_debugfs_register(struct xe_device *xe)
> debugfs_create_file("atomic_svm_timeslice_ms", 0600, root, xe,
> &atomic_svm_timeslice_ms_fops);
>
> + debugfs_create_file("vrsr_capable", 0400, root, xe,
> + &vrsr_capable_fops);
Instead of debugfs_create_file, you can use debugfs_create_bool here,
which will simplify the code.
> +
> for (mem_type = XE_PL_VRAM0; mem_type <= XE_PL_VRAM1; ++mem_type) {
> man = ttm_manager_type(bdev, mem_type);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20250624/e49b239c/attachment-0001.htm>
More information about the Intel-xe
mailing list