All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 8/9] drm/i915: Nuke crtc->plane
Date: Wed, 11 Oct 2017 19:04:54 +0300	[thread overview]
Message-ID: <20171011160455.1874-9-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20171011160455.1874-1-ville.syrjala@linux.intel.com>

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

Eliminate crtc->plane since it's pretty much a layering violation.
We can always get the plane via crtc->primary if we actually need it.

The only ugly thing left is plane_to_crtc_mapping[], but that's
still needed by the pre-g4x watermark code.

Also revise the comment about emum old_plane_id to make it clear
one should not use it for SKL+ ever.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      | 2 +-
 drivers/gpu/drm/i915/intel_display.c | 5 ++---
 drivers/gpu/drm/i915/intel_drv.h     | 1 -
 drivers/gpu/drm/i915/intel_fbc.c     | 4 ++--
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9c4735da2169..0b97860ba39c 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -305,7 +305,7 @@ static inline bool transcoder_is_dsi(enum transcoder transcoder)
 
 /*
  * Global legacy plane identifier. Valid only for primary/sprite
- * planes on pre-g4x, and only for primary planes on g4x+.
+ * planes on pre-g4x, and only for primary planes on g4x-bdw.
  */
 enum old_plane_id {
 	PLANE_A,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ccdfd922fe5b..622b487629d7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13386,14 +13386,13 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
 		goto fail;
 
 	intel_crtc->pipe = pipe;
-	intel_crtc->plane = primary->plane;
 
 	/* initialize shared scalers */
 	intel_crtc_init_scalers(intel_crtc, crtc_state);
 
 	BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
-	       dev_priv->plane_to_crtc_mapping[intel_crtc->plane] != NULL);
-	dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = intel_crtc;
+	       dev_priv->plane_to_crtc_mapping[primary->plane] != NULL);
+	dev_priv->plane_to_crtc_mapping[primary->plane] = intel_crtc;
 	dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
 
 	drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 0852b33712b1..8396d4de9299 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -793,7 +793,6 @@ struct intel_crtc_state {
 struct intel_crtc {
 	struct drm_crtc base;
 	enum pipe pipe;
-	enum old_plane_id plane;
 	/*
 	 * Whether the crtc and the connected output pipeline is active. Implies
 	 * that crtc->enabled is set, i.e. the current mode configuration has
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 0b40b89f8e2b..567f10380a0f 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -887,7 +887,7 @@ static void intel_fbc_get_reg_params(struct intel_crtc *crtc,
 	params->vma = cache->vma;
 
 	params->crtc.pipe = crtc->pipe;
-	params->crtc.plane = crtc->plane;
+	params->crtc.plane = to_intel_plane(crtc->base.primary)->plane;
 	params->crtc.fence_y_offset = get_crtc_fence_y_offset(crtc);
 
 	params->fb.format = cache->fb.format;
@@ -1083,7 +1083,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
 		if (fbc_on_pipe_a_only(dev_priv) && crtc->pipe != PIPE_A)
 			continue;
 
-		if (fbc_on_plane_a_only(dev_priv) && crtc->plane != PLANE_A)
+		if (fbc_on_plane_a_only(dev_priv) && plane->plane != PLANE_A)
 			continue;
 
 		crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
-- 
2.13.6

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

  parent reply	other threads:[~2017-10-11 16:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 16:04 [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Ville Syrjala
2017-10-11 16:04 ` [PATCH 1/9] drm/i915: Add .get_hw_state() method for planes Ville Syrjala
2017-10-12 18:59   ` Daniel Vetter
2017-10-13 10:31     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 2/9] drm/i915: Redo plane sanitation during readout Ville Syrjala
2017-10-12 19:03   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 3/9] drm/i915: s/enum plane/enum old_plane_id/ Ville Syrjala
2017-10-12 19:06   ` Daniel Vetter
2017-10-13 10:35     ` Ville Syrjälä
2017-10-16 15:57       ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 4/9] drm/i915: Use enum old_plane_id for the .get_fifo_size() hooks Ville Syrjala
2017-10-12 19:08   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 5/9] drm/i915: Cleanup enum pipe/enum plane_id/enum old_plane_id in initial fb readout Ville Syrjala
2017-10-12 19:11   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 6/9] drm/i915: Nuke ironlake_get_initial_plane_config() Ville Syrjala
2017-10-12 19:17   ` Daniel Vetter
2017-10-13 10:36     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 7/9] drm/i915: Switch fbc over to for_each_new_intel_plane_in_state() Ville Syrjala
2017-10-12 19:21   ` Daniel Vetter
2017-10-13 10:38     ` Ville Syrjälä
2017-10-11 16:04 ` Ville Syrjala [this message]
2017-10-12 19:38   ` [PATCH 8/9] drm/i915: Nuke crtc->plane Daniel Vetter
2017-10-13 10:41     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 9/9] drm/i915: Add windowing for primary planes on gen2/3 and chv Ville Syrjala
2017-10-12 19:42   ` Daniel Vetter
2017-10-11 16:21 ` [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Alex Villacis Lasso
2017-10-11 16:38   ` Ville Syrjälä
2017-10-13 16:28     ` Alex Villacis Lasso
     [not found]     ` <c5c1b3e5-4640-9df7-45a7-4228802142f9@hotmail.com>
2017-10-14  6:45       ` Alex Villacis Lasso
2017-10-16 14:55         ` Jani Nikula
2017-10-16 15:13         ` Alex Villacís Lasso
2017-10-11 17:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-11 23:43 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-12 11:35 ` [PATCH 0/9] " Thierry Reding
2017-10-12 12:19   ` Ville Syrjälä
2017-10-12 13:29     ` Thierry Reding

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=20171011160455.1874-9-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.