public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 3/6] drm/i915/debugfs: add rcs topology entry
Date: Mon, 15 Jan 2018 17:42:21 +0000	[thread overview]
Message-ID: <2f5049fe-ab79-6c70-7c29-c9cfc6b49c38@linux.intel.com> (raw)
In-Reply-To: <20180115144159.25913-4-lionel.g.landwerlin@intel.com>


On 15/01/2018 14:41, Lionel Landwerlin wrote:
> While the end goal is to make this information available to userspace
> through a new ioctl, there is no reason we can't display it in a human
> readable fashion through debugfs.
> 
> slice0: 3 subslice(s) (0x7):
> 	subslice0: 8 EUs (0xff)
> 	subslice1: 8 EUs (0xff)
> 	subslice2: 8 EUs (0xff)
> 	subslice3: 0 EUs (0x0)
> slice1: 3 subslice(s) (0x7):
> 	subslice0: 8 EUs (0xff)
> 	subslice1: 8 EUs (0xff)
> 	subslice2: 8 EUs (0xff)
> 	subslice3: 0 EUs (0x0)
> slice2: 3 subslice(s) (0x7):
> 	subslice0: 8 EUs (0xff)
> 	subslice1: 8 EUs (0xff)
> 	subslice2: 8 EUs (0xff)
> 	subslice3: 0 EUs (0x0)
> 
> v2: Reformat debugfs printing (Tvrtko)
>      Use the new EU mask helper (Tvrtko)
> 
> v3: Move printing code to intel_device_info.c to be shared with error
>      state (Michal)
> 
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_debugfs.c      | 11 +++++++++++
>   drivers/gpu/drm/i915/intel_device_info.c | 24 ++++++++++++++++++++++++
>   drivers/gpu/drm/i915/intel_device_info.h |  2 ++
>   3 files changed, 37 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index e41a19b7d7bb..c3a44a54a0ba 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3166,6 +3166,16 @@ static int i915_engine_info(struct seq_file *m, void *unused)
>   	return 0;
>   }
>   
> +static int i915_rcs_topology(struct seq_file *m, void *unused)
> +{
> +	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	intel_device_info_dump_topology(&INTEL_INFO(dev_priv)->sseu, &p);
> +
> +	return 0;
> +}
> +
>   static int i915_shrinker_info(struct seq_file *m, void *unused)
>   {
>   	struct drm_i915_private *i915 = node_to_i915(m->private);
> @@ -4696,6 +4706,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
>   	{"i915_dmc_info", i915_dmc_info, 0},
>   	{"i915_display_info", i915_display_info, 0},
>   	{"i915_engine_info", i915_engine_info, 0},
> +	{"i915_rcs_topology", i915_rcs_topology, 0},
>   	{"i915_shrinker_info", i915_shrinker_info, 0},
>   	{"i915_shared_dplls_info", i915_shared_dplls_info, 0},
>   	{"i915_dp_mst_info", i915_dp_mst_info, 0},
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index ed14994527fc..dcb5127a174c 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -123,6 +123,30 @@ void intel_device_info_dump(const struct intel_device_info *info,
>   	intel_device_info_dump_flags(info, p);
>   }
>   
> +void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
> +				     struct drm_printer *p)
> +{
> +	int s, ss;
> +
> +	if (sseu->max_slices == 0) {
> +		drm_printf(p, "Unavailable\n");
> +		return;
> +	}
> +
> +	for (s = 0; s < sseu->max_slices; s++) {
> +		drm_printf(p, "slice%i: %u subslice(s) (0x%hhx):\n",
> +			   s, hweight8(sseu->subslice_mask[s]),
> +			   sseu->subslice_mask[s]);
> +
> +		for (ss = 0; ss < sseu->max_subslices; ss++) {
> +			drm_printf(p, "\tsubslice%i: %u EUs (0x%hhx)",
> +				   ss, hweight8(sseu_get_eus(sseu, s, ss)),
> +				   sseu_get_eus(sseu, s, ss));

If gcc cannot reduce to one call to sseu_get_eus consider caching in a 
local here.

> +		}
> +	}
> +}
> +
> +
>   static u16 compute_eu_total(const struct sseu_dev_info *sseu)
>   {
>   	u16 i, total = 0;
> diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
> index 36e0df87862d..701888162944 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.h
> +++ b/drivers/gpu/drm/i915/intel_device_info.h
> @@ -220,5 +220,7 @@ void intel_device_info_dump_flags(const struct intel_device_info *info,
>   				  struct drm_printer *p);
>   void intel_device_info_dump_runtime(const struct intel_device_info *info,
>   				    struct drm_printer *p);
> +void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
> +				     struct drm_printer *p);
>   
>   #endif
> 

I wished you used %d instead of %i but OK.

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:[~2018-01-15 17:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 14:41 [PATCH v4 0/6] drm/i915: expose RCS topology to userspace Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 1/6] drm/i915: store all subslice masks Lionel Landwerlin
2018-01-15 17:37   ` Tvrtko Ursulin
2018-01-15 18:09     ` Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 2/6] drm/i915/debugfs: reuse max slice/subslices already stored in sseu Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 3/6] drm/i915/debugfs: add rcs topology entry Lionel Landwerlin
2018-01-15 17:42   ` Tvrtko Ursulin [this message]
2018-01-15 18:12     ` Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 4/6] drm/i915: add rcs topology to error state Lionel Landwerlin
2018-01-15 17:43   ` Tvrtko Ursulin
2018-01-16 13:33     ` Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 5/6] drm/i915: add query uAPI Lionel Landwerlin
2018-01-15 14:41 ` [PATCH v4 6/6] drm/i915: expose rcs topology through " Lionel Landwerlin
2018-01-15 17:54   ` Tvrtko Ursulin
2018-01-15 18:23     ` Lionel Landwerlin
2018-01-16  8:42       ` Tvrtko Ursulin
2018-01-16 10:42         ` Lionel Landwerlin
2018-01-15 15:31 ` ✓ Fi.CI.BAT: success for drm/i915: expose RCS topology to userspace Patchwork
2018-01-15 19:18 ` ✗ 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=2f5049fe-ab79-6c70-7c29-c9cfc6b49c38@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lionel.g.landwerlin@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