intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Remove useless error return from intel_init_mocs_engine()
Date: Wed, 15 Aug 2018 15:19:50 -0700	[thread overview]
Message-ID: <20180815221950.GG4070@intel.com> (raw)
In-Reply-To: <20180815184251.5850-1-chris@chris-wilson.co.uk>

On Wed, Aug 15, 2018 at 07:42:51PM +0100, Chris Wilson wrote:
> As the only error is for a programming error in constructing the static
> tables describing the register values, replace the error code
> propagation with an assert.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_lrc.c  |  6 +-----
>  drivers/gpu/drm/i915/intel_mocs.c | 11 +++--------
>  drivers/gpu/drm/i915/intel_mocs.h |  2 +-
>  3 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 3f90c74038ef..841895cfb05f 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1769,11 +1769,7 @@ static bool unexpected_starting_state(struct intel_engine_cs *engine)
>  
>  static int gen8_init_common_ring(struct intel_engine_cs *engine)
>  {
> -	int ret;
> -
> -	ret = intel_mocs_init_engine(engine);
> -	if (ret)
> -		return ret;
> +	intel_mocs_init_engine(engine);
>  
>  	intel_engine_reset_breadcrumbs(engine);
>  
> diff --git a/drivers/gpu/drm/i915/intel_mocs.c b/drivers/gpu/drm/i915/intel_mocs.c
> index 9f0bd6a4cb79..77e9871a8c9a 100644
> --- a/drivers/gpu/drm/i915/intel_mocs.c
> +++ b/drivers/gpu/drm/i915/intel_mocs.c
> @@ -232,20 +232,17 @@ static i915_reg_t mocs_register(enum intel_engine_id engine_id, int index)
>   *
>   * This function simply emits a MI_LOAD_REGISTER_IMM command for the
>   * given table starting at the given address.
> - *
> - * Return: 0 on success, otherwise the error status.
>   */
> -int intel_mocs_init_engine(struct intel_engine_cs *engine)
> +void intel_mocs_init_engine(struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_private *dev_priv = engine->i915;
>  	struct drm_i915_mocs_table table;
>  	unsigned int index;
>  
>  	if (!get_mocs_settings(dev_priv, &table))
> -		return 0;
> +		return;
>  
> -	if (WARN_ON(table.size > GEN9_NUM_MOCS_ENTRIES))
> -		return -ENODEV;
> +	GEM_BUG_ON(table.size > GEN9_NUM_MOCS_ENTRIES);
>  
>  	for (index = 0; index < table.size; index++)
>  		I915_WRITE(mocs_register(engine->id, index),
> @@ -262,8 +259,6 @@ int intel_mocs_init_engine(struct intel_engine_cs *engine)
>  	for (; index < GEN9_NUM_MOCS_ENTRIES; index++)
>  		I915_WRITE(mocs_register(engine->id, index),
>  			   table.table[0].control_value);
> -
> -	return 0;
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/i915/intel_mocs.h b/drivers/gpu/drm/i915/intel_mocs.h
> index d1751f91c1a4..d89080d75b80 100644
> --- a/drivers/gpu/drm/i915/intel_mocs.h
> +++ b/drivers/gpu/drm/i915/intel_mocs.h
> @@ -54,6 +54,6 @@
>  
>  int intel_rcs_context_init_mocs(struct i915_request *rq);
>  void intel_mocs_init_l3cc_table(struct drm_i915_private *dev_priv);
> -int intel_mocs_init_engine(struct intel_engine_cs *engine);
> +void intel_mocs_init_engine(struct intel_engine_cs *engine);
>  
>  #endif
> -- 
> 2.18.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-08-15 22:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15 18:42 [PATCH] drm/i915: Remove useless error return from intel_init_mocs_engine() Chris Wilson
2018-08-15 19:09 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-08-15 22:19 ` Rodrigo Vivi [this message]
2018-08-15 22:36   ` [PATCH] " Chris Wilson
2018-08-16  0:21 ` ✓ Fi.CI.IGT: success for " 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=20180815221950.GG4070@intel.com \
    --to=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).