All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 1/4] drm/i915/fbc: update busy_bits even for GTT and flip flushes
Date: Mon,  4 Apr 2016 18:17:15 -0300	[thread overview]
Message-ID: <1459804638-3588-2-git-send-email-paulo.r.zanoni@intel.com> (raw)
In-Reply-To: <1459804638-3588-1-git-send-email-paulo.r.zanoni@intel.com>

We ignore ORIGIN_GTT because the hardware tracking can recognize GTT
writes and take care of them. We also ignore ORIGIN_FLIP because we
deal with flips without relying on the frontbuffer tracking
infrastructure. On the other hand, a flush is a flush and means we're
good to go, so we need to update busy_bits in order to reflect that,
even if we're not going to do anything else about it.

How to reproduce the bug fixed by this patch:
 - boot SKL up to the desktop environment
 - stop the display manager
 - run any of the igt/kms_frontbuffer_tracking/*fbc*onoff* subtests
 - the tests will fail

The steps above will create the right conditions for us to lose track
of busy_bits. If you, for example, run the full set of FBC tests, the
onoff subtests will succeed.

Also notice that the "bug" is that we'll just keep FBC disabled on
cases where it could be enabled, so it's not something the users can
perceive, it just affects power consumption numbers on properly
configured machines.

Testcase: igt/kms_frontbuffer_tracking/*fbc*onoff* (see above)
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index d5a7cfe..fc3c094 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -997,13 +997,13 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
 	if (!fbc_supported(dev_priv))
 		return;
 
-	if (origin == ORIGIN_GTT || origin == ORIGIN_FLIP)
-		return;
-
 	mutex_lock(&fbc->lock);
 
 	fbc->busy_bits &= ~frontbuffer_bits;
 
+	if (origin == ORIGIN_GTT || origin == ORIGIN_FLIP)
+		goto out;
+
 	if (!fbc->busy_bits && fbc->enabled &&
 	    (frontbuffer_bits & intel_fbc_get_frontbuffer_bit(fbc))) {
 		if (fbc->active)
@@ -1012,6 +1012,7 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
 			__intel_fbc_post_update(fbc->crtc);
 	}
 
+out:
 	mutex_unlock(&fbc->lock);
 }
 
-- 
2.8.0.rc3

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

  reply	other threads:[~2016-04-04 21:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 21:17 [PATCH 0/4] Enable FBC on SKL, v3 Paulo Zanoni
2016-04-04 21:17 ` Paulo Zanoni [this message]
2016-04-04 21:17 ` [PATCH 2/4] drm/i915/fbc: sanitize i915.enable_fbc during FBC init Paulo Zanoni
2016-04-06 14:19   ` Chris Wilson
2016-04-13 19:01     ` Paulo Zanoni
2016-04-25  8:10       ` Daniel Vetter
2016-04-04 21:17 ` [PATCH 3/4] drm/i915: use ORIGIN_CPU for frontbuffer invalidation on WC mmaps Paulo Zanoni
2016-04-25  8:15   ` [Intel-gfx] " Daniel Vetter
2016-04-25  8:20     ` Chris Wilson
2016-04-25  8:27       ` Daniel Vetter
2016-06-09 18:59         ` Paulo Zanoni
2016-06-17 17:46           ` Paulo Zanoni
2016-04-04 21:17 ` [PATCH 4/4] drm/i915/fbc: enable FBC on gen 9+ too Paulo Zanoni
2016-04-13 19:01   ` Paulo Zanoni
2016-04-25  8:28     ` Daniel Vetter
2016-06-17 16:39       ` [PATCH] drm/i915/fbc: FBC causes display flicker when VT-d is enabled on Skylake Chris Wilson
2016-06-17 19:02         ` Zanoni, Paulo R
2016-06-17 19:23           ` chris
2016-06-17 19:34         ` Ville Syrjälä
2016-06-17 19:45         ` [PATCH v2] " Chris Wilson
2016-06-21  7:25           ` [PATCH v3] " Chris Wilson
2016-06-21 13:31             ` Daniel Vetter
2016-06-22 20:34               ` Chris Wilson
2016-06-22 22:18                 ` Zanoni, Paulo R
2016-06-22 22:15             ` Zanoni, Paulo R
2016-06-23  8:41               ` Jani Nikula
2016-04-04 21:18 ` [PATCH igt 1/3] kms_frontbuffer_tracking: prefer the BLT drawing method Paulo Zanoni
2016-04-04 21:18   ` [PATCH igt 2/3] kms_frontbuffer_tracking: recreate the FBs at every subtest Paulo Zanoni
2016-04-04 21:18   ` [PATCH igt 3/3] kms_frontbuffer_tracking: properly handle mixing GTT and WC mmaps Paulo Zanoni
2016-04-06  5:06 ` [PATCH 0/4] Enable FBC on SKL, v3 Thulasimani, Sivakumar
2016-04-06 13:54   ` Zanoni, Paulo R
2016-04-06 16:11     ` Thulasimani, Sivakumar
2016-04-14 14:53 ` ✓ Fi.CI.BAT: success for Enable FBC on SKL (rev4) Patchwork
2016-06-10  5:54 ` ✓ Ro.CI.BAT: success for Enable FBC on SKL (rev5) Patchwork
2016-06-17 16:45 ` ✗ Ro.CI.BAT: failure for Enable FBC on SKL (rev6) Patchwork
2016-06-18  5:48 ` ✗ Ro.CI.BAT: failure for Enable FBC on SKL (rev8) Patchwork
2016-06-21  7:30 ` ✗ Ro.CI.BAT: failure for Enable FBC on SKL (rev9) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-03-24 19:16 [PATCH 0/4] Enable FBC on SKL, v2 Paulo Zanoni
2016-03-24 19:16 ` [PATCH 1/4] drm/i915/fbc: update busy_bits even for GTT and flip flushes Paulo Zanoni
2016-03-21 19:26 [PATCH 0/4] Enable FBC on SKL Paulo Zanoni
2016-03-21 19:26 ` [PATCH 1/4] drm/i915/fbc: update busy_bits even for GTT and flip flushes Paulo Zanoni
2016-03-22 11:13   ` Daniel Vetter
2016-03-22 21:33     ` Zanoni, Paulo R

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=1459804638-3588-2-git-send-email-paulo.r.zanoni@intel.com \
    --to=paulo.r.zanoni@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 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.