summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_pci.c
diff options
context:
space:
mode:
authorAnshuman Gupta <anshuman.gupta@intel.com>2023-07-18 11:07:01 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:37:35 +0300
commitb2d756199be822f4de8dd18fe4e3a939e4a06e7a (patch)
treec87ad4e243f411e1eded7e5afaa5d96820e37b8c /drivers/gpu/drm/xe/xe_pci.c
parentfddebcbf7a47d661f3eb475de0b75be11c7c3bb8 (diff)
downloadlinux-b2d756199be822f4de8dd18fe4e3a939e4a06e7a.tar.xz
drm/xe/pm: Add vram_d3cold_threshold Sysfs
Add per pci device vram_d3cold_threshold Sysfs to control the d3cold allowed knob. Adding a d3cold structure embedded in xe_device to encapsulate d3cold related stuff. v2: - Check total vram before initializing default threshold. [Riana] - Add static scope to vram_d3cold_threshold DEVICE_ATTR. [Riana] v3: - Fixed cosmetics review comment. [Riana] - Fixed CI Hook failures. - Used drmm_mutex_init(). v4: - Fixed kernel-doc warnings. v5: - Added doc explaining need for the device sysfs. [Rodrigo] - Removed TODO comment. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Riana Tauro <riana.tauro@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230718080703.239343-4-anshuman.gupta@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pci.c')
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index bc894b3546bf..74aba4f09f7d 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -738,7 +738,7 @@ static int xe_pci_runtime_suspend(struct device *dev)
pci_save_state(pdev);
- if (xe->d3cold_allowed) {
+ if (xe->d3cold.allowed) {
pci_disable_device(pdev);
pci_ignore_hotplug(pdev);
pci_set_power_state(pdev, PCI_D3cold);
@@ -761,7 +761,7 @@ static int xe_pci_runtime_resume(struct device *dev)
pci_restore_state(pdev);
- if (xe->d3cold_allowed) {
+ if (xe->d3cold.allowed) {
err = pci_enable_device(pdev);
if (err)
return err;
@@ -777,8 +777,8 @@ static int xe_pci_runtime_idle(struct device *dev)
struct pci_dev *pdev = to_pci_dev(dev);
struct xe_device *xe = pdev_to_xe_device(pdev);
- if (!xe->d3cold_capable) {
- xe->d3cold_allowed = false;
+ if (!xe->d3cold.capable) {
+ xe->d3cold.allowed = false;
} else {
/*
* TODO: d3cold should be allowed (true) if
@@ -791,7 +791,7 @@ static int xe_pci_runtime_idle(struct device *dev)
* 3. at resume, detect if we really lost power and avoid memory
* restoration if we were only up to d3cold
*/
- xe->d3cold_allowed = false;
+ xe->d3cold.allowed = false;
}
return 0;