intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@linux.intel.com, Dave Airlie <airlied@redhat.com>
Subject: [Intel-gfx] [PATCH 11/25] drm/i915/display: move pipe/plane mappings to display struct
Date: Tue,  7 Sep 2021 17:25:35 +1000	[thread overview]
Message-ID: <20210907072549.2962226-12-airlied@gmail.com> (raw)
In-Reply-To: <20210907072549.2962226-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/i915/display/intel_crtc.c          | 12 ++++++------
 drivers/gpu/drm/i915/display/intel_display_types.h |  8 ++++----
 drivers/gpu/drm/i915/i915_drv.h                    |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index 254e67141a77..2b7dd0c69e74 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -323,16 +323,16 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
 	if (ret)
 		goto fail;
 
-	BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
-	       dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
-	dev_priv->pipe_to_crtc_mapping[pipe] = crtc;
+	BUG_ON(pipe >= ARRAY_SIZE(dev_priv->display->pipe_to_crtc_mapping) ||
+	       dev_priv->display->pipe_to_crtc_mapping[pipe] != NULL);
+	dev_priv->display->pipe_to_crtc_mapping[pipe] = crtc;
 
 	if (DISPLAY_VER(dev_priv) < 9) {
 		enum i9xx_plane_id i9xx_plane = primary->i9xx_plane;
 
-		BUG_ON(i9xx_plane >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
-		       dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
-		dev_priv->plane_to_crtc_mapping[i9xx_plane] = crtc;
+		BUG_ON(i9xx_plane >= ARRAY_SIZE(dev_priv->display->plane_to_crtc_mapping) ||
+		       dev_priv->display->plane_to_crtc_mapping[i9xx_plane] != NULL);
+		dev_priv->display->plane_to_crtc_mapping[i9xx_plane] = crtc;
 	}
 
 	if (DISPLAY_VER(dev_priv) >= 11)
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index c7bcf9183447..8df06b6233b8 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1754,9 +1754,9 @@ vlv_pipe_to_channel(enum pipe pipe)
 static inline bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe)
 {
 	return (pipe >= 0 &&
-		pipe < ARRAY_SIZE(i915->pipe_to_crtc_mapping) &&
+		pipe < ARRAY_SIZE(i915->display->pipe_to_crtc_mapping) &&
 		INTEL_INFO(i915)->pipe_mask & BIT(pipe) &&
-		i915->pipe_to_crtc_mapping[pipe]);
+		i915->display->pipe_to_crtc_mapping[pipe]);
 }
 
 static inline struct intel_crtc *
@@ -1771,13 +1771,13 @@ intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
 	/* pipe_to_crtc_mapping may have hole on any of 3 display pipe system */
 	drm_WARN_ON(&dev_priv->drm,
 		    !(INTEL_INFO(dev_priv)->pipe_mask & BIT(pipe)));
-	return dev_priv->pipe_to_crtc_mapping[pipe];
+	return dev_priv->display->pipe_to_crtc_mapping[pipe];
 }
 
 static inline struct intel_crtc *
 intel_get_crtc_for_plane(struct drm_i915_private *dev_priv, enum i9xx_plane_id plane)
 {
-	return dev_priv->plane_to_crtc_mapping[plane];
+	return dev_priv->display->plane_to_crtc_mapping[plane];
 }
 
 struct intel_load_detect_pipe {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index b94f25eb6ce5..1abeda306d05 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -869,6 +869,9 @@ struct drm_i915_display {
 	struct intel_dmc dmc;
 	struct i915_drrs drrs;
 	struct intel_fbc fbc;
+
+	struct intel_crtc *plane_to_crtc_mapping[I915_MAX_PIPES];
+	struct intel_crtc *pipe_to_crtc_mapping[I915_MAX_PIPES];
 };
 
 struct drm_i915_private {
@@ -995,9 +998,6 @@ struct drm_i915_private {
 
 	/* Kernel Modesetting */
 
-	struct intel_crtc *plane_to_crtc_mapping[I915_MAX_PIPES];
-	struct intel_crtc *pipe_to_crtc_mapping[I915_MAX_PIPES];
-
 	/**
 	 * dpll and cdclk state is protected by connection_mutex
 	 * dpll.lock serializes intel_{prepare,enable,disable}_shared_dpll.
-- 
2.31.1


  parent reply	other threads:[~2021-09-07  7:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07  7:25 [Intel-gfx] [RFC PATCH 00/25] refactor display struct Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 01/25] drm/i915: move display funcs into a display struct. (v3) Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 02/25] drm/i915/display: move cdclk info into display Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 03/25] drm/i915: move more pll/clocks into display struct Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 04/25] drm/i915/display: move gmbus " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 05/25] drm/i915/display: move intel_dmc " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 06/25] drm/i915/display: move mipi_mmio_base to " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 07/25] drm/i915/display: move pps_mmio_base " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 08/25] drm/i915/drrs: just use some local vars to simplify drrs code Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 09/25] drm/i915/display: move drrs into display struct Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 10/25] drm/i915/display: move fbc " Dave Airlie
2021-09-07  7:25 ` Dave Airlie [this message]
2021-09-07  7:25 ` [Intel-gfx] [PATCH 12/25] drm/i915/display: move properties " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 13/25] drm/i915/display: move audio related members " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 14/25] drm/i915/display: move HDCP related items " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 15/25] drm/i915/display: move hotplug struct to " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 16/25] drm/i915/display: move overlay into " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 17/25] drm/i915/display: move fbdev info to " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 18/25] drm/i915/display: move fb_tracking " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 19/25] drm/i915/display: move delay and pch values " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 20/25] drm/intel/display: move atomic related things to display Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 21/25] drm/i915/display: move a bunch of platform misc regs " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 22/25] drm/i915/display: move dpll struct into display Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 23/25] drm/i915/display: move fdi_rx_config into display struct Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 24/25] drm/i915/display: move workqueues to " Dave Airlie
2021-09-07  7:25 ` [Intel-gfx] [PATCH 25/25] drm/i915/display: move pps/backlight mutexes into display Dave Airlie
2021-09-07  7:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for refactor display struct Patchwork
2021-09-07  8:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-07 10:19 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=20210907072549.2962226-12-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /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).