Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 5/6] tools/intel_reg: Add wrapper for reg access init
Date: Fri, 20 Sep 2024 10:35:49 -0700	[thread overview]
Message-ID: <20240920173549.GQ5774@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20240918163629.1186314-6-lucas.demarchi@intel.com>

On Wed, Sep 18, 2024 at 09:36:28AM -0700, Lucas De Marchi wrote:
> Extract helper function so it can be extended to xe.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  tools/intel_reg.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/intel_reg.c b/tools/intel_reg.c
> index c5800cf05..906ae9b84 100644
> --- a/tools/intel_reg.c
> +++ b/tools/intel_reg.c
> @@ -800,6 +800,11 @@ static int parse_reg(struct config *config, struct reg *reg, const char *s)
>  	return ret;
>  }
>  
> +static int register_access_init(struct config *config)
> +{
> +	return intel_register_access_init(&config->mmio_data, config->pci_dev, 0, -1);
> +}
> +
>  /* XXX: add support for register ranges, maybe REGISTER..REGISTER */
>  static int intel_reg_read(struct config *config, int argc, char *argv[])
>  {
> @@ -812,8 +817,8 @@ static int intel_reg_read(struct config *config, int argc, char *argv[])
>  
>  	if (config->mmiofile)
>  		intel_mmio_use_dump_file(&config->mmio_data, config->mmiofile);
> -	else
> -		intel_register_access_init(&config->mmio_data, config->pci_dev, 0, -1);
> +	else if (register_access_init(config) < 0)
> +		return EXIT_FAILURE;

The new EXIT_FAILURE returns are still impossible until the next patch,
right?  It doesn't look like intel_register_access_init() can ever fail.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

>  
>  	for (i = 1; i < argc; i++) {
>  		struct reg reg;
> @@ -843,7 +848,9 @@ static int intel_reg_write(struct config *config, int argc, char *argv[])
>  		return EXIT_FAILURE;
>  	}
>  
> -	intel_register_access_init(&config->mmio_data, config->pci_dev, 0, -1);
> +
> +	if (register_access_init(config) < 0)
> +		return EXIT_FAILURE;
>  
>  	for (i = 1; i < argc; i += 2) {
>  		struct reg reg;
> @@ -880,8 +887,8 @@ static int intel_reg_dump(struct config *config, int argc, char *argv[])
>  
>  	if (config->mmiofile)
>  		intel_mmio_use_dump_file(&config->mmio_data, config->mmiofile);
> -	else
> -		intel_register_access_init(&config->mmio_data, config->pci_dev, 0, -1);
> +	else if (register_access_init(config) < 0)
> +		return EXIT_FAILURE;
>  
>  	for (i = 0; i < config->regcount; i++) {
>  		reg = &config->regs[i];
> -- 
> 2.46.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation

  reply	other threads:[~2024-09-20 17:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 16:36 [PATCH i-g-t 0/6] Add forcewake support for xe Lucas De Marchi
2024-09-18 16:36 ` [PATCH i-g-t 1/6] lib/igt_gt: Fix forcewake open Lucas De Marchi
2024-09-20 16:58   ` Matt Roper
2024-09-18 16:36 ` [PATCH i-g-t 2/6] lib/igt_gt: Document fd argument in igt_open_forcewake_handle() Lucas De Marchi
2024-09-20 17:15   ` Matt Roper
2024-09-20 20:20     ` Lucas De Marchi
2024-09-18 16:36 ` [PATCH i-g-t 3/6] lib/igt_gt: Make igt_open_forcewake_handle() xe-compatible Lucas De Marchi
2024-09-20 17:17   ` Matt Roper
2024-09-18 16:36 ` [PATCH i-g-t 4/6] lib/igt_gt: Fallback on filenames in igt_open_forcewake_handle() Lucas De Marchi
2024-09-18 19:16   ` [PATCH i-g-t v1.1] " Lucas De Marchi
2024-09-20 17:27     ` Matt Roper
2024-09-18 16:36 ` [PATCH i-g-t 5/6] tools/intel_reg: Add wrapper for reg access init Lucas De Marchi
2024-09-20 17:35   ` Matt Roper [this message]
2024-09-18 16:36 ` [PATCH i-g-t 6/6] tools/intel_reg: Add forcewake support to xe Lucas De Marchi
2024-09-20 17:43   ` Ville Syrjälä
2024-09-20 18:01   ` Matt Roper
2024-09-20 18:04     ` Matt Roper
2024-09-20 18:30       ` Ville Syrjälä
2024-09-20 19:43         ` Lucas De Marchi
2024-09-18 17:47 ` ✓ CI.xeBAT: success for Add forcewake support for xe Patchwork
2024-09-18 17:48 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-18 19:42 ` ✓ CI.xeBAT: success for Add forcewake support for xe (rev2) Patchwork
2024-09-18 19:54 ` ✓ Fi.CI.BAT: " Patchwork
2024-09-19  3:57 ` ✗ CI.xeFULL: failure for Add forcewake support for xe Patchwork
2024-09-19  6:06 ` ✗ CI.xeFULL: failure for Add forcewake support for xe (rev2) Patchwork
2024-09-19  7:27 ` ✗ 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=20240920173549.GQ5774@mdroper-desk1.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@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