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 2/2] [v2] drm/i915: Disable blt tracking of fbc when not used
Date: Fri, 1 Nov 2013 17:04:21 -0700 [thread overview]
Message-ID: <1383350661-7570-1-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1383350573-7427-2-git-send-email-benjamin.widawsky@intel.com>
When not blitting to scanout, we can save some power by not tracking
blits, and more importantly, unnecessarily invalidating lines which we
don't care a bout.
These instructions are explicitly spelled out in the spec, but it is how
I expect it to work. Unfortunately, I do not have power data for this.
v2: Don't advance the ring twice (Stéphane)
Rename extra_dwords to dwrods (Stéphane)
Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/intel_ringbuffer.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index ddd7681..8c6e9b2 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -296,7 +296,8 @@ static int gen6_ring_fbc_flush(struct intel_ring_buffer *ring)
_MASKED_BIT_ENABLE(GEN6_BLITTER_FBC_NOTIFY));
intel_ring_advance(ring);
- ring->fbc_dirty = false;
+ /* We'll mark the fbc clean only after the operation has completed so we
+ * can track when to disable the bit above */
return 0;
}
@@ -642,11 +643,13 @@ gen6_add_request(struct intel_ring_buffer *ring)
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *useless;
- int i, ret;
+ int i, ret, dwords = 4;
+ if (ring->fbc_dirty && ring->id == BCS)
+ dwords += 4;
ret = intel_ring_begin(ring, ((I915_NUM_RINGS-1) *
MBOX_UPDATE_DWORDS) +
- 4);
+ dwords);
if (ret)
return ret;
#undef MBOX_UPDATE_DWORDS
@@ -661,6 +664,17 @@ gen6_add_request(struct intel_ring_buffer *ring)
intel_ring_emit(ring, I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
intel_ring_emit(ring, ring->outstanding_lazy_seqno);
intel_ring_emit(ring, MI_USER_INTERRUPT);
+
+ if (ring->fbc_dirty && ring->id == BCS) {
+ intel_ring_emit(ring, MI_NOOP);
+ intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
+ intel_ring_emit(ring, GEN6_BLITTER_ECOSKPD);
+ intel_ring_emit(ring,
+ _MASKED_BIT_DISABLE(GEN6_BLITTER_FBC_NOTIFY));
+
+ ring->fbc_dirty = false;
+ }
+
__intel_ring_advance(ring);
return 0;
--
1.8.4.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2013-11-02 0:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-02 0:02 [PATCH 1/2] drm/i915: Fix fbc + rc6 combination on SNB Ben Widawsky
2013-11-02 0:02 ` [PATCH 2/2] drm/i915: Disable blt tracking of fbc when not used Ben Widawsky
2013-11-02 0:04 ` Ben Widawsky [this message]
2013-11-02 0:55 ` [PATCH 2/2] [v2] " Stéphane Marchesin
2013-11-02 8:52 ` [PATCH 1/2] drm/i915: Fix fbc + rc6 combination on SNB Chris Wilson
2013-11-02 16:10 ` Ville Syrjälä
2013-11-19 2:08 ` Rodrigo Vivi
2013-11-19 10:39 ` Daniel Vetter
2013-11-19 22:58 ` Stéphane Marchesin
2013-11-19 15:40 ` Ville Syrjälä
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=1383350661-7570-1-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