From: Anshuman Gupta Date: Wed, 2 Aug 2023 07:04:49 +0000 (+0530) Subject: drm/xe/pm: Add vram_d3cold_threshold for d3cold capable device X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3d4b0bfcd97fbb43d4848bafbf605f6d95afa7c8;p=linux.git drm/xe/pm: Add vram_d3cold_threshold for d3cold capable device Do not register vram_d3cold_threshold device sysfs universally for each gfx device, only register sysfs and set the threshold value for d3cold capable devices. Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Rodrigo Vivi Link: https://lore.kernel.org/all/20230802070449.2426563-1-anshuman.gupta@intel.com/ Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index cdde0d87fd9f4..5e992e62d0fb8 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -154,8 +154,11 @@ void xe_pm_init(struct xe_device *xe) drmm_mutex_init(&xe->drm, &xe->d3cold.lock); xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev); - xe_device_sysfs_init(xe); - xe_pm_set_vram_threshold(xe, DEFAULT_VRAM_THRESHOLD); + + if (xe->d3cold.capable) { + xe_device_sysfs_init(xe); + xe_pm_set_vram_threshold(xe, DEFAULT_VRAM_THRESHOLD); + } xe_pm_runtime_init(xe); }