[igt-dev] [PATCH i-g-t 1/3] lib/igt_power: Modify igt_power library for xe

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri Aug 18 08:00:00 UTC 2023


Hi Riana,

On 2023-08-17 at 11:22:59 +0530, Riana Tauro wrote:
> modify igt_pm library for xe tests. To check if a
  ^
Start sentence from uppercase, s/modify/Modify/

> device is dgfx the igt_power open call needs to be modified for
> xe.
> 
> Signed-off-by: Riana Tauro <riana.tauro at 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"

Add newline.

With this fixed,
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

>  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
> 


More information about the igt-dev mailing list