All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/9] drm/i915: Remove some duplicated plane swapping logic
Date: Tue,  8 Nov 2016 16:47:11 +0200	[thread overview]
Message-ID: <1478616439-10150-2-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1478616439-10150-1-git-send-email-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

On pre-gen4 we connect plane A to pipe B and vice versa to get an FBC
capable plane feeding the LVDS port by default. We have the logic for
the plane swapping duplicated in many places. Let's remove a bit of the
duplication by having the crtc look up the thing from the primary plane.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0bb24b4e8815..10869360cfdc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15000,11 +15000,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 		state->scaler_id = -1;
 	}
 	primary->pipe = pipe;
-	primary->plane = pipe;
+	/*
+	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
+	 * port is hooked to pipe B. Hence we want plane A feeding pipe B.
+	 */
+	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
+		primary->plane = (enum plane) !pipe;
+	else
+		primary->plane = (enum plane) pipe;
 	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
 	primary->check_plane = intel_check_primary_plane;
-	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
-		primary->plane = !pipe;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
 		intel_primary_formats = skl_primary_formats;
@@ -15310,16 +15315,8 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
 	if (ret)
 		goto fail;
 
-	/*
-	 * On gen2/3 only plane A can do fbc, but the panel fitter and lvds port
-	 * is hooked to pipe B. Hence we want plane A feeding pipe B.
-	 */
 	intel_crtc->pipe = pipe;
-	intel_crtc->plane = (enum plane) pipe;
-	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4) {
-		DRM_DEBUG_KMS("swapping pipes & planes for FBC\n");
-		intel_crtc->plane = !pipe;
-	}
+	intel_crtc->plane = primary->plane;
 
 	intel_crtc->cursor_base = ~0;
 	intel_crtc->cursor_cntl = ~0;
-- 
2.7.4

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

  reply	other threads:[~2016-11-08 14:47 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 14:47 [PATCH 0/9] drm/i915: Add a per-pipe plane identifier enum ville.syrjala
2016-11-08 14:47 ` ville.syrjala [this message]
2016-11-08 15:23   ` [PATCH 1/9] drm/i915: Remove some duplicated plane swapping logic Chris Wilson
2016-11-08 15:42     ` Ville Syrjälä
2016-11-14 18:32     ` Ville Syrjälä
2016-11-08 14:47 ` [PATCH 2/9] drm/i915: Add per-pipe plane identifier ville.syrjala
2016-11-08 15:26   ` Chris Wilson
2016-11-08 15:38     ` Ville Syrjälä
2016-11-09  0:53   ` Matt Roper
2016-11-09 13:23     ` Ville Syrjälä
2016-11-17 19:09   ` Paulo Zanoni
2016-11-17 19:43     ` Ville Syrjälä
2016-11-18 14:17       ` Paulo Zanoni
2016-11-18 14:32         ` Ville Syrjälä
2016-11-18 20:40           ` Paulo Zanoni
2016-11-18 19:16     ` Matt Roper
2016-11-08 14:47 ` [PATCH 3/9] drm/i915: Add crtc->plane_ids_mask ville.syrjala
2016-11-17 19:11   ` Paulo Zanoni
2016-11-08 14:47 ` [PATCH 4/9] drm/i915: Use enum plane_id in SKL wm code ville.syrjala
2016-11-08 17:08   ` [PATCH v2 " ville.syrjala
2016-11-09 15:03   ` [PATCH v3 " ville.syrjala
2016-11-17 19:12     ` Paulo Zanoni
2016-11-17 20:04       ` Ville Syrjälä
2016-11-08 14:47 ` [PATCH 5/9] drm/i915: Use enum plane_id in SKL plane code ville.syrjala
2016-11-17 19:32   ` Paulo Zanoni
2016-11-08 14:47 ` [PATCH 6/9] drm/i915: Use enum plane_id in VLV/CHV sprite code ville.syrjala
2016-11-08 16:04   ` Chris Wilson
2016-11-08 16:56     ` Ville Syrjälä
2016-11-08 17:09   ` [PATCH v2 " ville.syrjala
2016-11-17 20:07     ` Paulo Zanoni
2016-11-17 20:19       ` Ville Syrjälä
2016-11-08 14:47 ` [PATCH 7/9] drm/i915: Use enum plane_id in VLV/CHV wm code ville.syrjala
2016-11-17 20:17   ` Paulo Zanoni
2016-11-17 20:29   ` Paulo Zanoni
2016-11-17 20:39     ` Ville Syrjälä
2016-11-08 14:47 ` [PATCH 8/9] drm/i915: Rename the local 'plane' variable to 'plane_id' in primary plane code ville.syrjala
2016-11-18 14:25   ` Paulo Zanoni
2016-11-18 14:34     ` Ville Syrjälä
2016-11-18 20:41       ` Paulo Zanoni
2016-11-18 21:39         ` Ville Syrjälä
2016-11-08 14:47 ` [PATCH 9/9] drm/i915: Don't populate plane->plane for cursors and sprites ville.syrjala
2016-11-08 15:30   ` Chris Wilson
2016-11-08 15:40     ` Ville Syrjälä
2016-11-08 15:45 ` ✗ Fi.CI.BAT: warning for drm/i915: Add a per-pipe plane identifier enum Patchwork
2016-11-08 17:45 ` ✗ Fi.CI.BAT: warning for drm/i915: Add a per-pipe plane identifier enum (rev3) Patchwork
2016-11-09 16:24 ` ✗ Fi.CI.BAT: warning for drm/i915: Add a per-pipe plane identifier enum (rev4) Patchwork
2016-11-14 18:11   ` Ville Syrjälä
2016-11-15 10:47     ` Imre Deak

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=1478616439-10150-2-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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.