Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Report command parser version 0 if disabled
Date: Wed, 04 May 2016 19:08:37 +0300	[thread overview]
Message-ID: <1462378117.6984.2.camel@linux.intel.com> (raw)
In-Reply-To: <1462368336-21230-1-git-send-email-chris@chris-wilson.co.uk>

On ke, 2016-05-04 at 14:25 +0100, Chris Wilson wrote:
> If the command parser is not active, then it is appropriate to report it
> as operating at version 0 as no higher mode is supported. This greatly
> simplifies userspace querying for the command parser as we then do not
> need to second guess when it will be active (a mixture of module
> parameters and generational support, which may change over time).
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Assuming zero was previously unused.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_cmd_parser.c | 15 ++++++++++++++-
>  drivers/gpu/drm/i915/i915_dma.c        |  2 +-
>  drivers/gpu/drm/i915/i915_drv.h        |  2 +-
>  3 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
> index a337f33bec5b..17831fac49f5 100644
> --- a/drivers/gpu/drm/i915/i915_cmd_parser.c
> +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
> @@ -1275,8 +1275,21 @@ int i915_parse_cmds(struct intel_engine_cs *engine,
>   *
>   * Return: the current version number of the cmd parser
>   */
> -int i915_cmd_parser_get_version(void)
> +int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv)
>  {
> +	struct intel_engine_cs *engine;
> +	bool active = false;
> +
> +	/* If the comand parser is not enabled, report 0 - unsupported */
> +	for_each_engine(engine, dev_priv) {
> +		if (i915_needs_cmd_parser(engine)) {
> +			active = true;
> +			break;
> +		}
> +	}
> +	if (!active)
> +		return 0;
> +
>  	/*
>  	 * Command parser version history
>  	 *
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index c91387f1aedd..ad7abe517700 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -204,7 +204,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  		value = 1;
>  		break;
>  	case I915_PARAM_CMD_PARSER_VERSION:
> -		value = i915_cmd_parser_get_version();
> +		value = i915_cmd_parser_get_version(dev_priv);
>  		break;
>  	case I915_PARAM_HAS_COHERENT_PHYS_GTT:
>  		value = 1;
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 75a1675ea6ce..d5496aba1cd5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3442,7 +3442,7 @@ void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone);
>  const char *i915_cache_level_str(struct drm_i915_private *i915, int type);
>  
>  /* i915_cmd_parser.c */
> -int i915_cmd_parser_get_version(void);
> +int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv);
>  int i915_cmd_parser_init_ring(struct intel_engine_cs *engine);
>  void i915_cmd_parser_fini_ring(struct intel_engine_cs *engine);
>  bool i915_needs_cmd_parser(struct intel_engine_cs *engine);
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2016-05-04 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04 13:25 [PATCH] drm/i915: Report command parser version 0 if disabled Chris Wilson
2016-05-04 15:22 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-05-05  7:44   ` Chris Wilson
2016-05-04 16:08 ` Joonas Lahtinen [this message]

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=1462378117.6984.2.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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