Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 1/5] lib/power: Allow use of rapl by specifying fd=-1
Date: Mon, 14 Oct 2024 19:57:10 +0300	[thread overview]
Message-ID: <Zw1NZvHTFQdW7VZh@intel.com> (raw)
In-Reply-To: <20241011171702.cwhzh4wnwmh2i6oy@kamilkon-desk.igk.intel.com>

On Fri, Oct 11, 2024 at 07:17:02PM +0200, Kamil Konieczny wrote:
> Hi Ville,
> On 2024-09-16 at 23:18:37 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > igt_power_open() is currently defunct when you don't have
> > the GPU driver loaded, or when you explicitly want to measure
> > via rapl even when using a DGPU. Allow those use cases by
> > accepting fd<0 to indicate that we explicitly want to use rapl.
> 
> 
> This is ok but imho you should document it in function description.

The whole thing is a complete mess already. There should
probably be a completely separate igt_power_gpu_open()
or at the very least  the "gpu" domain special casing
should be handled first, and then fall back to rapl for
everything else.

But I can try to add a small note about the current
behaviour.

> 
> With that
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> 
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  lib/igt_power.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/igt_power.c b/lib/igt_power.c
> > index 810859b134dc..f4d3efcf0cec 100644
> > --- a/lib/igt_power.c
> > +++ b/lib/igt_power.c
> > @@ -106,7 +106,7 @@ int igt_power_open(int fd, struct igt_power *p, const char *domain)
> >  	p->hwmon_fd = -1;
> >  	p->rapl.fd = -1;
> >  
> > -	is_dgfx = is_xe_device(fd) ? xe_has_vram(fd) : gem_has_lmem(fd);
> > +	is_dgfx = fd >= 0 && (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);
> > -- 
> > 2.44.2
> > 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-10-14 16:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 20:18 [PATCH i-g-t 0/5] Power/energy and display memory bandwidth measurement tools Ville Syrjala
2024-09-16 20:18 ` [PATCH i-g-t 1/5] lib/power: Allow use of rapl by specifying fd=-1 Ville Syrjala
2024-10-11 17:17   ` Kamil Konieczny
2024-10-14 16:57     ` Ville Syrjälä [this message]
2024-09-16 20:18 ` [PATCH i-g-t 2/5] igt: Use is_intel_dgfx() Ville Syrjala
2024-10-11 17:20   ` Kamil Konieczny
2024-09-16 20:18 ` [PATCH i-g-t 3/5] lib/igt_power: Add power_supply/BAT based measurement Ville Syrjala
2024-10-11 17:30   ` Kamil Konieczny
2024-10-14 17:07     ` Ville Syrjälä
2024-09-16 20:18 ` [PATCH i-g-t 4/5] tools/power: Introduce a small power/energy measurement tool Ville Syrjala
2024-10-11 17:39   ` Kamil Konieczny
2024-09-16 20:18 ` [PATCH i-g-t 5/5] tools/intel_display_bandwidth: Tool for measuring display memory bandwidth utilization Ville Syrjala
2024-10-11 17:52   ` Kamil Konieczny
2024-10-14 16:34     ` Ville Syrjälä
2025-02-26 15:39       ` Govindapillai, Vinod
2025-02-26 15:51         ` Ville Syrjälä
2025-02-26 16:23           ` Govindapillai, Vinod
2024-09-16 21:24 ` ✓ CI.xeBAT: success for Power/energy and display memory bandwidth measurement tools Patchwork
2024-09-16 21:40 ` ✓ Fi.CI.BAT: " Patchwork
2024-09-17  0:20 ` ✗ CI.xeFULL: failure " Patchwork
2024-09-17 11:05 ` ✗ 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=Zw1NZvHTFQdW7VZh@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    /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