Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drm/xe/debugfs: add local forcewake_get/put funcs
@ 2025-03-24 11:07 Dafna Hirschfeld
  2025-03-24 11:07 ` [PATCH v2 2/2] drm/xe: add mmio debugfs file & restore xe_mmio_ioctl as its ioctl handler Dafna Hirschfeld
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Dafna Hirschfeld @ 2025-03-24 11:07 UTC (permalink / raw)
  To: intel-xe; +Cc: Dafna Hirschfeld

add the function forcewake_get, forcewake_put. They will be
used in laters commits.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
---
changes from v1:
1. fix according to comments,
2. support steering for mcr registers.

 drivers/gpu/drm/xe/xe_debugfs.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index d0503959a8ed..e60eaefdd4a5 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -87,9 +87,8 @@ static const struct drm_info_list debugfs_list[] = {
 	{ .name = "sriov_info", .show = sriov_info, },
 };
 
-static int forcewake_open(struct inode *inode, struct file *file)
+static int forcewake_get(struct xe_device *xe)
 {
-	struct xe_device *xe = inode->i_private;
 	struct xe_gt *gt;
 	u8 id, last_gt;
 	unsigned int fw_ref;
@@ -119,15 +118,28 @@ static int forcewake_open(struct inode *inode, struct file *file)
 	return -ETIMEDOUT;
 }
 
-static int forcewake_release(struct inode *inode, struct file *file)
+static int forcewake_open(struct inode *inode, struct file *file)
 {
 	struct xe_device *xe = inode->i_private;
+
+	return forcewake_get(xe);
+}
+
+static void forcewake_put(struct xe_device *xe)
+{
 	struct xe_gt *gt;
 	u8 id;
 
 	for_each_gt(gt, xe, id)
 		xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
 	xe_pm_runtime_put(xe);
+}
+
+static int forcewake_release(struct inode *inode, struct file *file)
+{
+	struct xe_device *xe = inode->i_private;
+
+	forcewake_put(xe);
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-04-01  4:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 11:07 [PATCH v2 1/2] drm/xe/debugfs: add local forcewake_get/put funcs Dafna Hirschfeld
2025-03-24 11:07 ` [PATCH v2 2/2] drm/xe: add mmio debugfs file & restore xe_mmio_ioctl as its ioctl handler Dafna Hirschfeld
2025-04-01  4:12   ` Lucas De Marchi
2025-03-24 11:13 ` ✓ CI.Patch_applied: success for series starting with [v2,1/2] drm/xe/debugfs: add local forcewake_get/put funcs Patchwork
2025-03-24 11:14 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-24 11:15 ` ✓ CI.KUnit: success " Patchwork
2025-03-24 11:31 ` ✓ CI.Build: " Patchwork
2025-03-24 11:34 ` ✓ CI.Hooks: " Patchwork
2025-03-24 11:35 ` ✓ CI.checksparse: " Patchwork
2025-03-24 12:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-24 14:00 ` ✓ Xe.CI.Full: " Patchwork
2025-03-24 15:01 ` [PATCH v2 1/2] " Rodrigo Vivi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox