From: Matt Roper <matthew.d.roper@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 5/5] drm/i915/mtl: don't expose GSC command streamer to the user
Date: Fri, 4 Nov 2022 10:25:44 -0700 [thread overview]
Message-ID: <Y2VLGC4WSnvSv5f4@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20221102171047.2787951-6-daniele.ceraolospurio@intel.com>
On Wed, Nov 02, 2022 at 10:10:47AM -0700, Daniele Ceraolo Spurio wrote:
> There is no userspace user for this CS yet, we only need it for internal
> kernel ops (e.g. HuC, PXP), so don't expose it.
>
> v2: even if it's not exposed, rename the engine so it is easier to
> identify in the debug logs (Matt)
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_engine_user.c | 27 ++++++++++++++++-----
> 1 file changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> index 79312b734690..cd4f1b126f75 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> @@ -191,6 +191,15 @@ static void add_legacy_ring(struct legacy_ring *ring,
> ring->instance++;
> }
>
> +static void engine_rename(struct intel_engine_cs *engine, const char *name, u16 instance)
> +{
> + char old[sizeof(engine->name)];
> +
> + memcpy(old, engine->name, sizeof(engine->name));
> + scnprintf(engine->name, sizeof(engine->name), "%s%u", name, instance);
> + drm_dbg(&engine->i915->drm, "renamed %s to %s\n", old, engine->name);
> +}
> +
> void intel_engines_driver_register(struct drm_i915_private *i915)
> {
> struct legacy_ring ring = {};
> @@ -206,11 +215,19 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
> struct intel_engine_cs *engine =
> container_of((struct rb_node *)it, typeof(*engine),
> uabi_node);
> - char old[sizeof(engine->name)];
>
> if (intel_gt_has_unrecoverable_error(engine->gt))
> continue; /* ignore incomplete engines */
>
> + /*
> + * We don't want to expose the GSC engine to the users, but we
> + * still rename it so it is easier to identify in the debug logs
> + */
> + if (engine->id == GSC0) {
> + engine_rename(engine, "gsc", 0);
> + continue;
> + }
> +
> GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes));
> engine->uabi_class = uabi_classes[engine->class];
>
> @@ -220,11 +237,9 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
> i915->engine_uabi_class_count[engine->uabi_class]++;
>
> /* Replace the internal name with the final user facing name */
> - memcpy(old, engine->name, sizeof(engine->name));
> - scnprintf(engine->name, sizeof(engine->name), "%s%u",
> - intel_engine_class_repr(engine->class),
> - engine->uabi_instance);
> - DRM_DEBUG_DRIVER("renamed %s to %s\n", old, engine->name);
> + engine_rename(engine,
> + intel_engine_class_repr(engine->class),
> + engine->uabi_instance);
>
> rb_link_node(&engine->uabi_node, prev, p);
> rb_insert_color(&engine->uabi_node, &i915->uabi_engines);
> --
> 2.37.3
>
--
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
next prev parent reply other threads:[~2022-11-04 17:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 17:10 [Intel-gfx] [PATCH v2 0/5] drm/i915: Introduce the GSC CS Daniele Ceraolo Spurio
2022-11-02 17:10 ` [Intel-gfx] [PATCH v2 1/5] drm/i915/mtl: add initial definitions for " Daniele Ceraolo Spurio
2022-11-02 17:10 ` [Intel-gfx] [PATCH v2 2/5] drm/i915/mtl: pass the GSC CS info to the GuC Daniele Ceraolo Spurio
2022-11-02 17:10 ` [Intel-gfx] [PATCH v2 3/5] drm/i915/mtl: add GSC CS interrupt support Daniele Ceraolo Spurio
2022-11-07 18:32 ` Matt Roper
2022-11-02 17:10 ` [Intel-gfx] [PATCH v2 4/5] drm/i915/mtl: add GSC CS reset support Daniele Ceraolo Spurio
2022-11-02 17:10 ` [Intel-gfx] [PATCH v2 5/5] drm/i915/mtl: don't expose GSC command streamer to the user Daniele Ceraolo Spurio
2022-11-04 17:25 ` Matt Roper [this message]
2022-11-02 19:00 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Introduce the GSC CS Patchwork
2022-11-02 19:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-02 19:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-03 0:52 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=Y2VLGC4WSnvSv5f4@mdroper-desk1.amr.corp.intel.com \
--to=matthew.d.roper@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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