summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_device_types.h
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_device_types.h
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_device_types.h')
-rw-r--r--drivers/gpu/drm/xe/xe_device_types.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 7a62c54939a9..14b15ecc5617 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -327,11 +327,27 @@ struct xe_device {
bool hold_rpm;
} mem_access;
- /** d3cold_capable: Indicates if root port is d3cold capable */
- bool d3cold_capable;
+ /** @d3cold: Encapsulate d3cold related stuff */
+ struct {
+ /** capable: Indicates if root port is d3cold capable */
+ bool capable;
+
+ /** @allowed: Indicates if d3cold is a valid device state */
+ bool allowed;
- /** @d3cold_allowed: Indicates if d3cold is a valid device state */
- bool d3cold_allowed;
+ /**
+ * @vram_threshold:
+ *
+ * This represents the permissible threshold(in megabytes)
+ * for vram save/restore. d3cold will be disallowed,
+ * when vram_usages is above or equals the threshold value
+ * to avoid the vram save/restore latency.
+ * Default threshold value is 300mb.
+ */
+ u32 vram_threshold;
+ /** @lock: protect vram_threshold */
+ struct mutex lock;
+ } d3cold;
/* For pcode */
struct mutex sb_lock;