intel-gfx.lists.freedesktop.org archive mirror
 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 2/4] drm/i915/fbc: sanitize i915.enable_fbc during FBC init
Date: Thu, 24 Mar 2016 16:16:10 -0300	[thread overview]
Message-ID: <1458846972-20338-4-git-send-email-paulo.r.zanoni@intel.com> (raw)
In-Reply-To: <1458846972-20338-1-git-send-email-paulo.r.zanoni@intel.com>

The DDX driver changes its behavior depending on the value it reads
from i915.enable_fbc, so sanitize the value in order to allow it to
know what's going on. It uses this in order to choose the defaults for
the TearFree option. Before this patch, it will read -1 and always
assume that FBC is disabled, so it won't force TearFree.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index b8ba79c..7101880 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -823,21 +823,14 @@ static bool intel_fbc_can_choose(struct intel_crtc *crtc)
 {
 	struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
 	struct intel_fbc *fbc = &dev_priv->fbc;
-	bool enable_by_default = IS_HASWELL(dev_priv) ||
-				 IS_BROADWELL(dev_priv);
 
 	if (intel_vgpu_active(dev_priv->dev)) {
 		fbc->no_fbc_reason = "VGPU is active";
 		return false;
 	}
 
-	if (i915.enable_fbc < 0 && !enable_by_default) {
-		fbc->no_fbc_reason = "disabled per chip default";
-		return false;
-	}
-
 	if (!i915.enable_fbc) {
-		fbc->no_fbc_reason = "disabled per module param";
+		fbc->no_fbc_reason = "disabled per module param or by default";
 		return false;
 	}
 
@@ -1239,6 +1232,16 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
 	fbc->active = false;
 	fbc->work.scheduled = false;
 
+	/* The DDX driver changes its behavior depending on the value it reads
+	 * from i915.enable_fbc, so sanitize the value in order to allow it to
+	 * know what's going on. */
+	if (i915.enable_fbc < 0) {
+		i915.enable_fbc = IS_HASWELL(dev_priv) ||
+				  IS_BROADWELL(dev_priv);
+		DRM_DEBUG_KMS("Sanitized enable_fbc value: %d\n",
+			      i915.enable_fbc);
+	}
+
 	if (!HAS_FBC(dev_priv)) {
 		fbc->no_fbc_reason = "unsupported by this chipset";
 		return;
-- 
2.7.0

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

  parent reply	other threads:[~2016-03-24 19:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-24 19:16 ` [PATCH xf86-video-intel] sna: Opt-out of the Kernel mmap workaround Paulo Zanoni
2016-03-24 19:16 ` Paulo Zanoni [this message]
2016-03-24 19:16 ` [PATCH 3/4] drm/i915: opt-out CPU and WC mmaps from FBC Paulo Zanoni
2016-03-24 19:31   ` Chris Wilson
2016-03-24 20:53     ` Zanoni, Paulo R
2016-03-24 21:03       ` chris
2016-03-24 21:20         ` chris
2016-03-25 14:05           ` Zanoni, Paulo R
2016-03-25 14:17             ` chris
2016-03-29 11:55             ` Daniel Vetter
2016-03-29 12:24               ` chris
2016-03-24 21:21         ` Zanoni, Paulo R
2016-03-24 21:58           ` chris
2016-03-24 19:16 ` [PATCH 4/4] drm/i915/fbc: enable FBC on gen 9+ too Paulo Zanoni
2016-03-25  9:02 ` ✗ Fi.CI.BAT: failure for sna: Opt-out of the Kernel mmap workaround Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-04-04 21:17 [PATCH 0/4] Enable FBC on SKL, v3 Paulo Zanoni
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-03-21 19:26 [PATCH 0/4] Enable FBC on SKL Paulo Zanoni
2016-03-21 19:26 ` [PATCH 2/4] drm/i915/fbc: sanitize i915.enable_fbc during FBC init Paulo Zanoni

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=1458846972-20338-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).