All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Oscar Mateo <oscar.mateo@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 3/5] drm/i915: Generate the engine name based on the instance number
Date: Fri, 7 Apr 2017 09:12:00 +0100	[thread overview]
Message-ID: <9d73e4ce-5023-1251-fee3-ee9ec647835e@linux.intel.com> (raw)
In-Reply-To: <1491490816-26965-4-git-send-email-oscar.mateo@intel.com>


On 06/04/2017 16:00, Oscar Mateo wrote:
> Not really needed, but makes the next change a little bit more compact.
>
> v2:
>   - Use zero-based numbering for engine names: xcs0, xcs1.. xcsN (Tvrtko, Chris)
>   - Make sure the mock engine name is null-terminated (Tvrtko, Chris)
>
> v3: Because I'm stupid (Chris)
>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c       | 5 +++--
>  drivers/gpu/drm/i915/intel_ringbuffer.h      | 4 +++-
>  drivers/gpu/drm/i915/selftests/mock_engine.c | 2 +-
>  3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index bb10847..c6a73d0 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -71,7 +71,7 @@
>  		.init_legacy = intel_init_bsd_ring_buffer,
>  	},
>  	[VCS2] = {
> -		.name = "vcs2",
> +		.name = "vcs",
>  		.hw_id = VCS2_HW,
>  		.exec_id = I915_EXEC_BSD,
>  		.class = VIDEO_DECODE_CLASS,
> @@ -108,7 +108,8 @@
>
>  	engine->id = id;
>  	engine->i915 = dev_priv;
> -	engine->name = info->name;
> +	snprintf(engine->name, sizeof(engine->name), "%s%u",
> +				info->name, info->instance);
>  	engine->exec_id = info->exec_id;
>  	engine->hw_id = engine->guc_id = info->hw_id;
>  	engine->mmio_base = info->mmio_base;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 5c1a27f..d617049 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -187,9 +187,11 @@ enum intel_engine_id {
>  	VECS
>  };
>
> +#define INTEL_ENGINE_CS_MAX_NAME 8
> +
>  struct intel_engine_cs {
>  	struct drm_i915_private *i915;
> -	const char	*name;
> +	char name[INTEL_ENGINE_CS_MAX_NAME];
>  	enum intel_engine_id id;
>  	unsigned int exec_id;
>  	unsigned int hw_id;
> diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c
> index b89050e..b8e53bd 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_engine.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_engine.c
> @@ -140,7 +140,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
>
>  	/* minimal engine setup for requests */
>  	engine->base.i915 = i915;
> -	engine->base.name = name;
> +	snprintf(engine->base.name, sizeof(engine->base.name), "%s", name);
>  	engine->base.id = id++;
>  	engine->base.status_page.page_addr = (void *)(engine + 1);
>
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-04-07  8:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 15:00 [PATCH 0/5] Classify the engines in class + instance (v3) Oscar Mateo
2017-04-06 15:00 ` [PATCH 1/5] drm/i915: Classify the engines in class + instance Oscar Mateo
2017-04-07  9:45   ` Michal Wajdeczko
2017-04-07  9:52     ` Chris Wilson
2017-04-06 15:00 ` [PATCH 2/5] drm/i915: Use the same vfunc for BSD2 ring init Oscar Mateo
2017-04-06 15:00 ` [PATCH 3/5] drm/i915: Generate the engine name based on the instance number Oscar Mateo
2017-04-07  8:12   ` Tvrtko Ursulin [this message]
2017-04-07 10:31   ` Michal Wajdeczko
2017-04-06 15:00 ` [PATCH 4/5] drm/i915: Split the engine info table in two levels, using class + instance Oscar Mateo
2017-04-07  8:14   ` Tvrtko Ursulin
2017-04-07 10:43   ` Michal Wajdeczko
2017-04-06 15:00 ` [PATCH 5/5] drm/i915: Use the engine class to get the context size Oscar Mateo
2017-04-06 22:27 ` ✓ Fi.CI.BAT: success for Classify the engines in class + instance (rev4) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-04-10 14:34 [PATCH 0/5] Classify the engines in class + instance (v5) Oscar Mateo
2017-04-10 14:34 ` [PATCH 3/5] drm/i915: Generate the engine name based on the instance number Oscar Mateo
2017-04-07  9:15 [PATCH 0/5] Classify the engines in class + instance (v4) Oscar Mateo
2017-04-07  9:15 ` [PATCH 3/5] drm/i915: Generate the engine name based on the instance number Oscar Mateo
2017-04-07 16:23   ` Michal Wajdeczko
2017-04-07 17:11     ` Chris Wilson
2017-04-07 12:08       ` Oscar Mateo
2017-04-06 12:55 [PATCH 0/5] Classify the engines in class + instance (v2) Oscar Mateo
2017-04-06 12:55 ` [PATCH 3/5] drm/i915: Generate the engine name based on the instance number Oscar Mateo
2017-04-06 20:10   ` Chris Wilson
2017-04-06 13:15     ` Oscar Mateo
2017-04-05  9:30 [PATCH 0/5] Classify the engines in class + instance Oscar Mateo
2017-04-05  9:30 ` [PATCH 3/5] drm/i915: Generate the engine name based on the instance number Oscar Mateo
2017-04-06 18:02   ` Tvrtko Ursulin
2017-04-06 11:22     ` Oscar Mateo
2017-04-06 18:37       ` Tvrtko Ursulin
2017-04-06 18:44         ` Chris Wilson
2017-04-06 18:10     ` Chris Wilson

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=9d73e4ce-5023-1251-fee3-ee9ec647835e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=oscar.mateo@intel.com \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.