summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_pm.c
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2024-02-22 19:39:26 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-02-26 17:05:22 +0300
commit23cf006beac3db89f946a52c962cd16c82066c5c (patch)
treed0c0b7f34e553315b2ea9821a9c9b1c05b3873b3 /drivers/gpu/drm/xe/xe_pm.c
parent0f9d886f0bf93394b09b1dfe5397f7842c0f48b9 (diff)
downloadlinux-23cf006beac3db89f946a52c962cd16c82066c5c.tar.xz
drm/xe: Runtime PM wake on every IOCTL
Let's ensure our PCI device is awaken on every IOCTL entry. Let's increase the runtime_pm protection and start moving that to the outer bounds. v2: minor typo fix and renaming function to make it clear that is intended to be used by ioctl only. (Matt) v3: Make it NULL if CONFIG_COMPAT is not selected. Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240222163937.138342-3-rodrigo.vivi@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pm.c')
-rw-r--r--drivers/gpu/drm/xe/xe_pm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 5289d8c0c3b1..b5511e3c3153 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -431,6 +431,21 @@ int xe_pm_runtime_put(struct xe_device *xe)
}
/**
+ * xe_pm_runtime_get_ioctl - Get a runtime_pm reference before ioctl
+ * @xe: xe device instance
+ *
+ * Returns: Any number greater than or equal to 0 for success, negative error
+ * code otherwise.
+ */
+int xe_pm_runtime_get_ioctl(struct xe_device *xe)
+{
+ if (WARN_ON(xe_pm_read_callback_task(xe) == current))
+ return -ELOOP;
+
+ return pm_runtime_get_sync(xe->drm.dev);
+}
+
+/**
* xe_pm_runtime_get_if_active - Get a runtime_pm reference if device active
* @xe: xe device instance
*