From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 1/7] drm/i915: sseu: move sseu_dev_status to i915_drv.h
Date: Wed, 21 Oct 2015 18:40:31 +0300 [thread overview]
Message-ID: <1445442037-1186-2-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1445442037-1186-1-git-send-email-imre.deak@intel.com>
The data in this struct is provided both by getting the
slice/subslice/eu features available on a given platform and the actual
runtime state of these same features which depends on the HW's current
power saving state.
Atm members of this struct are duplicated in sseu_dev_status and
intel_device_info. For clarity and code reuse we can share one struct
for both of the above purposes. This patch only moves the struct to the
header file, the next patch will convert users of intel_device_info to
use this struct too.
Instead of unsigned int u8 is used now, which is big enough and is used
anyway in intel_device_info.
No functional change.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 29 ++++++++++++-----------------
drivers/gpu/drm/i915/i915_drv.h | 8 ++++++++
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a3b22bd..3dd7076 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4945,16 +4945,8 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_cache_sharing_fops,
i915_cache_sharing_get, i915_cache_sharing_set,
"%llu\n");
-struct sseu_dev_status {
- unsigned int slice_total;
- unsigned int subslice_total;
- unsigned int subslice_per_slice;
- unsigned int eu_total;
- unsigned int eu_per_subslice;
-};
-
static void cherryview_sseu_device_status(struct drm_device *dev,
- struct sseu_dev_status *stat)
+ struct sseu_dev_info *stat)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int ss_max = 2;
@@ -4980,13 +4972,14 @@ static void cherryview_sseu_device_status(struct drm_device *dev,
((sig1[ss] & CHV_EU210_PG_ENABLE) ? 0 : 2) +
((sig2[ss] & CHV_EU311_PG_ENABLE) ? 0 : 2);
stat->eu_total += eu_cnt;
- stat->eu_per_subslice = max(stat->eu_per_subslice, eu_cnt);
+ stat->eu_per_subslice = max_t(unsigned int,
+ stat->eu_per_subslice, eu_cnt);
}
stat->subslice_total = stat->subslice_per_slice;
}
static void gen9_sseu_device_status(struct drm_device *dev,
- struct sseu_dev_status *stat)
+ struct sseu_dev_info *stat)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int s_max = 3, ss_max = 4;
@@ -5040,18 +5033,20 @@ static void gen9_sseu_device_status(struct drm_device *dev,
eu_cnt = 2 * hweight32(eu_reg[2*s + ss/2] &
eu_mask[ss%2]);
stat->eu_total += eu_cnt;
- stat->eu_per_subslice = max(stat->eu_per_subslice,
- eu_cnt);
+ stat->eu_per_subslice = max_t(unsigned int,
+ stat->eu_per_subslice,
+ eu_cnt);
}
stat->subslice_total += ss_cnt;
- stat->subslice_per_slice = max(stat->subslice_per_slice,
- ss_cnt);
+ stat->subslice_per_slice = max_t(unsigned int,
+ stat->subslice_per_slice,
+ ss_cnt);
}
}
static void broadwell_sseu_device_status(struct drm_device *dev,
- struct sseu_dev_status *stat)
+ struct sseu_dev_info *stat)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int s;
@@ -5079,7 +5074,7 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
- struct sseu_dev_status stat;
+ struct sseu_dev_info stat;
if (INTEL_INFO(dev)->gen < 8)
return -ENODEV;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8afda45..73ff01f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -782,6 +782,14 @@ struct intel_csr {
#define DEFINE_FLAG(name) u8 name:1
#define SEP_SEMICOLON ;
+struct sseu_dev_info {
+ u8 slice_total;
+ u8 subslice_total;
+ u8 subslice_per_slice;
+ u8 eu_total;
+ u8 eu_per_subslice;
+};
+
struct intel_device_info {
u32 display_mmio_offset;
u16 device_id;
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-10-21 15:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 15:40 [PATCH 0/7] drm/i915: read out slice/subslice masks Imre Deak
2015-10-21 15:40 ` Imre Deak [this message]
2015-11-19 23:10 ` [PATCH 1/7] drm/i915: sseu: move sseu_dev_status to i915_drv.h Ben Widawsky
2015-11-20 0:29 ` Jeff McGee
2015-10-21 15:40 ` [PATCH 2/7] drm/i915: sseu: use sseu_dev_info in device info Imre Deak
2015-11-19 23:18 ` Ben Widawsky
2015-10-21 15:40 ` [PATCH 3/7] drm/i915: sseu: simplify debugfs status/info printing Imre Deak
2015-11-19 23:24 ` Ben Widawsky
2015-10-21 15:40 ` [PATCH 4/7] drm/i915: sseu: convert slice count field to mask Imre Deak
2015-11-19 23:40 ` Ben Widawsky
2015-11-20 13:00 ` Ville Syrjälä
2015-10-21 15:40 ` [PATCH 5/7] drm/i915: sseu: convert subslice count fields to subslice mask Imre Deak
2015-11-20 0:07 ` Ben Widawsky
2015-10-21 15:40 ` [PATCH 6/7] drm/i915: sseu: add debug printf for slice/subslice masks Imre Deak
2015-10-21 15:40 ` [PATCH 7/7] drm/i915/bdw: sseu: fix sseu status parsing Imre Deak
2015-11-20 0:08 ` Ben Widawsky
2015-10-27 11:45 ` [PATCH 0/7] drm/i915: read out slice/subslice masks Robert Bragg
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=1445442037-1186-2-git-send-email-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=benjamin.widawsky@intel.com \
--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