[Intel-xe] [PATCH] drm/xe/pm: Add vram_d3cold_threshold for d3cold capable device

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Aug 2 13:16:13 UTC 2023


On Wed, Aug 02, 2023 at 12:34:49PM +0530, Anshuman Gupta wrote:
> 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 <rodrigo.vivi at intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_pm.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 8bb8e154e5f8..0f06d8304e17 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -165,8 +165,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);
>  }
> -- 
> 2.38.0
> 


More information about the Intel-xe mailing list