All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/3] drm/i915: Simplify flushing activity on the ring
Date: Tue, 27 Nov 2012 16:22:53 +0000	[thread overview]
Message-ID: <1354033374-9882-2-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1354033374-9882-1-git-send-email-chris@chris-wilson.co.uk>

As we now always preallocate the seqno before writing to the ring, we
can trivially test if we have any pending activity on the ring by
inspecting the olr. This makes it then possible to flush operations that
are not normally associated with a request, like power-management.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3b9b250..e594435 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2485,13 +2485,9 @@ static int i915_ring_idle(struct intel_ring_buffer *ring)
 	u32 seqno;
 	int ret;
 
-	/* We need to add any requests required to flush the objects */
-	if (!list_empty(&ring->active_list)) {
-		seqno = list_entry(ring->active_list.prev,
-				   struct drm_i915_gem_object,
-				   ring_list)->last_read_seqno;
-
-		ret = i915_gem_check_olr(ring, seqno);
+	/* We need to add any requests required to flush the objects and ring */
+	if (ring->outstanding_lazy_request) {
+		ret = i915_add_request(ring, NULL, NULL);
 		if (ret)
 			return ret;
 	}
-- 
1.7.10.4

  reply	other threads:[~2012-11-27 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 16:22 [PATCH 1/3] drm/i915: Preallocate next seqno before touching the ring Chris Wilson
2012-11-27 16:22 ` Chris Wilson [this message]
2012-11-27 16:22 ` [PATCH 3/3] drm/i915: Rearrange code to only have a single method for waiting upon " Chris Wilson
2012-11-27 21:16   ` Daniel Vetter

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=1354033374-9882-2-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.