From: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
Subject: [PATCH v2 1/2] drm/xe/debugfs: add local forcewake_get/put funcs
Date: Mon, 24 Mar 2025 13:07:29 +0200 [thread overview]
Message-ID: <20250324110730.2521805-1-dafna.hirschfeld@intel.com> (raw)
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
next reply other threads:[~2025-03-24 11:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 11:07 Dafna Hirschfeld [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324110730.2521805-1-dafna.hirschfeld@intel.com \
--to=dafna.hirschfeld@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox