public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 4/6] drm/i915: Add debugfs knobs for wbinvd threshold
Date: Mon,  9 Feb 2015 13:54:17 -0800	[thread overview]
Message-ID: <1423518859-6199-5-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1423518859-6199-1-git-send-email-benjamin.widawsky@intel.com>

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b315f01..e0fd3ba 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4316,6 +4316,39 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_cache_sharing_fops,
 			i915_cache_sharing_get, i915_cache_sharing_set,
 			"%llu\n");
 
+static int i915_wbinvd_threshold_get(void *data, u64 *val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	int ret;
+
+	ret = mutex_lock_interruptible(&dev->struct_mutex);
+	if (ret)
+		return ret;
+	*val = dev_priv->wbinvd_threshold;
+	mutex_unlock(&dev_priv->dev->struct_mutex);
+
+	return 0;
+}
+
+static int i915_wbinvd_threshold_set(void *data, u64 val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	int ret;
+
+	ret = mutex_lock_interruptible(&dev->struct_mutex);
+	if (ret)
+		return ret;
+	dev_priv->wbinvd_threshold = val;
+	mutex_unlock(&dev_priv->dev->struct_mutex);
+
+	return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(i915_wbinvd_threshold_fops,
+			i915_wbinvd_threshold_get, i915_wbinvd_threshold_set,
+			"%llu\n");
 static int i915_forcewake_open(struct inode *inode, struct file *file)
 {
 	struct drm_device *dev = inode->i_private;
@@ -4450,6 +4483,7 @@ static const struct i915_debugfs_files {
 	{"i915_spr_wm_latency", &i915_spr_wm_latency_fops},
 	{"i915_cur_wm_latency", &i915_cur_wm_latency_fops},
 	{"i915_fbc_false_color", &i915_fbc_fc_fops},
+	{"i915_wbinvd_threshold", &i915_wbinvd_threshold_fops},
 };
 
 void intel_display_crc_init(struct drm_device *dev)
-- 
2.3.0

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

  parent reply	other threads:[~2015-02-09 21:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 21:54 [PATCH 0/6] Prefer wbinvd() where appropriate Ben Widawsky
2015-02-09 21:54 ` [PATCH 1/6] drm/i915: Remove the useless flush_chipset Ben Widawsky
2015-02-10  9:18   ` Chris Wilson
2015-02-09 21:54 ` [PATCH 2/6] drm/i915: Pass eb_vmas to execbuffer implementations Ben Widawsky
2015-02-10  9:19   ` Chris Wilson
2015-02-09 21:54 ` [PATCH 3/6] drm/i915: Opportunistically reduce flushing at execbuf Ben Widawsky
2015-02-10  9:21   ` Chris Wilson
2015-02-09 21:54 ` Ben Widawsky [this message]
2015-02-09 21:54 ` [PATCH 5/6] drm/i915: Extract checking the necessity of flush Ben Widawsky
2015-02-09 21:54 ` [PATCH 6/6] drm/i915: obey wbinvd threshold in more places Ben Widawsky
2015-02-10  9:28   ` Chris Wilson
2015-02-10 20:49   ` shuang.he

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=1423518859-6199-5-git-send-email-benjamin.widawsky@intel.com \
    --to=benjamin.widawsky@intel.com \
    --cc=ben@bwidawsk.net \
    --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