Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: badal.nilawar@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/3] lib/igt_power: Modify igt_power library for xe
Date: Thu, 17 Aug 2023 11:22:59 +0530	[thread overview]
Message-ID: <20230817055301.855960-2-riana.tauro@intel.com> (raw)
In-Reply-To: <20230817055301.855960-1-riana.tauro@intel.com>

modify igt_pm library for xe tests. To check if a
device is dgfx the igt_power open call needs to be modified for
xe.

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
 lib/igt_power.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/igt_power.c b/lib/igt_power.c
index 3b34be406..439d49fc3 100644
--- a/lib/igt_power.c
+++ b/lib/igt_power.c
@@ -12,6 +12,7 @@
 #include "igt_power.h"
 #include "igt_sysfs.h"
 
+#include "xe/xe_query.h"
 static const char *rapl_domains[] = { "cpu", "gpu", "pkg", "ram" };
 
 static int rapl_parse(struct rapl *r, const char *str)
@@ -99,11 +100,13 @@ static inline void rapl_close(struct rapl *r)
 int igt_power_open(int fd, struct igt_power *p, const char *domain)
 {
 	int i;
+	bool is_dgfx;
 
 	p->hwmon_fd = -1;
 	p->rapl.fd = -1;
 
-	if (gem_has_lmem(fd)) {
+	is_dgfx = is_xe_device(fd) ? xe_has_vram(fd) : gem_has_lmem(fd);
+	if (is_dgfx) {
 		if (strncmp(domain, "gpu", strlen("gpu")) == 0) {
 			p->hwmon_fd = igt_hwmon_open(fd);
 			if (p->hwmon_fd >= 0)
-- 
2.40.0

  reply	other threads:[~2023-08-17  5:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  5:52 [igt-dev] [PATCH i-g-t 0/3] Toggle GT C States and validate power Riana Tauro
2023-08-17  5:52 ` Riana Tauro [this message]
2023-08-18  8:00   ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_power: Modify igt_power library for xe Kamil Konieczny
2023-08-18  8:36     ` Riana Tauro
2023-08-17  5:53 ` [igt-dev] [PATCH i-g-t 2/3] tests/xe: Add a test to toggle GT C states and validate power Riana Tauro
2023-08-23  8:40   ` Sundaresan, Sujaritha
2023-08-17  5:53 ` [igt-dev] [PATCH i-g-t 3/3] HAX: Add toggle-gt-c6 to xe-fast-feedback.testlist Riana Tauro
2023-08-17  6:35 ` [igt-dev] ✗ GitLab.Pipeline: warning for Toggle GT C States and validate power Patchwork
2023-08-17  7:01 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-17  7:08 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-17 18:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20230817055301.855960-2-riana.tauro@intel.com \
    --to=riana.tauro@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@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