All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers
@ 2021-06-09  8:56 Ville Syrjala
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask() Ville Syrjala
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Finish the s/intel_crtc/crtc/ conversion we started long ago,
and do a bit of other related house cleaning.

Ville Syrjälä (6):
  drm/i915: Stop hand rolling drm_crtc_mask()
  drm/i915: Clean up intel_get_load_detect_pipe() a bit
  drm/i915: Clean up intel_find_initial_plane_obj() a bit
  drm/i915: Clean up pre-skl wm calling convention
  drm/i915: Clean up intel_fbdev_init_bios() a bit
  drm/i915: s/intel_crtc/crtc/

 drivers/gpu/drm/i915/display/icl_dsi.c        |   4 +-
 drivers/gpu/drm/i915/display/intel_crtc.c     |   8 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      |   6 +-
 drivers/gpu/drm/i915/display/intel_display.c  | 168 +++++++++---------
 .../drm/i915/display/intel_display_debugfs.c  |  28 +--
 drivers/gpu/drm/i915/display/intel_dp.c       |   4 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c   |   4 +-
 drivers/gpu/drm/i915/display/intel_fbdev.c    |  94 ++++++----
 drivers/gpu/drm/i915/display/intel_fdi.c      |  20 +--
 drivers/gpu/drm/i915/display/intel_hdmi.c     |  42 +++--
 drivers/gpu/drm/i915/display/intel_lvds.c     |   4 +-
 drivers/gpu/drm/i915/display/intel_sdvo.c     |   4 +-
 drivers/gpu/drm/i915/display/intel_tv.c       |  13 +-
 drivers/gpu/drm/i915/display/skl_scaler.c     |  27 ++-
 drivers/gpu/drm/i915/display/vlv_dsi.c        |  13 +-
 drivers/gpu/drm/i915/i915_drv.h               |   6 +-
 drivers/gpu/drm/i915/i915_irq.c               |  22 +--
 drivers/gpu/drm/i915/intel_pm.c               |  97 +++++-----
 18 files changed, 296 insertions(+), 268 deletions(-)

-- 
2.31.1

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask()
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:25   ` Rodrigo Vivi
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit Ville Syrjala
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Use drm_crtc_mask() instead of hand rolling it.

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

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 362bff9beb5c..62ad4cfae073 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6485,7 +6485,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	struct drm_atomic_state *state = NULL, *restore_state = NULL;
 	struct drm_connector_state *connector_state;
 	struct intel_crtc_state *crtc_state;
-	int ret, i = -1;
+	int ret;
 
 	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
 		    connector->base.id, connector->name,
@@ -6519,8 +6519,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 
 	/* Find an unused one (if possible) */
 	for_each_crtc(dev, possible_crtc) {
-		i++;
-		if (!(encoder->possible_crtcs & (1 << i)))
+		if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
 			continue;
 
 		ret = drm_modeset_lock(&possible_crtc->mutex, ctx);
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask() Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:27   ` Rodrigo Vivi
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() " Ville Syrjala
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Sort out the mess with the local variables in
intel_get_load_detect_pipe(). Get rid of all aliasing pointers
and use standard naming/types.

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

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 62ad4cfae073..78815a1ac0ca 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6473,13 +6473,11 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 			       struct intel_load_detect_pipe *old,
 			       struct drm_modeset_acquire_ctx *ctx)
 {
-	struct intel_crtc *intel_crtc;
-	struct intel_encoder *intel_encoder =
+	struct intel_encoder *encoder =
 		intel_attached_encoder(to_intel_connector(connector));
-	struct drm_crtc *possible_crtc;
-	struct drm_encoder *encoder = &intel_encoder->base;
-	struct drm_crtc *crtc = NULL;
-	struct drm_device *dev = encoder->dev;
+	struct intel_crtc *possible_crtc;
+	struct intel_crtc *crtc = NULL;
+	struct drm_device *dev = encoder->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct drm_mode_config *config = &dev->mode_config;
 	struct drm_atomic_state *state = NULL, *restore_state = NULL;
@@ -6489,7 +6487,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 
 	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
 		    connector->base.id, connector->name,
-		    encoder->base.id, encoder->name);
+		    encoder->base.base.id, encoder->base.name);
 
 	old->restore_state = NULL;
 
@@ -6507,9 +6505,9 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 
 	/* See if we already have a CRTC for this connector */
 	if (connector->state->crtc) {
-		crtc = connector->state->crtc;
+		crtc = to_intel_crtc(connector->state->crtc);
 
-		ret = drm_modeset_lock(&crtc->mutex, ctx);
+		ret = drm_modeset_lock(&crtc->base.mutex, ctx);
 		if (ret)
 			goto fail;
 
@@ -6518,16 +6516,17 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	}
 
 	/* Find an unused one (if possible) */
-	for_each_crtc(dev, possible_crtc) {
-		if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
+	for_each_intel_crtc(dev, possible_crtc) {
+		if (!(encoder->base.possible_crtcs &
+		      drm_crtc_mask(&possible_crtc->base)))
 			continue;
 
-		ret = drm_modeset_lock(&possible_crtc->mutex, ctx);
+		ret = drm_modeset_lock(&possible_crtc->base.mutex, ctx);
 		if (ret)
 			goto fail;
 
-		if (possible_crtc->state->enable) {
-			drm_modeset_unlock(&possible_crtc->mutex);
+		if (possible_crtc->base.state->enable) {
+			drm_modeset_unlock(&possible_crtc->base.mutex);
 			continue;
 		}
 
@@ -6546,8 +6545,6 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	}
 
 found:
-	intel_crtc = to_intel_crtc(crtc);
-
 	state = drm_atomic_state_alloc(dev);
 	restore_state = drm_atomic_state_alloc(dev);
 	if (!state || !restore_state) {
@@ -6564,11 +6561,11 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 		goto fail;
 	}
 
-	ret = drm_atomic_set_crtc_for_connector(connector_state, crtc);
+	ret = drm_atomic_set_crtc_for_connector(connector_state, &crtc->base);
 	if (ret)
 		goto fail;
 
-	crtc_state = intel_atomic_get_crtc_state(state, intel_crtc);
+	crtc_state = intel_atomic_get_crtc_state(state, crtc);
 	if (IS_ERR(crtc_state)) {
 		ret = PTR_ERR(crtc_state);
 		goto fail;
@@ -6581,15 +6578,15 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	if (ret)
 		goto fail;
 
-	ret = intel_modeset_disable_planes(state, crtc);
+	ret = intel_modeset_disable_planes(state, &crtc->base);
 	if (ret)
 		goto fail;
 
 	ret = PTR_ERR_OR_ZERO(drm_atomic_get_connector_state(restore_state, connector));
 	if (!ret)
-		ret = PTR_ERR_OR_ZERO(drm_atomic_get_crtc_state(restore_state, crtc));
+		ret = PTR_ERR_OR_ZERO(drm_atomic_get_crtc_state(restore_state, &crtc->base));
 	if (!ret)
-		ret = drm_atomic_add_affected_planes(restore_state, crtc);
+		ret = drm_atomic_add_affected_planes(restore_state, &crtc->base);
 	if (ret) {
 		drm_dbg_kms(&dev_priv->drm,
 			    "Failed to create a copy of old state to restore: %i\n",
@@ -6608,7 +6605,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	drm_atomic_state_put(state);
 
 	/* let the connector get through one full cycle before testing */
-	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
 	return true;
 
 fail:
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() a bit
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask() Ville Syrjala
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:36   ` Rodrigo Vivi
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention Ville Syrjala
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Sort out the mess with the local variables in
intel_find_initial_plane_obj(). Get rid of all aliasing pointers
and use standard naming/types.

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

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 78815a1ac0ca..1615501685c9 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1914,20 +1914,50 @@ static void intel_dpt_unpin(struct i915_address_space *vm)
 	i915_vma_put(dpt->vma);
 }
 
+static bool
+intel_reuse_initial_plane_obj(struct drm_i915_private *i915,
+			      const struct intel_initial_plane_config *plane_config,
+			      struct drm_framebuffer **fb,
+			      struct i915_vma **vma)
+{
+	struct intel_crtc *crtc;
+
+	for_each_intel_crtc(&i915->drm, crtc) {
+		struct intel_crtc_state *crtc_state =
+			to_intel_crtc_state(crtc->base.state);
+		struct intel_plane *plane =
+			to_intel_plane(crtc->base.primary);
+		struct intel_plane_state *plane_state =
+			to_intel_plane_state(plane->base.state);
+
+		if (!crtc_state->uapi.active)
+			continue;
+
+		if (!plane_state->ggtt_vma)
+			continue;
+
+		if (intel_plane_ggtt_offset(plane_state) == plane_config->base) {
+			*fb = plane_state->hw.fb;
+			*vma = plane_state->ggtt_vma;
+			return true;
+		}
+	}
+
+	return false;
+}
+
 static void
-intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
+intel_find_initial_plane_obj(struct intel_crtc *crtc,
 			     struct intel_initial_plane_config *plane_config)
 {
-	struct drm_device *dev = intel_crtc->base.dev;
+	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	struct drm_crtc *c;
-	struct drm_plane *primary = intel_crtc->base.primary;
-	struct drm_plane_state *plane_state = primary->state;
-	struct intel_plane *intel_plane = to_intel_plane(primary);
-	struct intel_plane_state *intel_state =
-		to_intel_plane_state(plane_state);
 	struct intel_crtc_state *crtc_state =
-		to_intel_crtc_state(intel_crtc->base.state);
+		to_intel_crtc_state(crtc->base.state);
+	struct intel_plane *plane =
+		to_intel_plane(crtc->base.primary);
+	struct intel_plane_state *plane_state =
+		to_intel_plane_state(plane->base.state);
 	struct drm_framebuffer *fb;
 	struct i915_vma *vma;
 
@@ -1939,7 +1969,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	if (!plane_config->fb)
 		return;
 
-	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
+	if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
 		fb = &plane_config->fb->base;
 		vma = plane_config->vma;
 		goto valid_fb;
@@ -1949,25 +1979,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	 * Failed to alloc the obj, check to see if we should share
 	 * an fb with another CRTC instead
 	 */
-	for_each_crtc(dev, c) {
-		struct intel_plane_state *state;
-
-		if (c == &intel_crtc->base)
-			continue;
-
-		if (!to_intel_crtc_state(c->state)->uapi.active)
-			continue;
-
-		state = to_intel_plane_state(c->primary->state);
-		if (!state->ggtt_vma)
-			continue;
-
-		if (intel_plane_ggtt_offset(state) == plane_config->base) {
-			fb = state->hw.fb;
-			vma = state->ggtt_vma;
-			goto valid_fb;
-		}
-	}
+	if (intel_reuse_initial_plane_obj(dev_priv, plane_config, &fb, &vma))
+		goto valid_fb;
 
 	/*
 	 * We've failed to reconstruct the BIOS FB.  Current display state
@@ -1976,7 +1989,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	 * simplest solution is to just disable the primary plane now and
 	 * pretend the BIOS never had it enabled.
 	 */
-	intel_plane_disable_noatomic(intel_crtc, intel_plane);
+	intel_plane_disable_noatomic(crtc, plane);
 	if (crtc_state->bigjoiner) {
 		struct intel_crtc *slave =
 			crtc_state->bigjoiner_linked_crtc;
@@ -1986,40 +1999,38 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	return;
 
 valid_fb:
-	plane_state->rotation = plane_config->rotation;
-	intel_fb_fill_view(to_intel_framebuffer(fb), plane_state->rotation,
-			   &intel_state->view);
+	plane_state->uapi.rotation = plane_config->rotation;
+	intel_fb_fill_view(to_intel_framebuffer(fb),
+			   plane_state->uapi.rotation, &plane_state->view);
 
 	__i915_vma_pin(vma);
-	intel_state->ggtt_vma = i915_vma_get(vma);
-	if (intel_plane_uses_fence(intel_state) && i915_vma_pin_fence(vma) == 0)
-		if (vma->fence)
-			intel_state->flags |= PLANE_HAS_FENCE;
+	plane_state->ggtt_vma = i915_vma_get(vma);
+	if (intel_plane_uses_fence(plane_state) &&
+	    i915_vma_pin_fence(vma) == 0 && vma->fence)
+		plane_state->flags |= PLANE_HAS_FENCE;
 
-	plane_state->src_x = 0;
-	plane_state->src_y = 0;
-	plane_state->src_w = fb->width << 16;
-	plane_state->src_h = fb->height << 16;
+	plane_state->uapi.src_x = 0;
+	plane_state->uapi.src_y = 0;
+	plane_state->uapi.src_w = fb->width << 16;
+	plane_state->uapi.src_h = fb->height << 16;
 
-	plane_state->crtc_x = 0;
-	plane_state->crtc_y = 0;
-	plane_state->crtc_w = fb->width;
-	plane_state->crtc_h = fb->height;
+	plane_state->uapi.crtc_x = 0;
+	plane_state->uapi.crtc_y = 0;
+	plane_state->uapi.crtc_w = fb->width;
+	plane_state->uapi.crtc_h = fb->height;
 
 	if (plane_config->tiling)
 		dev_priv->preserve_bios_swizzle = true;
 
-	plane_state->fb = fb;
+	plane_state->uapi.fb = fb;
 	drm_framebuffer_get(fb);
 
-	plane_state->crtc = &intel_crtc->base;
-	intel_plane_copy_uapi_to_hw_state(intel_state, intel_state,
-					  intel_crtc);
+	plane_state->uapi.crtc = &crtc->base;
+	intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
 
 	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
 
-	atomic_or(to_intel_plane(primary)->frontbuffer_bit,
-		  &to_intel_frontbuffer(fb)->bits);
+	atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
 }
 
 unsigned int
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (2 preceding siblings ...)
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() " Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:44   ` Rodrigo Vivi
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit Ville Syrjala
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Just pass the full atomic state+crtc to the pre-skl watermark
functions, and clean up the types/variable names around the area.

Note that having both .compute_pipe_wm() and .compute_intermediate_wm()
is entirely redundant now. We could unify them to a single vfunc.
But let's do this one step at a time.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c |  5 +-
 drivers/gpu/drm/i915/i915_drv.h              |  6 +-
 drivers/gpu/drm/i915/intel_pm.c              | 97 ++++++++++----------
 3 files changed, 58 insertions(+), 50 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 1615501685c9..62221243fca9 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -7288,12 +7288,13 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
 	}
 
 	if (dev_priv->display.compute_pipe_wm) {
-		ret = dev_priv->display.compute_pipe_wm(crtc_state);
+		ret = dev_priv->display.compute_pipe_wm(state, crtc);
 		if (ret) {
 			drm_dbg_kms(&dev_priv->drm,
 				    "Target pipe watermarks are invalid\n");
 			return ret;
 		}
+
 	}
 
 	if (dev_priv->display.compute_intermediate_wm) {
@@ -7306,7 +7307,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
 		 * old state and the new state.  We can program these
 		 * immediately.
 		 */
-		ret = dev_priv->display.compute_intermediate_wm(crtc_state);
+		ret = dev_priv->display.compute_intermediate_wm(state, crtc);
 		if (ret) {
 			drm_dbg_kms(&dev_priv->drm,
 				    "No valid intermediate pipe watermarks are possible\n");
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 38ff2fb89744..e9cf0eaad7f8 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -270,8 +270,10 @@ struct drm_i915_display_funcs {
 	int (*bw_calc_min_cdclk)(struct intel_atomic_state *state);
 	int (*get_fifo_size)(struct drm_i915_private *dev_priv,
 			     enum i9xx_plane_id i9xx_plane);
-	int (*compute_pipe_wm)(struct intel_crtc_state *crtc_state);
-	int (*compute_intermediate_wm)(struct intel_crtc_state *crtc_state);
+	int (*compute_pipe_wm)(struct intel_atomic_state *state,
+			       struct intel_crtc *crtc);
+	int (*compute_intermediate_wm)(struct intel_atomic_state *state,
+				       struct intel_crtc *crtc);
 	void (*initial_watermarks)(struct intel_atomic_state *state,
 				   struct intel_crtc *crtc);
 	void (*atomic_update_watermarks)(struct intel_atomic_state *state,
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7ce9537fa2c7..dd682c64daf0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1370,11 +1370,11 @@ static bool g4x_compute_fbc_en(const struct g4x_wm_state *wm_state,
 	return true;
 }
 
-static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
+static int g4x_compute_pipe_wm(struct intel_atomic_state *state,
+			       struct intel_crtc *crtc)
 {
-	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	struct intel_atomic_state *state =
-		to_intel_atomic_state(crtc_state->uapi.state);
+	struct intel_crtc_state *crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
 	struct g4x_wm_state *wm_state = &crtc_state->wm.g4x.optimal;
 	int num_active_planes = hweight8(crtc_state->active_planes &
 					 ~BIT(PLANE_CURSOR));
@@ -1451,20 +1451,21 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
 	return 0;
 }
 
-static int g4x_compute_intermediate_wm(struct intel_crtc_state *new_crtc_state)
+static int g4x_compute_intermediate_wm(struct intel_atomic_state *state,
+				       struct intel_crtc *crtc)
 {
-	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	struct intel_crtc_state *new_crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
 	struct g4x_wm_state *intermediate = &new_crtc_state->wm.g4x.intermediate;
 	const struct g4x_wm_state *optimal = &new_crtc_state->wm.g4x.optimal;
-	struct intel_atomic_state *intel_state =
-		to_intel_atomic_state(new_crtc_state->uapi.state);
-	const struct intel_crtc_state *old_crtc_state =
-		intel_atomic_get_old_crtc_state(intel_state, crtc);
 	const struct g4x_wm_state *active = &old_crtc_state->wm.g4x.optimal;
 	enum plane_id plane_id;
 
-	if (!new_crtc_state->hw.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
+	if (!new_crtc_state->hw.active ||
+	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
 		*intermediate = *optimal;
 
 		intermediate->cxsr = false;
@@ -1890,12 +1891,12 @@ static bool vlv_raw_crtc_wm_is_valid(const struct intel_crtc_state *crtc_state,
 		vlv_raw_plane_wm_is_valid(crtc_state, PLANE_CURSOR, level);
 }
 
-static int vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state)
+static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
+			       struct intel_crtc *crtc)
 {
-	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-	struct intel_atomic_state *state =
-		to_intel_atomic_state(crtc_state->uapi.state);
+	struct intel_crtc_state *crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
 	struct vlv_wm_state *wm_state = &crtc_state->wm.vlv.optimal;
 	const struct vlv_fifo_state *fifo_state =
 		&crtc_state->wm.vlv.fifo_state;
@@ -2095,19 +2096,20 @@ static void vlv_atomic_update_fifo(struct intel_atomic_state *state,
 
 #undef VLV_FIFO
 
-static int vlv_compute_intermediate_wm(struct intel_crtc_state *new_crtc_state)
+static int vlv_compute_intermediate_wm(struct intel_atomic_state *state,
+				       struct intel_crtc *crtc)
 {
-	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
+	struct intel_crtc_state *new_crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
 	struct vlv_wm_state *intermediate = &new_crtc_state->wm.vlv.intermediate;
 	const struct vlv_wm_state *optimal = &new_crtc_state->wm.vlv.optimal;
-	struct intel_atomic_state *intel_state =
-		to_intel_atomic_state(new_crtc_state->uapi.state);
-	const struct intel_crtc_state *old_crtc_state =
-		intel_atomic_get_old_crtc_state(intel_state, crtc);
 	const struct vlv_wm_state *active = &old_crtc_state->wm.vlv.optimal;
 	int level;
 
-	if (!new_crtc_state->hw.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
+	if (!new_crtc_state->hw.active ||
+	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
 		*intermediate = *optimal;
 
 		intermediate->cxsr = false;
@@ -3144,10 +3146,12 @@ static bool ilk_validate_pipe_wm(const struct drm_i915_private *dev_priv,
 }
 
 /* Compute new watermarks for the pipe */
-static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
+static int ilk_compute_pipe_wm(struct intel_atomic_state *state,
+			       struct intel_crtc *crtc)
 {
-	struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
-	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
+	struct intel_crtc_state *crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
 	struct intel_pipe_wm *pipe_wm;
 	struct intel_plane *plane;
 	const struct intel_plane_state *plane_state;
@@ -3220,16 +3224,16 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
  * state and the new state.  These can be programmed to the hardware
  * immediately.
  */
-static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
+static int ilk_compute_intermediate_wm(struct intel_atomic_state *state,
+				       struct intel_crtc *crtc)
 {
-	struct intel_crtc *intel_crtc = to_intel_crtc(newstate->uapi.crtc);
-	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
-	struct intel_pipe_wm *a = &newstate->wm.ilk.intermediate;
-	struct intel_atomic_state *intel_state =
-		to_intel_atomic_state(newstate->uapi.state);
-	const struct intel_crtc_state *oldstate =
-		intel_atomic_get_old_crtc_state(intel_state, intel_crtc);
-	const struct intel_pipe_wm *b = &oldstate->wm.ilk.optimal;
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	struct intel_crtc_state *new_crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
+	struct intel_pipe_wm *a = &new_crtc_state->wm.ilk.intermediate;
+	const struct intel_pipe_wm *b = &old_crtc_state->wm.ilk.optimal;
 	int level, max_level = ilk_wm_max_level(dev_priv);
 
 	/*
@@ -3237,9 +3241,10 @@ static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
 	 * currently active watermarks to get values that are safe both before
 	 * and after the vblank.
 	 */
-	*a = newstate->wm.ilk.optimal;
-	if (!newstate->hw.active || drm_atomic_crtc_needs_modeset(&newstate->uapi) ||
-	    intel_state->skip_intermediate_wm)
+	*a = new_crtc_state->wm.ilk.optimal;
+	if (!new_crtc_state->hw.active ||
+	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) ||
+	    state->skip_intermediate_wm)
 		return 0;
 
 	a->pipe_enabled |= b->pipe_enabled;
@@ -3270,8 +3275,8 @@ static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
 	 * If our intermediate WM are identical to the final WM, then we can
 	 * omit the post-vblank programming; only update if it's different.
 	 */
-	if (memcmp(a, &newstate->wm.ilk.optimal, sizeof(*a)) != 0)
-		newstate->wm.need_postvbl_update = true;
+	if (memcmp(a, &new_crtc_state->wm.ilk.optimal, sizeof(*a)) != 0)
+		new_crtc_state->wm.need_postvbl_update = true;
 
 	return 0;
 }
@@ -3283,12 +3288,12 @@ static void ilk_merge_wm_level(struct drm_i915_private *dev_priv,
 			       int level,
 			       struct intel_wm_level *ret_wm)
 {
-	const struct intel_crtc *intel_crtc;
+	const struct intel_crtc *crtc;
 
 	ret_wm->enable = true;
 
-	for_each_intel_crtc(&dev_priv->drm, intel_crtc) {
-		const struct intel_pipe_wm *active = &intel_crtc->wm.active.ilk;
+	for_each_intel_crtc(&dev_priv->drm, crtc) {
+		const struct intel_pipe_wm *active = &crtc->wm.active.ilk;
 		const struct intel_wm_level *wm = &active->wm[level];
 
 		if (!active->pipe_enabled)
@@ -3388,7 +3393,7 @@ static void ilk_compute_wm_results(struct drm_i915_private *dev_priv,
 				   enum intel_ddb_partitioning partitioning,
 				   struct ilk_wm_values *results)
 {
-	struct intel_crtc *intel_crtc;
+	struct intel_crtc *crtc;
 	int level, wm_lp;
 
 	results->enable_fbc_wm = merged->fbc_wm_enabled;
@@ -3433,9 +3438,9 @@ static void ilk_compute_wm_results(struct drm_i915_private *dev_priv,
 	}
 
 	/* LP0 register values */
-	for_each_intel_crtc(&dev_priv->drm, intel_crtc) {
-		enum pipe pipe = intel_crtc->pipe;
-		const struct intel_pipe_wm *pipe_wm = &intel_crtc->wm.active.ilk;
+	for_each_intel_crtc(&dev_priv->drm, crtc) {
+		enum pipe pipe = crtc->pipe;
+		const struct intel_pipe_wm *pipe_wm = &crtc->wm.active.ilk;
 		const struct intel_wm_level *r = &pipe_wm->wm[0];
 
 		if (drm_WARN_ON(&dev_priv->drm, !r->enable))
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (3 preceding siblings ...)
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:46   ` Rodrigo Vivi
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/ Ville Syrjala
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Sort out the mess with the local variables in
intel_fbdev_init_bios(). Get rid of all aliasing pointers,
use standard naming/types, and introduc a few more locals
in the loops to avoid the hard to read long struct walks.

While at we also polish the debugs a bit to use the
canonical [CRTC:%d:%s] style.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 94 +++++++++++++---------
 1 file changed, 56 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 4af40229f5ec..df05d285f0bd 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -335,32 +335,43 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
  * fbcon), so we just find the biggest and use that.
  */
 static bool intel_fbdev_init_bios(struct drm_device *dev,
-				 struct intel_fbdev *ifbdev)
+				  struct intel_fbdev *ifbdev)
 {
 	struct drm_i915_private *i915 = to_i915(dev);
 	struct intel_framebuffer *fb = NULL;
-	struct drm_crtc *crtc;
-	struct intel_crtc *intel_crtc;
+	struct intel_crtc *crtc;
 	unsigned int max_size = 0;
 
 	/* Find the largest fb */
-	for_each_crtc(dev, crtc) {
+	for_each_intel_crtc(dev, crtc) {
+		struct intel_crtc_state *crtc_state =
+			to_intel_crtc_state(crtc->base.state);
+		struct intel_plane *plane =
+			to_intel_plane(crtc->base.primary);
+		struct intel_plane_state *plane_state =
+			to_intel_plane_state(plane->base.state);
 		struct drm_i915_gem_object *obj =
-			intel_fb_obj(crtc->primary->state->fb);
-		intel_crtc = to_intel_crtc(crtc);
+			intel_fb_obj(plane_state->uapi.fb);
 
-		if (!crtc->state->active || !obj) {
+		if (!crtc_state->uapi.active) {
 			drm_dbg_kms(&i915->drm,
-				    "pipe %c not active or no fb, skipping\n",
-				    pipe_name(intel_crtc->pipe));
+				    "[CRTC:%d:%s] not active, skipping\n",
+				    crtc->base.base.id, crtc->base.name);
+			continue;
+		}
+
+		if (!obj) {
+			drm_dbg_kms(&i915->drm,
+				    "[PLANE:%d:%s] no fb, skipping\n",
+				    plane->base.base.id, plane->base.name);
 			continue;
 		}
 
 		if (obj->base.size > max_size) {
 			drm_dbg_kms(&i915->drm,
-				    "found possible fb from plane %c\n",
-				    pipe_name(intel_crtc->pipe));
-			fb = to_intel_framebuffer(crtc->primary->state->fb);
+				    "found possible fb from [PLANE:%d:%s]\n",
+				    plane->base.base.id, plane->base.name);
+			fb = to_intel_framebuffer(plane_state->uapi.fb);
 			max_size = obj->base.size;
 		}
 	}
@@ -372,60 +383,62 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
 	}
 
 	/* Now make sure all the pipes will fit into it */
-	for_each_crtc(dev, crtc) {
+	for_each_intel_crtc(dev, crtc) {
+		struct intel_crtc_state *crtc_state =
+			to_intel_crtc_state(crtc->base.state);
+		struct intel_plane *plane =
+			to_intel_plane(crtc->base.primary);
 		unsigned int cur_size;
 
-		intel_crtc = to_intel_crtc(crtc);
-
-		if (!crtc->state->active) {
+		if (!crtc_state->uapi.active) {
 			drm_dbg_kms(&i915->drm,
-				    "pipe %c not active, skipping\n",
-				    pipe_name(intel_crtc->pipe));
+				    "[CRTC:%d:%s] not active, skipping\n",
+				    crtc->base.base.id, crtc->base.name);
 			continue;
 		}
 
-		drm_dbg_kms(&i915->drm, "checking plane %c for BIOS fb\n",
-			    pipe_name(intel_crtc->pipe));
+		drm_dbg_kms(&i915->drm, "checking [PLANE:%d:%s] for BIOS fb\n",
+			    plane->base.base.id, plane->base.name);
 
 		/*
 		 * See if the plane fb we found above will fit on this
 		 * pipe.  Note we need to use the selected fb's pitch and bpp
 		 * rather than the current pipe's, since they differ.
 		 */
-		cur_size = crtc->state->adjusted_mode.crtc_hdisplay;
+		cur_size = crtc_state->uapi.adjusted_mode.crtc_hdisplay;
 		cur_size = cur_size * fb->base.format->cpp[0];
 		if (fb->base.pitches[0] < cur_size) {
 			drm_dbg_kms(&i915->drm,
-				    "fb not wide enough for plane %c (%d vs %d)\n",
-				    pipe_name(intel_crtc->pipe),
+				    "fb not wide enough for [PLANE:%d:%s] (%d vs %d)\n",
+				    plane->base.base.id, plane->base.name,
 				    cur_size, fb->base.pitches[0]);
 			fb = NULL;
 			break;
 		}
 
-		cur_size = crtc->state->adjusted_mode.crtc_vdisplay;
+		cur_size = crtc_state->uapi.adjusted_mode.crtc_vdisplay;
 		cur_size = intel_fb_align_height(&fb->base, 0, cur_size);
 		cur_size *= fb->base.pitches[0];
 		drm_dbg_kms(&i915->drm,
-			    "pipe %c area: %dx%d, bpp: %d, size: %d\n",
-			    pipe_name(intel_crtc->pipe),
-			    crtc->state->adjusted_mode.crtc_hdisplay,
-			    crtc->state->adjusted_mode.crtc_vdisplay,
+			    "[CRTC:%d:%s] area: %dx%d, bpp: %d, size: %d\n",
+			    crtc->base.base.id, crtc->base.name,
+			    crtc_state->uapi.adjusted_mode.crtc_hdisplay,
+			    crtc_state->uapi.adjusted_mode.crtc_vdisplay,
 			    fb->base.format->cpp[0] * 8,
 			    cur_size);
 
 		if (cur_size > max_size) {
 			drm_dbg_kms(&i915->drm,
-				    "fb not big enough for plane %c (%d vs %d)\n",
-				    pipe_name(intel_crtc->pipe),
+				    "fb not big enough for [PLANE:%d:%s] (%d vs %d)\n",
+				    plane->base.base.id, plane->base.name,
 				    cur_size, max_size);
 			fb = NULL;
 			break;
 		}
 
 		drm_dbg_kms(&i915->drm,
-			    "fb big enough for plane %c (%d >= %d)\n",
-			    pipe_name(intel_crtc->pipe),
+			    "fb big enough [PLANE:%d:%s] (%d >= %d)\n",
+			    plane->base.base.id, plane->base.name,
 			    max_size, cur_size);
 	}
 
@@ -441,15 +454,20 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
 	drm_framebuffer_get(&ifbdev->fb->base);
 
 	/* Final pass to check if any active pipes don't have fbs */
-	for_each_crtc(dev, crtc) {
-		intel_crtc = to_intel_crtc(crtc);
+	for_each_intel_crtc(dev, crtc) {
+		struct intel_crtc_state *crtc_state =
+			to_intel_crtc_state(crtc->base.state);
+		struct intel_plane *plane =
+			to_intel_plane(crtc->base.primary);
+		struct intel_plane_state *plane_state =
+			to_intel_plane_state(plane->base.state);
 
-		if (!crtc->state->active)
+		if (!crtc_state->uapi.active)
 			continue;
 
-		drm_WARN(dev, !crtc->primary->state->fb,
-			 "re-used BIOS config but lost an fb on crtc %d\n",
-			 crtc->base.id);
+		drm_WARN(dev, !plane_state->uapi.fb,
+			 "re-used BIOS config but lost an fb on [PLANE:%d:%s]\n",
+			 plane->base.base.id, plane->base.name);
 	}
 
 
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (4 preceding siblings ...)
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit Ville Syrjala
@ 2021-06-09  8:56 ` Ville Syrjala
  2021-06-09 11:49   ` Rodrigo Vivi
  2021-06-09  9:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Cleanup intel_crtc leftovers Patchwork
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjala @ 2021-06-09  8:56 UTC (permalink / raw)
  To: intel-gfx

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

Clear out the straggler 'intel_crtc' variables.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/icl_dsi.c        |  4 +-
 drivers/gpu/drm/i915/display/intel_crtc.c     |  8 ++--
 drivers/gpu/drm/i915/display/intel_ddi.c      |  6 +--
 drivers/gpu/drm/i915/display/intel_display.c  |  6 +--
 .../drm/i915/display/intel_display_debugfs.c  | 28 ++++++-------
 drivers/gpu/drm/i915/display/intel_dp.c       |  4 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c   |  4 +-
 drivers/gpu/drm/i915/display/intel_fdi.c      | 20 ++++-----
 drivers/gpu/drm/i915/display/intel_hdmi.c     | 42 +++++++++----------
 drivers/gpu/drm/i915/display/intel_lvds.c     |  4 +-
 drivers/gpu/drm/i915/display/intel_sdvo.c     |  4 +-
 drivers/gpu/drm/i915/display/intel_tv.c       | 13 +++---
 drivers/gpu/drm/i915/display/skl_scaler.c     | 27 ++++++------
 drivers/gpu/drm/i915/display/vlv_dsi.c        | 13 +++---
 drivers/gpu/drm/i915/i915_irq.c               | 22 +++++-----
 15 files changed, 100 insertions(+), 105 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
index 16812488c5dd..55ceae6a8de5 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -729,8 +729,8 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
-	enum pipe pipe = intel_crtc->pipe;
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	enum pipe pipe = crtc->pipe;
 	u32 tmp;
 	enum port port;
 	enum transcoder dsi_trans;
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index 95ff1707b4bd..448c4d99ac35 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -163,12 +163,12 @@ static void intel_crtc_free(struct intel_crtc *crtc)
 	kfree(crtc);
 }
 
-static void intel_crtc_destroy(struct drm_crtc *crtc)
+static void intel_crtc_destroy(struct drm_crtc *_crtc)
 {
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc *crtc = to_intel_crtc(_crtc);
 
-	drm_crtc_cleanup(crtc);
-	kfree(intel_crtc);
+	drm_crtc_cleanup(&crtc->base);
+	kfree(crtc);
 }
 
 static int intel_crtc_late_register(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 390869bd6b63..313fd86c827b 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3577,7 +3577,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
 				    struct intel_crtc_state *pipe_config)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
 	enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	u32 temp, flags = 0;
@@ -3640,7 +3640,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
 			pipe_config->output_types |= BIT(INTEL_OUTPUT_DP);
 		pipe_config->lane_count =
 			((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
-		intel_dp_get_m_n(intel_crtc, pipe_config);
+		intel_dp_get_m_n(crtc, pipe_config);
 
 		if (DISPLAY_VER(dev_priv) >= 11) {
 			i915_reg_t dp_tp_ctl = dp_tp_ctl_reg(encoder, pipe_config);
@@ -3670,7 +3670,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
 			pipe_config->mst_master_transcoder =
 					REG_FIELD_GET(TRANS_DDI_MST_TRANSPORT_SELECT_MASK, temp);
 
-		intel_dp_get_m_n(intel_crtc, pipe_config);
+		intel_dp_get_m_n(crtc, pipe_config);
 
 		pipe_config->infoframes.enable |=
 			intel_hdmi_infoframes_enabled(encoder, pipe_config);
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 62221243fca9..bd54b99929a1 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2717,10 +2717,10 @@ void hsw_disable_ips(const struct intel_crtc_state *crtc_state)
 	intel_wait_for_vblank(dev_priv, crtc->pipe);
 }
 
-static void intel_crtc_dpms_overlay_disable(struct intel_crtc *intel_crtc)
+static void intel_crtc_dpms_overlay_disable(struct intel_crtc *crtc)
 {
-	if (intel_crtc->overlay)
-		(void) intel_overlay_switch_off(intel_crtc->overlay);
+	if (crtc->overlay)
+		(void) intel_overlay_switch_off(crtc->overlay);
 
 	/* Let userspace switch the overlay on again. In most cases userspace
 	 * has to recompute where to put it anyway.
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 88bb05d5c483..c6c8f66c0176 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -1225,7 +1225,7 @@ static int i915_ddb_info(struct seq_file *m, void *unused)
 
 static void drrs_status_per_crtc(struct seq_file *m,
 				 struct drm_device *dev,
-				 struct intel_crtc *intel_crtc)
+				 struct intel_crtc *crtc)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct i915_drrs *drrs = &dev_priv->drrs;
@@ -1237,7 +1237,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
 	drm_for_each_connector_iter(connector, &conn_iter) {
 		bool supported = false;
 
-		if (connector->state->crtc != &intel_crtc->base)
+		if (connector->state->crtc != &crtc->base)
 			continue;
 
 		seq_printf(m, "%s:\n", connector->name);
@@ -1252,7 +1252,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
 
 	seq_puts(m, "\n");
 
-	if (to_intel_crtc_state(intel_crtc->base.state)->has_drrs) {
+	if (to_intel_crtc_state(crtc->base.state)->has_drrs) {
 		struct intel_panel *panel;
 
 		mutex_lock(&drrs->mutex);
@@ -1298,16 +1298,16 @@ static int i915_drrs_status(struct seq_file *m, void *unused)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
 	struct drm_device *dev = &dev_priv->drm;
-	struct intel_crtc *intel_crtc;
+	struct intel_crtc *crtc;
 	int active_crtc_cnt = 0;
 
 	drm_modeset_lock_all(dev);
-	for_each_intel_crtc(dev, intel_crtc) {
-		if (intel_crtc->base.state->active) {
+	for_each_intel_crtc(dev, crtc) {
+		if (crtc->base.state->active) {
 			active_crtc_cnt++;
 			seq_printf(m, "\nCRTC %d:  ", active_crtc_cnt);
 
-			drrs_status_per_crtc(m, dev, intel_crtc);
+			drrs_status_per_crtc(m, dev, crtc);
 		}
 	}
 	drm_modeset_unlock_all(dev);
@@ -2064,7 +2064,7 @@ i915_fifo_underrun_reset_write(struct file *filp,
 			       size_t cnt, loff_t *ppos)
 {
 	struct drm_i915_private *dev_priv = filp->private_data;
-	struct intel_crtc *intel_crtc;
+	struct intel_crtc *crtc;
 	struct drm_device *dev = &dev_priv->drm;
 	int ret;
 	bool reset;
@@ -2076,15 +2076,15 @@ i915_fifo_underrun_reset_write(struct file *filp,
 	if (!reset)
 		return cnt;
 
-	for_each_intel_crtc(dev, intel_crtc) {
+	for_each_intel_crtc(dev, crtc) {
 		struct drm_crtc_commit *commit;
 		struct intel_crtc_state *crtc_state;
 
-		ret = drm_modeset_lock_single_interruptible(&intel_crtc->base.mutex);
+		ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex);
 		if (ret)
 			return ret;
 
-		crtc_state = to_intel_crtc_state(intel_crtc->base.state);
+		crtc_state = to_intel_crtc_state(crtc->base.state);
 		commit = crtc_state->uapi.commit;
 		if (commit) {
 			ret = wait_for_completion_interruptible(&commit->hw_done);
@@ -2095,12 +2095,12 @@ i915_fifo_underrun_reset_write(struct file *filp,
 		if (!ret && crtc_state->hw.active) {
 			drm_dbg_kms(&dev_priv->drm,
 				    "Re-arming FIFO underruns on pipe %c\n",
-				    pipe_name(intel_crtc->pipe));
+				    pipe_name(crtc->pipe));
 
-			intel_crtc_arm_fifo_underrun(intel_crtc, crtc_state);
+			intel_crtc_arm_fifo_underrun(crtc, crtc_state);
 		}
 
-		drm_modeset_unlock(&intel_crtc->base.mutex);
+		drm_modeset_unlock(&crtc->base.mutex);
 
 		if (ret)
 			return ret;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 5c9222283044..9ff5420fa64c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4741,7 +4741,7 @@ static void intel_dp_set_drrs_state(struct drm_i915_private *dev_priv,
 				    int refresh_rate)
 {
 	struct intel_dp *intel_dp = dev_priv->drrs.dp;
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	enum drrs_refresh_rate_type index = DRRS_HIGH_RR;
 
 	if (refresh_rate <= 0) {
@@ -4755,7 +4755,7 @@ static void intel_dp_set_drrs_state(struct drm_i915_private *dev_priv,
 		return;
 	}
 
-	if (!intel_crtc) {
+	if (!crtc) {
 		drm_dbg_kms(&dev_priv->drm,
 			    "DRRS: intel_crtc not initialized\n");
 		return;
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index b170e272bdee..70fe90beaf6c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -308,9 +308,9 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,
 	 * connector
 	 */
 	if (new_crtc) {
-		struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc);
+		struct intel_crtc *crtc = to_intel_crtc(new_crtc);
 		struct intel_crtc_state *crtc_state =
-			intel_atomic_get_new_crtc_state(state, intel_crtc);
+			intel_atomic_get_new_crtc_state(state, crtc);
 
 		if (!crtc_state ||
 		    !drm_atomic_crtc_needs_modeset(&crtc_state->uapi) ||
diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
index cef1061fd6cb..97bb3edca9c9 100644
--- a/drivers/gpu/drm/i915/display/intel_fdi.c
+++ b/drivers/gpu/drm/i915/display/intel_fdi.c
@@ -96,10 +96,10 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
 	}
 }
 
-int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
-				  struct intel_crtc_state *pipe_config)
+int ilk_fdi_compute_config(struct intel_crtc *crtc,
+			   struct intel_crtc_state *pipe_config)
 {
-	struct drm_device *dev = intel_crtc->base.dev;
+	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *i915 = to_i915(dev);
 	const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
 	int lane, link_bw, fdi_dotclock, ret;
@@ -125,7 +125,7 @@ int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
 	intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,
 			       link_bw, &pipe_config->fdi_m_n, false, false);
 
-	ret = ilk_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);
+	ret = ilk_check_fdi_lanes(dev, crtc->pipe, pipe_config);
 	if (ret == -EDEADLK)
 		return ret;
 
@@ -691,9 +691,9 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,
 
 void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state)
 {
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
-	enum pipe pipe = intel_crtc->pipe;
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	enum pipe pipe = crtc->pipe;
 	i915_reg_t reg;
 	u32 temp;
 
@@ -726,11 +726,11 @@ void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state)
 	}
 }
 
-void ilk_fdi_pll_disable(struct intel_crtc *intel_crtc)
+void ilk_fdi_pll_disable(struct intel_crtc *crtc)
 {
-	struct drm_device *dev = intel_crtc->base.dev;
+	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	enum pipe pipe = intel_crtc->pipe;
+	enum pipe pipe = crtc->pipe;
 	i915_reg_t reg;
 	u32 temp;
 
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 7e51c98c475e..852af2b23540 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -270,8 +270,8 @@ static void ibx_write_infoframe(struct intel_encoder *encoder,
 {
 	const u32 *data = frame;
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 	int i;
 
@@ -286,13 +286,13 @@ static void ibx_write_infoframe(struct intel_encoder *encoder,
 	intel_de_write(dev_priv, reg, val);
 
 	for (i = 0; i < len; i += 4) {
-		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe),
+		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe),
 			       *data);
 		data++;
 	}
 	/* Write every possible data byte to force correct ECC calculation. */
 	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
-		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
+		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe), 0);
 
 	val |= g4x_infoframe_enable(type);
 	val &= ~VIDEO_DIP_FREQ_MASK;
@@ -349,8 +349,8 @@ static void cpt_write_infoframe(struct intel_encoder *encoder,
 {
 	const u32 *data = frame;
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 	int i;
 
@@ -368,13 +368,13 @@ static void cpt_write_infoframe(struct intel_encoder *encoder,
 	intel_de_write(dev_priv, reg, val);
 
 	for (i = 0; i < len; i += 4) {
-		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe),
+		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe),
 			       *data);
 		data++;
 	}
 	/* Write every possible data byte to force correct ECC calculation. */
 	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
-		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
+		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe), 0);
 
 	val |= g4x_infoframe_enable(type);
 	val &= ~VIDEO_DIP_FREQ_MASK;
@@ -427,8 +427,8 @@ static void vlv_write_infoframe(struct intel_encoder *encoder,
 {
 	const u32 *data = frame;
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 	int i;
 
@@ -444,13 +444,13 @@ static void vlv_write_infoframe(struct intel_encoder *encoder,
 
 	for (i = 0; i < len; i += 4) {
 		intel_de_write(dev_priv,
-			       VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
+			       VLV_TVIDEO_DIP_DATA(crtc->pipe), *data);
 		data++;
 	}
 	/* Write every possible data byte to force correct ECC calculation. */
 	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
 		intel_de_write(dev_priv,
-			       VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
+			       VLV_TVIDEO_DIP_DATA(crtc->pipe), 0);
 
 	val |= g4x_infoframe_enable(type);
 	val &= ~VIDEO_DIP_FREQ_MASK;
@@ -1040,10 +1040,10 @@ static void ibx_set_infoframes(struct intel_encoder *encoder,
 			       const struct drm_connector_state *conn_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
-	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
+	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 	u32 port = VIDEO_DIP_PORT(encoder->port);
 
@@ -1099,9 +1099,9 @@ static void cpt_set_infoframes(struct intel_encoder *encoder,
 			       const struct drm_connector_state *conn_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
-	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
+	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 
 	assert_hdmi_port_disabled(intel_hdmi);
@@ -1148,9 +1148,9 @@ static void vlv_set_infoframes(struct intel_encoder *encoder,
 			       const struct drm_connector_state *conn_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
-	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
+	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe);
 	u32 val = intel_de_read(dev_priv, reg);
 	u32 port = VIDEO_DIP_PORT(encoder->port);
 
@@ -1465,14 +1465,12 @@ static int kbl_repositioning_enc_en_signal(struct intel_connector *connector,
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
 	struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
-	struct drm_crtc *crtc = connector->base.state->crtc;
-	struct intel_crtc *intel_crtc = container_of(crtc,
-						     struct intel_crtc, base);
+	struct intel_crtc *crtc = to_intel_crtc(connector->base.state->crtc);
 	u32 scanline;
 	int ret;
 
 	for (;;) {
-		scanline = intel_de_read(dev_priv, PIPEDSL(intel_crtc->pipe));
+		scanline = intel_de_read(dev_priv, PIPEDSL(crtc->pipe));
 		if (scanline > 100 && scanline < 200)
 			break;
 		usleep_range(25, 50);
diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c
index 7f40e9f60bc2..e0381b0fce91 100644
--- a/drivers/gpu/drm/i915/display/intel_lvds.c
+++ b/drivers/gpu/drm/i915/display/intel_lvds.c
@@ -411,12 +411,12 @@ static int intel_lvds_compute_config(struct intel_encoder *intel_encoder,
 	struct intel_connector *intel_connector =
 		lvds_encoder->attached_connector;
 	struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
 	unsigned int lvds_bpp;
 	int ret;
 
 	/* Should never happen!! */
-	if (DISPLAY_VER(dev_priv) < 4 && intel_crtc->pipe == 0) {
+	if (DISPLAY_VER(dev_priv) < 4 && crtc->pipe == 0) {
 		drm_err(&dev_priv->drm, "Can't support LVDS on pipe A\n");
 		return -EINVAL;
 	}
diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index e4f91d7a5c60..6cb27599ea03 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -1824,7 +1824,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state,
 	struct drm_device *dev = encoder->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
 	u32 temp;
 	bool input1, input2;
 	int i;
@@ -1835,7 +1835,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state,
 	intel_sdvo_write_sdvox(intel_sdvo, temp);
 
 	for (i = 0; i < 2; i++)
-		intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
+		intel_wait_for_vblank(dev_priv, crtc->pipe);
 
 	success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2);
 	/*
diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c
index aa52af7891f0..d02f09f7e750 100644
--- a/drivers/gpu/drm/i915/display/intel_tv.c
+++ b/drivers/gpu/drm/i915/display/intel_tv.c
@@ -1420,7 +1420,7 @@ static void intel_tv_pre_enable(struct intel_atomic_state *state,
 				const struct drm_connector_state *conn_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
 	struct intel_tv *intel_tv = enc_to_tv(encoder);
 	const struct intel_tv_connector_state *tv_conn_state =
 		to_intel_tv_connector_state(conn_state);
@@ -1466,7 +1466,7 @@ static void intel_tv_pre_enable(struct intel_atomic_state *state,
 		break;
 	}
 
-	tv_ctl |= TV_ENC_PIPE_SEL(intel_crtc->pipe);
+	tv_ctl |= TV_ENC_PIPE_SEL(crtc->pipe);
 
 	switch (tv_mode->oversample) {
 	case 8:
@@ -1571,8 +1571,7 @@ static int
 intel_tv_detect_type(struct intel_tv *intel_tv,
 		      struct drm_connector *connector)
 {
-	struct drm_crtc *crtc = connector->state->crtc;
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc *crtc = to_intel_crtc(connector->state->crtc);
 	struct drm_device *dev = connector->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 tv_ctl, save_tv_ctl;
@@ -1594,7 +1593,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
 	/* Poll for TV detection */
 	tv_ctl &= ~(TV_ENC_ENABLE | TV_ENC_PIPE_SEL_MASK | TV_TEST_MODE_MASK);
 	tv_ctl |= TV_TEST_MODE_MONITOR_DETECT;
-	tv_ctl |= TV_ENC_PIPE_SEL(intel_crtc->pipe);
+	tv_ctl |= TV_ENC_PIPE_SEL(crtc->pipe);
 
 	tv_dac &= ~(TVDAC_SENSE_MASK | DAC_A_MASK | DAC_B_MASK | DAC_C_MASK);
 	tv_dac |= (TVDAC_STATE_CHG_EN |
@@ -1619,7 +1618,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
 	intel_de_write(dev_priv, TV_DAC, tv_dac);
 	intel_de_posting_read(dev_priv, TV_DAC);
 
-	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
 
 	type = -1;
 	tv_dac = intel_de_read(dev_priv, TV_DAC);
@@ -1652,7 +1651,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
 	intel_de_posting_read(dev_priv, TV_CTL);
 
 	/* For unknown reasons the hw barfs if we don't do this vblank wait. */
-	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
 
 	/* Restore interrupt config */
 	if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 394b7bbf48d8..911a113ee006 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -96,9 +96,8 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 {
 	struct intel_crtc_scaler_state *scaler_state =
 		&crtc_state->scaler_state;
-	struct intel_crtc *intel_crtc =
-		to_intel_crtc(crtc_state->uapi.crtc);
-	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	const struct drm_display_mode *adjusted_mode =
 		&crtc_state->hw.adjusted_mode;
 
@@ -141,7 +140,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 			drm_dbg_kms(&dev_priv->drm,
 				    "scaler_user index %u.%u: "
 				    "Staged freeing scaler id %d scaler_users = 0x%x\n",
-				    intel_crtc->pipe, scaler_user, *scaler_id,
+				    crtc->pipe, scaler_user, *scaler_id,
 				    scaler_state->scaler_users);
 			*scaler_id = -1;
 		}
@@ -167,7 +166,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 		drm_dbg_kms(&dev_priv->drm,
 			    "scaler_user index %u.%u: src %ux%u dst %ux%u "
 			    "size is out of scaler range\n",
-			    intel_crtc->pipe, scaler_user, src_w, src_h,
+			    crtc->pipe, scaler_user, src_w, src_h,
 			    dst_w, dst_h);
 		return -EINVAL;
 	}
@@ -176,7 +175,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 	scaler_state->scaler_users |= (1 << scaler_user);
 	drm_dbg_kms(&dev_priv->drm, "scaler_user index %u.%u: "
 		    "staged scaling request for %ux%u->%ux%u scaler_users = 0x%x\n",
-		    intel_crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h,
+		    crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h,
 		    scaler_state->scaler_users);
 
 	return 0;
@@ -515,17 +514,17 @@ skl_program_plane_scaler(struct intel_plane *plane,
 			  (crtc_w << 16) | crtc_h);
 }
 
-static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
+static void skl_detach_scaler(struct intel_crtc *crtc, int id)
 {
-	struct drm_device *dev = intel_crtc->base.dev;
+	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	unsigned long irqflags;
 
 	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
-	intel_de_write_fw(dev_priv, SKL_PS_CTRL(intel_crtc->pipe, id), 0);
-	intel_de_write_fw(dev_priv, SKL_PS_WIN_POS(intel_crtc->pipe, id), 0);
-	intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(intel_crtc->pipe, id), 0);
+	intel_de_write_fw(dev_priv, SKL_PS_CTRL(crtc->pipe, id), 0);
+	intel_de_write_fw(dev_priv, SKL_PS_WIN_POS(crtc->pipe, id), 0);
+	intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(crtc->pipe, id), 0);
 
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
@@ -535,15 +534,15 @@ static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
  */
 void skl_detach_scalers(const struct intel_crtc_state *crtc_state)
 {
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	const struct intel_crtc_scaler_state *scaler_state =
 		&crtc_state->scaler_state;
 	int i;
 
 	/* loop through and disable scalers that aren't in use */
-	for (i = 0; i < intel_crtc->num_scalers; i++) {
+	for (i = 0; i < crtc->num_scalers; i++) {
 		if (!scaler_state->scalers[i].in_use)
-			skl_detach_scaler(intel_crtc, i);
+			skl_detach_scaler(crtc, i);
 	}
 }
 
diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
index 084c9c43b2ed..0ee4ff341e25 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
@@ -780,10 +780,9 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
 				 const struct drm_connector_state *conn_state)
 {
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
-	struct drm_crtc *crtc = pipe_config->uapi.crtc;
-	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	enum pipe pipe = intel_crtc->pipe;
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	enum pipe pipe = crtc->pipe;
 	enum port port;
 	u32 val;
 	bool glk_cold_boot = false;
@@ -1389,7 +1388,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
 	struct drm_encoder *encoder = &intel_encoder->base;
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
+	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder));
 	const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
 	enum port port;
@@ -1397,7 +1396,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
 	u32 val, tmp;
 	u16 mode_hdisplay;
 
-	drm_dbg_kms(&dev_priv->drm, "pipe %c\n", pipe_name(intel_crtc->pipe));
+	drm_dbg_kms(&dev_priv->drm, "pipe %c\n", pipe_name(crtc->pipe));
 
 	mode_hdisplay = adjusted_mode->crtc_hdisplay;
 
@@ -1424,7 +1423,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
 			intel_de_write(dev_priv, MIPI_CTRL(port),
 				       tmp | READ_REQUEST_PRIORITY_HIGH);
 		} else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
-			enum pipe pipe = intel_crtc->pipe;
+			enum pipe pipe = crtc->pipe;
 
 			tmp = intel_de_read(dev_priv, MIPI_CTRL(port));
 			tmp &= ~BXT_PIPE_SELECT_MASK;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index a11bdb667241..3cb0a65a996b 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2881,14 +2881,14 @@ static bool gen11_dsi_configure_te(struct intel_crtc *intel_crtc,
 	return true;
 }
 
-int bdw_enable_vblank(struct drm_crtc *crtc)
+int bdw_enable_vblank(struct drm_crtc *_crtc)
 {
-	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	enum pipe pipe = intel_crtc->pipe;
+	struct intel_crtc *crtc = to_intel_crtc(_crtc);
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	enum pipe pipe = crtc->pipe;
 	unsigned long irqflags;
 
-	if (gen11_dsi_configure_te(intel_crtc, true))
+	if (gen11_dsi_configure_te(crtc, true))
 		return 0;
 
 	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
@@ -2899,7 +2899,7 @@ int bdw_enable_vblank(struct drm_crtc *crtc)
 	 * PSR is active as no frames are generated, so check only for PSR.
 	 */
 	if (HAS_PSR(dev_priv))
-		drm_crtc_vblank_restore(crtc);
+		drm_crtc_vblank_restore(&crtc->base);
 
 	return 0;
 }
@@ -2953,14 +2953,14 @@ void ilk_disable_vblank(struct drm_crtc *crtc)
 	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-void bdw_disable_vblank(struct drm_crtc *crtc)
+void bdw_disable_vblank(struct drm_crtc *_crtc)
 {
-	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	enum pipe pipe = intel_crtc->pipe;
+	struct intel_crtc *crtc = to_intel_crtc(_crtc);
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	enum pipe pipe = crtc->pipe;
 	unsigned long irqflags;
 
-	if (gen11_dsi_configure_te(intel_crtc, false))
+	if (gen11_dsi_configure_te(crtc, false))
 		return;
 
 	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
-- 
2.31.1

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Cleanup intel_crtc leftovers
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (5 preceding siblings ...)
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/ Ville Syrjala
@ 2021-06-09  9:39 ` Patchwork
  2021-06-09  9:41 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2021-06-09  9:39 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Cleanup intel_crtc leftovers
URL   : https://patchwork.freedesktop.org/series/91228/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
8e210ec77a89 drm/i915: Stop hand rolling drm_crtc_mask()
8a5104afbe28 drm/i915: Clean up intel_get_load_detect_pipe() a bit
a329856db7f9 drm/i915: Clean up intel_find_initial_plane_obj() a bit
cd8c3028dd2e drm/i915: Clean up pre-skl wm calling convention
065c8d4b9cc7 drm/i915: Clean up intel_fbdev_init_bios() a bit
a935b9b200e8 drm/i915: s/intel_crtc/crtc/
-:94: CHECK:SPACING: No space is necessary after a cast
#94: FILE: drivers/gpu/drm/i915/display/intel_display.c:2723:
+		(void) intel_overlay_switch_off(crtc->overlay);

total: 0 errors, 0 warnings, 1 checks, 584 lines checked


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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Cleanup intel_crtc leftovers
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (6 preceding siblings ...)
  2021-06-09  9:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Cleanup intel_crtc leftovers Patchwork
@ 2021-06-09  9:41 ` Patchwork
  2021-06-09 10:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2021-06-09  9:41 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Cleanup intel_crtc leftovers
URL   : https://patchwork.freedesktop.org/series/91228/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:32:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:32:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:56:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:56:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_reset.c:1396:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block
+drivers/gpu/drm/i915/gt/intel_ring_submission.c:1207:24: warning: Using plain integer as NULL pointer
+drivers/gpu/drm/i915/i915_perf.c:1434:15: warning: memset with byte count of 16777216
+drivers/gpu/drm/i915/i915_perf.c:1488:15: warning: memset with byte count of 16777216
+./include/asm-generic/bitops/find.h:112:45: warning: shift count is negative (-262080)
+./include/asm-generic/bitops/find.h:32:31: warning: shift count is negative (-262080)
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block


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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Cleanup intel_crtc leftovers
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (7 preceding siblings ...)
  2021-06-09  9:41 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2021-06-09 10:09 ` Patchwork
  2021-06-09 10:09 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
  2021-06-09 12:42 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  10 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2021-06-09 10:09 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 8370 bytes --]

== Series Details ==

Series: drm/i915: Cleanup intel_crtc leftovers
URL   : https://patchwork.freedesktop.org/series/91228/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10196 -> Patchwork_20321
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/index.html

Known issues
------------

  Here are the changes found in Patchwork_20321 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_cs_nop@sync-fork-compute0:
    - fi-snb-2600:        NOTRUN -> [SKIP][1] ([fdo#109271]) +17 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-snb-2600/igt@amdgpu/amd_cs_nop@sync-fork-compute0.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
    - fi-cfl-8109u:       [PASS][2] -> [DMESG-WARN][3] ([i915#165]) +15 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-u2:          [FAIL][4] ([i915#1888]) -> [PASS][5]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_selftest@live@hangcheck:
    - fi-snb-2600:        [INCOMPLETE][6] ([i915#2782]) -> [PASS][7]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-snb-2600/igt@i915_selftest@live@hangcheck.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-icl-u2:          [DMESG-WARN][8] ([i915#2868]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-icl-u2/igt@kms_chamelium@hdmi-hpd-fast.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-icl-u2/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Warnings ####

  * igt@i915_selftest@live@execlists:
    - fi-tgl-u2:          [INCOMPLETE][10] ([i915#3462]) -> [DMESG-FAIL][11] ([i915#3462])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-tgl-u2/igt@i915_selftest@live@execlists.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-tgl-u2/igt@i915_selftest@live@execlists.html

  * igt@runner@aborted:
    - fi-kbl-x1275:       [FAIL][12] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][13] ([i915#1436] / [i915#3363])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-kbl-x1275/igt@runner@aborted.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-kbl-x1275/igt@runner@aborted.html
    - fi-bdw-5557u:       [FAIL][14] ([i915#2426] / [i915#3462]) -> [FAIL][15] ([i915#3462])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-bdw-5557u/igt@runner@aborted.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-bdw-5557u/igt@runner@aborted.html
    - fi-kbl-soraka:      [FAIL][16] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][17] ([i915#1436] / [i915#3363])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-kbl-soraka/igt@runner@aborted.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-kbl-soraka/igt@runner@aborted.html
    - fi-kbl-7500u:       [FAIL][18] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][19] ([i915#1436] / [i915#3363])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-kbl-7500u/igt@runner@aborted.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-kbl-7500u/igt@runner@aborted.html
    - fi-kbl-guc:         [FAIL][20] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][21] ([i915#1436] / [i915#3363])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-kbl-guc/igt@runner@aborted.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-kbl-guc/igt@runner@aborted.html
    - fi-cml-s:           [FAIL][22] ([i915#3363] / [i915#3462]) -> [FAIL][23] ([i915#2082] / [i915#2426] / [i915#3363] / [i915#3462])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-cml-s/igt@runner@aborted.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-cml-s/igt@runner@aborted.html
    - fi-skl-guc:         [FAIL][24] ([i915#1436] / [i915#3363]) -> [FAIL][25] ([i915#1436] / [i915#2426] / [i915#3363])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/fi-skl-guc/igt@runner@aborted.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/fi-skl-guc/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#165]: https://gitlab.freedesktop.org/drm/intel/issues/165
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2082]: https://gitlab.freedesktop.org/drm/intel/issues/2082
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
  [i915#2868]: https://gitlab.freedesktop.org/drm/intel/issues/2868
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3276]: https://gitlab.freedesktop.org/drm/intel/issues/3276
  [i915#3277]: https://gitlab.freedesktop.org/drm/intel/issues/3277
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3283]: https://gitlab.freedesktop.org/drm/intel/issues/3283
  [i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
  [i915#3462]: https://gitlab.freedesktop.org/drm/intel/issues/3462
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3542]: https://gitlab.freedesktop.org/drm/intel/issues/3542
  [i915#3544]: https://gitlab.freedesktop.org/drm/intel/issues/3544
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533


Participating hosts (44 -> 42)
------------------------------

  Additional (1): fi-rkl-11500t 
  Missing    (3): fi-ilk-m540 fi-bdw-samus fi-hsw-4200u 


Build changes
-------------

  * Linux: CI_DRM_10196 -> Patchwork_20321

  CI-20190529: 20190529
  CI_DRM_10196: 1588f8e61fe15d12826ca07d41c0a108a26006cc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6103: 3aa79e55e73d4a49a5222e5dfde486b800a29fe7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_20321: a935b9b200e8e65e26d2bf5d7627cfead88f0b84 @ git://anongit.freedesktop.org/gfx-ci/linux


== Kernel 32bit build ==

Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/Patchwork_20321/build_32bit.log

  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready  (#1)
  MODPOST modules-only.symvers
ERROR: modpost: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
scripts/Makefile.modpost:150: recipe for target 'modules-only.symvers' failed
make[1]: *** [modules-only.symvers] Error 1
make[1]: *** Deleting file 'modules-only.symvers'
Makefile:1759: recipe for target 'modules' failed
make: *** [modules] Error 2


== Linux commits ==

a935b9b200e8 drm/i915: s/intel_crtc/crtc/
065c8d4b9cc7 drm/i915: Clean up intel_fbdev_init_bios() a bit
cd8c3028dd2e drm/i915: Clean up pre-skl wm calling convention
a329856db7f9 drm/i915: Clean up intel_find_initial_plane_obj() a bit
8a5104afbe28 drm/i915: Clean up intel_get_load_detect_pipe() a bit
8e210ec77a89 drm/i915: Stop hand rolling drm_crtc_mask()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/index.html

[-- Attachment #1.2: Type: text/html, Size: 10766 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: warning for drm/i915: Cleanup intel_crtc leftovers
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (8 preceding siblings ...)
  2021-06-09 10:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2021-06-09 10:09 ` Patchwork
  2021-06-09 12:42 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  10 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2021-06-09 10:09 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Cleanup intel_crtc leftovers
URL   : https://patchwork.freedesktop.org/series/91228/
State : warning

== Summary ==

CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready  (#1)
  MODPOST modules-only.symvers
ERROR: modpost: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
scripts/Makefile.modpost:150: recipe for target 'modules-only.symvers' failed
make[1]: *** [modules-only.symvers] Error 1
make[1]: *** Deleting file 'modules-only.symvers'
Makefile:1759: recipe for target 'modules' failed
make: *** [modules] Error 2

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/build_32bit.log
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask()
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask() Ville Syrjala
@ 2021-06-09 11:25   ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:25 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:27AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Use drm_crtc_mask() instead of hand rolling it.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 362bff9beb5c..62ad4cfae073 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6485,7 +6485,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	struct drm_atomic_state *state = NULL, *restore_state = NULL;
>  	struct drm_connector_state *connector_state;
>  	struct intel_crtc_state *crtc_state;
> -	int ret, i = -1;
> +	int ret;
>  
>  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
>  		    connector->base.id, connector->name,
> @@ -6519,8 +6519,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  
>  	/* Find an unused one (if possible) */
>  	for_each_crtc(dev, possible_crtc) {
> -		i++;
> -		if (!(encoder->possible_crtcs & (1 << i)))
> +		if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
>  			continue;
>  
>  		ret = drm_modeset_lock(&possible_crtc->mutex, ctx);
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit Ville Syrjala
@ 2021-06-09 11:27   ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:27 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:28AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Sort out the mess with the local variables in
> intel_get_load_detect_pipe(). Get rid of all aliasing pointers
> and use standard naming/types.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

nice clean up

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 41 +++++++++-----------
>  1 file changed, 19 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 62ad4cfae073..78815a1ac0ca 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6473,13 +6473,11 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  			       struct intel_load_detect_pipe *old,
>  			       struct drm_modeset_acquire_ctx *ctx)
>  {
> -	struct intel_crtc *intel_crtc;
> -	struct intel_encoder *intel_encoder =
> +	struct intel_encoder *encoder =
>  		intel_attached_encoder(to_intel_connector(connector));
> -	struct drm_crtc *possible_crtc;
> -	struct drm_encoder *encoder = &intel_encoder->base;
> -	struct drm_crtc *crtc = NULL;
> -	struct drm_device *dev = encoder->dev;
> +	struct intel_crtc *possible_crtc;
> +	struct intel_crtc *crtc = NULL;
> +	struct drm_device *dev = encoder->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct drm_mode_config *config = &dev->mode_config;
>  	struct drm_atomic_state *state = NULL, *restore_state = NULL;
> @@ -6489,7 +6487,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  
>  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
>  		    connector->base.id, connector->name,
> -		    encoder->base.id, encoder->name);
> +		    encoder->base.base.id, encoder->base.name);
>  
>  	old->restore_state = NULL;
>  
> @@ -6507,9 +6505,9 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  
>  	/* See if we already have a CRTC for this connector */
>  	if (connector->state->crtc) {
> -		crtc = connector->state->crtc;
> +		crtc = to_intel_crtc(connector->state->crtc);
>  
> -		ret = drm_modeset_lock(&crtc->mutex, ctx);
> +		ret = drm_modeset_lock(&crtc->base.mutex, ctx);
>  		if (ret)
>  			goto fail;
>  
> @@ -6518,16 +6516,17 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	}
>  
>  	/* Find an unused one (if possible) */
> -	for_each_crtc(dev, possible_crtc) {
> -		if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
> +	for_each_intel_crtc(dev, possible_crtc) {
> +		if (!(encoder->base.possible_crtcs &
> +		      drm_crtc_mask(&possible_crtc->base)))
>  			continue;
>  
> -		ret = drm_modeset_lock(&possible_crtc->mutex, ctx);
> +		ret = drm_modeset_lock(&possible_crtc->base.mutex, ctx);
>  		if (ret)
>  			goto fail;
>  
> -		if (possible_crtc->state->enable) {
> -			drm_modeset_unlock(&possible_crtc->mutex);
> +		if (possible_crtc->base.state->enable) {
> +			drm_modeset_unlock(&possible_crtc->base.mutex);
>  			continue;
>  		}
>  
> @@ -6546,8 +6545,6 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	}
>  
>  found:
> -	intel_crtc = to_intel_crtc(crtc);
> -
>  	state = drm_atomic_state_alloc(dev);
>  	restore_state = drm_atomic_state_alloc(dev);
>  	if (!state || !restore_state) {
> @@ -6564,11 +6561,11 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  		goto fail;
>  	}
>  
> -	ret = drm_atomic_set_crtc_for_connector(connector_state, crtc);
> +	ret = drm_atomic_set_crtc_for_connector(connector_state, &crtc->base);
>  	if (ret)
>  		goto fail;
>  
> -	crtc_state = intel_atomic_get_crtc_state(state, intel_crtc);
> +	crtc_state = intel_atomic_get_crtc_state(state, crtc);
>  	if (IS_ERR(crtc_state)) {
>  		ret = PTR_ERR(crtc_state);
>  		goto fail;
> @@ -6581,15 +6578,15 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	if (ret)
>  		goto fail;
>  
> -	ret = intel_modeset_disable_planes(state, crtc);
> +	ret = intel_modeset_disable_planes(state, &crtc->base);
>  	if (ret)
>  		goto fail;
>  
>  	ret = PTR_ERR_OR_ZERO(drm_atomic_get_connector_state(restore_state, connector));
>  	if (!ret)
> -		ret = PTR_ERR_OR_ZERO(drm_atomic_get_crtc_state(restore_state, crtc));
> +		ret = PTR_ERR_OR_ZERO(drm_atomic_get_crtc_state(restore_state, &crtc->base));
>  	if (!ret)
> -		ret = drm_atomic_add_affected_planes(restore_state, crtc);
> +		ret = drm_atomic_add_affected_planes(restore_state, &crtc->base);
>  	if (ret) {
>  		drm_dbg_kms(&dev_priv->drm,
>  			    "Failed to create a copy of old state to restore: %i\n",
> @@ -6608,7 +6605,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	drm_atomic_state_put(state);
>  
>  	/* let the connector get through one full cycle before testing */
> -	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
> +	intel_wait_for_vblank(dev_priv, crtc->pipe);
>  	return true;
>  
>  fail:
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() a bit
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() " Ville Syrjala
@ 2021-06-09 11:36   ` Rodrigo Vivi
  2021-06-09 12:15     ` Ville Syrjälä
  0 siblings, 1 reply; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:36 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:29AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Sort out the mess with the local variables in
> intel_find_initial_plane_obj(). Get rid of all aliasing pointers
> and use standard naming/types.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 113 ++++++++++---------
>  1 file changed, 62 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 78815a1ac0ca..1615501685c9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1914,20 +1914,50 @@ static void intel_dpt_unpin(struct i915_address_space *vm)
>  	i915_vma_put(dpt->vma);
>  }
>  
> +static bool
> +intel_reuse_initial_plane_obj(struct drm_i915_private *i915,
> +			      const struct intel_initial_plane_config *plane_config,
> +			      struct drm_framebuffer **fb,
> +			      struct i915_vma **vma)
> +{
> +	struct intel_crtc *crtc;
> +
> +	for_each_intel_crtc(&i915->drm, crtc) {
> +		struct intel_crtc_state *crtc_state =
> +			to_intel_crtc_state(crtc->base.state);
> +		struct intel_plane *plane =
> +			to_intel_plane(crtc->base.primary);
> +		struct intel_plane_state *plane_state =
> +			to_intel_plane_state(plane->base.state);
> +
> +		if (!crtc_state->uapi.active)
> +			continue;
> +
> +		if (!plane_state->ggtt_vma)
> +			continue;
> +
> +		if (intel_plane_ggtt_offset(plane_state) == plane_config->base) {
> +			*fb = plane_state->hw.fb;
> +			*vma = plane_state->ggtt_vma;
> +			return true;
> +		}
> +	}
> +
> +	return false;
> +}
> +
>  static void
> -intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> +intel_find_initial_plane_obj(struct intel_crtc *crtc,
>  			     struct intel_initial_plane_config *plane_config)
>  {
> -	struct drm_device *dev = intel_crtc->base.dev;
> +	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct drm_crtc *c;
> -	struct drm_plane *primary = intel_crtc->base.primary;
> -	struct drm_plane_state *plane_state = primary->state;
> -	struct intel_plane *intel_plane = to_intel_plane(primary);
> -	struct intel_plane_state *intel_state =
> -		to_intel_plane_state(plane_state);
>  	struct intel_crtc_state *crtc_state =
> -		to_intel_crtc_state(intel_crtc->base.state);
> +		to_intel_crtc_state(crtc->base.state);
> +	struct intel_plane *plane =
> +		to_intel_plane(crtc->base.primary);
> +	struct intel_plane_state *plane_state =
> +		to_intel_plane_state(plane->base.state);
>  	struct drm_framebuffer *fb;
>  	struct i915_vma *vma;
>  
> @@ -1939,7 +1969,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	if (!plane_config->fb)
>  		return;
>  
> -	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
> +	if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
>  		fb = &plane_config->fb->base;
>  		vma = plane_config->vma;
>  		goto valid_fb;
> @@ -1949,25 +1979,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	 * Failed to alloc the obj, check to see if we should share
>  	 * an fb with another CRTC instead
>  	 */
> -	for_each_crtc(dev, c) {
> -		struct intel_plane_state *state;
> -
> -		if (c == &intel_crtc->base)
> -			continue;
> -
> -		if (!to_intel_crtc_state(c->state)->uapi.active)
> -			continue;
> -
> -		state = to_intel_plane_state(c->primary->state);
> -		if (!state->ggtt_vma)
> -			continue;
> -
> -		if (intel_plane_ggtt_offset(state) == plane_config->base) {
> -			fb = state->hw.fb;
> -			vma = state->ggtt_vma;
> -			goto valid_fb;
> -		}
> -	}
> +	if (intel_reuse_initial_plane_obj(dev_priv, plane_config, &fb, &vma))
> +		goto valid_fb;
>  
>  	/*
>  	 * We've failed to reconstruct the BIOS FB.  Current display state
> @@ -1976,7 +1989,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	 * simplest solution is to just disable the primary plane now and
>  	 * pretend the BIOS never had it enabled.
>  	 */
> -	intel_plane_disable_noatomic(intel_crtc, intel_plane);
> +	intel_plane_disable_noatomic(crtc, plane);
>  	if (crtc_state->bigjoiner) {
>  		struct intel_crtc *slave =
>  			crtc_state->bigjoiner_linked_crtc;
> @@ -1986,40 +1999,38 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	return;
>  
>  valid_fb:
> -	plane_state->rotation = plane_config->rotation;
> -	intel_fb_fill_view(to_intel_framebuffer(fb), plane_state->rotation,
> -			   &intel_state->view);
> +	plane_state->uapi.rotation = plane_config->rotation;
> +	intel_fb_fill_view(to_intel_framebuffer(fb),
> +			   plane_state->uapi.rotation, &plane_state->view);
>  
>  	__i915_vma_pin(vma);
> -	intel_state->ggtt_vma = i915_vma_get(vma);
> -	if (intel_plane_uses_fence(intel_state) && i915_vma_pin_fence(vma) == 0)
> -		if (vma->fence)
> -			intel_state->flags |= PLANE_HAS_FENCE;
> +	plane_state->ggtt_vma = i915_vma_get(vma);
> +	if (intel_plane_uses_fence(plane_state) &&
> +	    i915_vma_pin_fence(vma) == 0 && vma->fence)
> +		plane_state->flags |= PLANE_HAS_FENCE;
>  
> -	plane_state->src_x = 0;
> -	plane_state->src_y = 0;
> -	plane_state->src_w = fb->width << 16;
> -	plane_state->src_h = fb->height << 16;
> +	plane_state->uapi.src_x = 0;
> +	plane_state->uapi.src_y = 0;
> +	plane_state->uapi.src_w = fb->width << 16;
> +	plane_state->uapi.src_h = fb->height << 16;
>  
> -	plane_state->crtc_x = 0;
> -	plane_state->crtc_y = 0;
> -	plane_state->crtc_w = fb->width;
> -	plane_state->crtc_h = fb->height;
> +	plane_state->uapi.crtc_x = 0;
> +	plane_state->uapi.crtc_y = 0;
> +	plane_state->uapi.crtc_w = fb->width;
> +	plane_state->uapi.crtc_h = fb->height;
>  
>  	if (plane_config->tiling)
>  		dev_priv->preserve_bios_swizzle = true;
>  
> -	plane_state->fb = fb;
> +	plane_state->uapi.fb = fb;

I believe we should have a separated patch for these plane_state uapi changes

>  	drm_framebuffer_get(fb);
>  
> -	plane_state->crtc = &intel_crtc->base;
> -	intel_plane_copy_uapi_to_hw_state(intel_state, intel_state,
> -					  intel_crtc);
> +	plane_state->uapi.crtc = &crtc->base;
> +	intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
>  
>  	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
>  
> -	atomic_or(to_intel_plane(primary)->frontbuffer_bit,
> -		  &to_intel_frontbuffer(fb)->bits);
> +	atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
>  }
>  
>  unsigned int
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention Ville Syrjala
@ 2021-06-09 11:44   ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:44 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:30AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Just pass the full atomic state+crtc to the pre-skl watermark
> functions, and clean up the types/variable names around the area.
> 
> Note that having both .compute_pipe_wm() and .compute_intermediate_wm()
> is entirely redundant now. We could unify them to a single vfunc.
> But let's do this one step at a time.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c |  5 +-
>  drivers/gpu/drm/i915/i915_drv.h              |  6 +-
>  drivers/gpu/drm/i915/intel_pm.c              | 97 ++++++++++----------
>  3 files changed, 58 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 1615501685c9..62221243fca9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7288,12 +7288,13 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
>  	}
>  
>  	if (dev_priv->display.compute_pipe_wm) {
> -		ret = dev_priv->display.compute_pipe_wm(crtc_state);
> +		ret = dev_priv->display.compute_pipe_wm(state, crtc);
>  		if (ret) {
>  			drm_dbg_kms(&dev_priv->drm,
>  				    "Target pipe watermarks are invalid\n");
>  			return ret;
>  		}
> +
>  	}
>  
>  	if (dev_priv->display.compute_intermediate_wm) {
> @@ -7306,7 +7307,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
>  		 * old state and the new state.  We can program these
>  		 * immediately.
>  		 */
> -		ret = dev_priv->display.compute_intermediate_wm(crtc_state);
> +		ret = dev_priv->display.compute_intermediate_wm(state, crtc);
>  		if (ret) {
>  			drm_dbg_kms(&dev_priv->drm,
>  				    "No valid intermediate pipe watermarks are possible\n");
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 38ff2fb89744..e9cf0eaad7f8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -270,8 +270,10 @@ struct drm_i915_display_funcs {
>  	int (*bw_calc_min_cdclk)(struct intel_atomic_state *state);
>  	int (*get_fifo_size)(struct drm_i915_private *dev_priv,
>  			     enum i9xx_plane_id i9xx_plane);
> -	int (*compute_pipe_wm)(struct intel_crtc_state *crtc_state);
> -	int (*compute_intermediate_wm)(struct intel_crtc_state *crtc_state);
> +	int (*compute_pipe_wm)(struct intel_atomic_state *state,
> +			       struct intel_crtc *crtc);
> +	int (*compute_intermediate_wm)(struct intel_atomic_state *state,
> +				       struct intel_crtc *crtc);
>  	void (*initial_watermarks)(struct intel_atomic_state *state,
>  				   struct intel_crtc *crtc);
>  	void (*atomic_update_watermarks)(struct intel_atomic_state *state,
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 7ce9537fa2c7..dd682c64daf0 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -1370,11 +1370,11 @@ static bool g4x_compute_fbc_en(const struct g4x_wm_state *wm_state,
>  	return true;
>  }
>  
> -static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
> +static int g4x_compute_pipe_wm(struct intel_atomic_state *state,
> +			       struct intel_crtc *crtc)
>  {
> -	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	struct intel_atomic_state *state =
> -		to_intel_atomic_state(crtc_state->uapi.state);
> +	struct intel_crtc_state *crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
>  	struct g4x_wm_state *wm_state = &crtc_state->wm.g4x.optimal;
>  	int num_active_planes = hweight8(crtc_state->active_planes &
>  					 ~BIT(PLANE_CURSOR));
> @@ -1451,20 +1451,21 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  	return 0;
>  }
>  
> -static int g4x_compute_intermediate_wm(struct intel_crtc_state *new_crtc_state)
> +static int g4x_compute_intermediate_wm(struct intel_atomic_state *state,
> +				       struct intel_crtc *crtc)
>  {
> -	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
>  	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_crtc_state *new_crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
> +	const struct intel_crtc_state *old_crtc_state =
> +		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct g4x_wm_state *intermediate = &new_crtc_state->wm.g4x.intermediate;
>  	const struct g4x_wm_state *optimal = &new_crtc_state->wm.g4x.optimal;
> -	struct intel_atomic_state *intel_state =
> -		to_intel_atomic_state(new_crtc_state->uapi.state);
> -	const struct intel_crtc_state *old_crtc_state =
> -		intel_atomic_get_old_crtc_state(intel_state, crtc);
>  	const struct g4x_wm_state *active = &old_crtc_state->wm.g4x.optimal;
>  	enum plane_id plane_id;
>  
> -	if (!new_crtc_state->hw.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
> +	if (!new_crtc_state->hw.active ||
> +	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
>  		*intermediate = *optimal;
>  
>  		intermediate->cxsr = false;
> @@ -1890,12 +1891,12 @@ static bool vlv_raw_crtc_wm_is_valid(const struct intel_crtc_state *crtc_state,
>  		vlv_raw_plane_wm_is_valid(crtc_state, PLANE_CURSOR, level);
>  }
>  
> -static int vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state)
> +static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
> +			       struct intel_crtc *crtc)
>  {
> -	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> -	struct intel_atomic_state *state =
> -		to_intel_atomic_state(crtc_state->uapi.state);
> +	struct intel_crtc_state *crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
>  	struct vlv_wm_state *wm_state = &crtc_state->wm.vlv.optimal;
>  	const struct vlv_fifo_state *fifo_state =
>  		&crtc_state->wm.vlv.fifo_state;
> @@ -2095,19 +2096,20 @@ static void vlv_atomic_update_fifo(struct intel_atomic_state *state,
>  
>  #undef VLV_FIFO
>  
> -static int vlv_compute_intermediate_wm(struct intel_crtc_state *new_crtc_state)
> +static int vlv_compute_intermediate_wm(struct intel_atomic_state *state,
> +				       struct intel_crtc *crtc)
>  {
> -	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
> +	struct intel_crtc_state *new_crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
> +	const struct intel_crtc_state *old_crtc_state =
> +		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct vlv_wm_state *intermediate = &new_crtc_state->wm.vlv.intermediate;
>  	const struct vlv_wm_state *optimal = &new_crtc_state->wm.vlv.optimal;
> -	struct intel_atomic_state *intel_state =
> -		to_intel_atomic_state(new_crtc_state->uapi.state);
> -	const struct intel_crtc_state *old_crtc_state =
> -		intel_atomic_get_old_crtc_state(intel_state, crtc);
>  	const struct vlv_wm_state *active = &old_crtc_state->wm.vlv.optimal;
>  	int level;
>  
> -	if (!new_crtc_state->hw.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
> +	if (!new_crtc_state->hw.active ||
> +	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
>  		*intermediate = *optimal;
>  
>  		intermediate->cxsr = false;
> @@ -3144,10 +3146,12 @@ static bool ilk_validate_pipe_wm(const struct drm_i915_private *dev_priv,
>  }
>  
>  /* Compute new watermarks for the pipe */
> -static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
> +static int ilk_compute_pipe_wm(struct intel_atomic_state *state,
> +			       struct intel_crtc *crtc)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
> -	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> +	struct intel_crtc_state *crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);

I didn't see much advantage on changing 1 to 2 arguments when you need the
previous one anyway.

But maybe I'm missing some other patch like the possible clean-up
mentioned at the commit message above...

anyway the code looks correct and no blocker here, so up to you:

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

>  	struct intel_pipe_wm *pipe_wm;
>  	struct intel_plane *plane;
>  	const struct intel_plane_state *plane_state;
> @@ -3220,16 +3224,16 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>   * state and the new state.  These can be programmed to the hardware
>   * immediately.
>   */
> -static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
> +static int ilk_compute_intermediate_wm(struct intel_atomic_state *state,
> +				       struct intel_crtc *crtc)
>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(newstate->uapi.crtc);
> -	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
> -	struct intel_pipe_wm *a = &newstate->wm.ilk.intermediate;
> -	struct intel_atomic_state *intel_state =
> -		to_intel_atomic_state(newstate->uapi.state);
> -	const struct intel_crtc_state *oldstate =
> -		intel_atomic_get_old_crtc_state(intel_state, intel_crtc);
> -	const struct intel_pipe_wm *b = &oldstate->wm.ilk.optimal;
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_crtc_state *new_crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
> +	const struct intel_crtc_state *old_crtc_state =
> +		intel_atomic_get_old_crtc_state(state, crtc);
> +	struct intel_pipe_wm *a = &new_crtc_state->wm.ilk.intermediate;
> +	const struct intel_pipe_wm *b = &old_crtc_state->wm.ilk.optimal;
>  	int level, max_level = ilk_wm_max_level(dev_priv);
>  
>  	/*
> @@ -3237,9 +3241,10 @@ static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
>  	 * currently active watermarks to get values that are safe both before
>  	 * and after the vblank.
>  	 */
> -	*a = newstate->wm.ilk.optimal;
> -	if (!newstate->hw.active || drm_atomic_crtc_needs_modeset(&newstate->uapi) ||
> -	    intel_state->skip_intermediate_wm)
> +	*a = new_crtc_state->wm.ilk.optimal;
> +	if (!new_crtc_state->hw.active ||
> +	    drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) ||
> +	    state->skip_intermediate_wm)
>  		return 0;
>  
>  	a->pipe_enabled |= b->pipe_enabled;
> @@ -3270,8 +3275,8 @@ static int ilk_compute_intermediate_wm(struct intel_crtc_state *newstate)
>  	 * If our intermediate WM are identical to the final WM, then we can
>  	 * omit the post-vblank programming; only update if it's different.
>  	 */
> -	if (memcmp(a, &newstate->wm.ilk.optimal, sizeof(*a)) != 0)
> -		newstate->wm.need_postvbl_update = true;
> +	if (memcmp(a, &new_crtc_state->wm.ilk.optimal, sizeof(*a)) != 0)
> +		new_crtc_state->wm.need_postvbl_update = true;
>  
>  	return 0;
>  }
> @@ -3283,12 +3288,12 @@ static void ilk_merge_wm_level(struct drm_i915_private *dev_priv,
>  			       int level,
>  			       struct intel_wm_level *ret_wm)
>  {
> -	const struct intel_crtc *intel_crtc;
> +	const struct intel_crtc *crtc;
>  
>  	ret_wm->enable = true;
>  
> -	for_each_intel_crtc(&dev_priv->drm, intel_crtc) {
> -		const struct intel_pipe_wm *active = &intel_crtc->wm.active.ilk;
> +	for_each_intel_crtc(&dev_priv->drm, crtc) {
> +		const struct intel_pipe_wm *active = &crtc->wm.active.ilk;
>  		const struct intel_wm_level *wm = &active->wm[level];
>  
>  		if (!active->pipe_enabled)
> @@ -3388,7 +3393,7 @@ static void ilk_compute_wm_results(struct drm_i915_private *dev_priv,
>  				   enum intel_ddb_partitioning partitioning,
>  				   struct ilk_wm_values *results)
>  {
> -	struct intel_crtc *intel_crtc;
> +	struct intel_crtc *crtc;
>  	int level, wm_lp;
>  
>  	results->enable_fbc_wm = merged->fbc_wm_enabled;
> @@ -3433,9 +3438,9 @@ static void ilk_compute_wm_results(struct drm_i915_private *dev_priv,
>  	}
>  
>  	/* LP0 register values */
> -	for_each_intel_crtc(&dev_priv->drm, intel_crtc) {
> -		enum pipe pipe = intel_crtc->pipe;
> -		const struct intel_pipe_wm *pipe_wm = &intel_crtc->wm.active.ilk;
> +	for_each_intel_crtc(&dev_priv->drm, crtc) {
> +		enum pipe pipe = crtc->pipe;
> +		const struct intel_pipe_wm *pipe_wm = &crtc->wm.active.ilk;
>  		const struct intel_wm_level *r = &pipe_wm->wm[0];
>  
>  		if (drm_WARN_ON(&dev_priv->drm, !r->enable))
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit Ville Syrjala
@ 2021-06-09 11:46   ` Rodrigo Vivi
  2021-06-09 21:06     ` Rodrigo Vivi
  0 siblings, 1 reply; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:46 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:31AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Sort out the mess with the local variables in
> intel_fbdev_init_bios(). Get rid of all aliasing pointers,
> use standard naming/types, and introduc a few more locals

                                         ^ typo

> in the loops to avoid the hard to read long struct walks.
> 
> While at we also polish the debugs a bit to use the
> canonical [CRTC:%d:%s] style.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 94 +++++++++++++---------
>  1 file changed, 56 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 4af40229f5ec..df05d285f0bd 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -335,32 +335,43 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
>   * fbcon), so we just find the biggest and use that.
>   */
>  static bool intel_fbdev_init_bios(struct drm_device *dev,
> -				 struct intel_fbdev *ifbdev)
> +				  struct intel_fbdev *ifbdev)
>  {
>  	struct drm_i915_private *i915 = to_i915(dev);
>  	struct intel_framebuffer *fb = NULL;
> -	struct drm_crtc *crtc;
> -	struct intel_crtc *intel_crtc;
> +	struct intel_crtc *crtc;
>  	unsigned int max_size = 0;
>  
>  	/* Find the largest fb */
> -	for_each_crtc(dev, crtc) {
> +	for_each_intel_crtc(dev, crtc) {
> +		struct intel_crtc_state *crtc_state =
> +			to_intel_crtc_state(crtc->base.state);
> +		struct intel_plane *plane =
> +			to_intel_plane(crtc->base.primary);
> +		struct intel_plane_state *plane_state =
> +			to_intel_plane_state(plane->base.state);
>  		struct drm_i915_gem_object *obj =
> -			intel_fb_obj(crtc->primary->state->fb);
> -		intel_crtc = to_intel_crtc(crtc);
> +			intel_fb_obj(plane_state->uapi.fb);

oh, here we have again that plane_state uapi change that I don't understand
and I'm not seeing any mention in any commit msg..

>  
> -		if (!crtc->state->active || !obj) {
> +		if (!crtc_state->uapi.active) {
>  			drm_dbg_kms(&i915->drm,
> -				    "pipe %c not active or no fb, skipping\n",
> -				    pipe_name(intel_crtc->pipe));
> +				    "[CRTC:%d:%s] not active, skipping\n",
> +				    crtc->base.base.id, crtc->base.name);
> +			continue;
> +		}
> +
> +		if (!obj) {
> +			drm_dbg_kms(&i915->drm,
> +				    "[PLANE:%d:%s] no fb, skipping\n",
> +				    plane->base.base.id, plane->base.name);
>  			continue;
>  		}
>  
>  		if (obj->base.size > max_size) {
>  			drm_dbg_kms(&i915->drm,
> -				    "found possible fb from plane %c\n",
> -				    pipe_name(intel_crtc->pipe));
> -			fb = to_intel_framebuffer(crtc->primary->state->fb);
> +				    "found possible fb from [PLANE:%d:%s]\n",
> +				    plane->base.base.id, plane->base.name);
> +			fb = to_intel_framebuffer(plane_state->uapi.fb);
>  			max_size = obj->base.size;
>  		}
>  	}
> @@ -372,60 +383,62 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
>  	}
>  
>  	/* Now make sure all the pipes will fit into it */
> -	for_each_crtc(dev, crtc) {
> +	for_each_intel_crtc(dev, crtc) {
> +		struct intel_crtc_state *crtc_state =
> +			to_intel_crtc_state(crtc->base.state);
> +		struct intel_plane *plane =
> +			to_intel_plane(crtc->base.primary);
>  		unsigned int cur_size;
>  
> -		intel_crtc = to_intel_crtc(crtc);
> -
> -		if (!crtc->state->active) {
> +		if (!crtc_state->uapi.active) {
>  			drm_dbg_kms(&i915->drm,
> -				    "pipe %c not active, skipping\n",
> -				    pipe_name(intel_crtc->pipe));
> +				    "[CRTC:%d:%s] not active, skipping\n",
> +				    crtc->base.base.id, crtc->base.name);
>  			continue;
>  		}
>  
> -		drm_dbg_kms(&i915->drm, "checking plane %c for BIOS fb\n",
> -			    pipe_name(intel_crtc->pipe));
> +		drm_dbg_kms(&i915->drm, "checking [PLANE:%d:%s] for BIOS fb\n",
> +			    plane->base.base.id, plane->base.name);
>  
>  		/*
>  		 * See if the plane fb we found above will fit on this
>  		 * pipe.  Note we need to use the selected fb's pitch and bpp
>  		 * rather than the current pipe's, since they differ.
>  		 */
> -		cur_size = crtc->state->adjusted_mode.crtc_hdisplay;
> +		cur_size = crtc_state->uapi.adjusted_mode.crtc_hdisplay;
>  		cur_size = cur_size * fb->base.format->cpp[0];
>  		if (fb->base.pitches[0] < cur_size) {
>  			drm_dbg_kms(&i915->drm,
> -				    "fb not wide enough for plane %c (%d vs %d)\n",
> -				    pipe_name(intel_crtc->pipe),
> +				    "fb not wide enough for [PLANE:%d:%s] (%d vs %d)\n",
> +				    plane->base.base.id, plane->base.name,
>  				    cur_size, fb->base.pitches[0]);
>  			fb = NULL;
>  			break;
>  		}
>  
> -		cur_size = crtc->state->adjusted_mode.crtc_vdisplay;
> +		cur_size = crtc_state->uapi.adjusted_mode.crtc_vdisplay;
>  		cur_size = intel_fb_align_height(&fb->base, 0, cur_size);
>  		cur_size *= fb->base.pitches[0];
>  		drm_dbg_kms(&i915->drm,
> -			    "pipe %c area: %dx%d, bpp: %d, size: %d\n",
> -			    pipe_name(intel_crtc->pipe),
> -			    crtc->state->adjusted_mode.crtc_hdisplay,
> -			    crtc->state->adjusted_mode.crtc_vdisplay,
> +			    "[CRTC:%d:%s] area: %dx%d, bpp: %d, size: %d\n",
> +			    crtc->base.base.id, crtc->base.name,
> +			    crtc_state->uapi.adjusted_mode.crtc_hdisplay,
> +			    crtc_state->uapi.adjusted_mode.crtc_vdisplay,
>  			    fb->base.format->cpp[0] * 8,
>  			    cur_size);
>  
>  		if (cur_size > max_size) {
>  			drm_dbg_kms(&i915->drm,
> -				    "fb not big enough for plane %c (%d vs %d)\n",
> -				    pipe_name(intel_crtc->pipe),
> +				    "fb not big enough for [PLANE:%d:%s] (%d vs %d)\n",
> +				    plane->base.base.id, plane->base.name,
>  				    cur_size, max_size);
>  			fb = NULL;
>  			break;
>  		}
>  
>  		drm_dbg_kms(&i915->drm,
> -			    "fb big enough for plane %c (%d >= %d)\n",
> -			    pipe_name(intel_crtc->pipe),
> +			    "fb big enough [PLANE:%d:%s] (%d >= %d)\n",
> +			    plane->base.base.id, plane->base.name,
>  			    max_size, cur_size);
>  	}
>  
> @@ -441,15 +454,20 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
>  	drm_framebuffer_get(&ifbdev->fb->base);
>  
>  	/* Final pass to check if any active pipes don't have fbs */
> -	for_each_crtc(dev, crtc) {
> -		intel_crtc = to_intel_crtc(crtc);
> +	for_each_intel_crtc(dev, crtc) {
> +		struct intel_crtc_state *crtc_state =
> +			to_intel_crtc_state(crtc->base.state);
> +		struct intel_plane *plane =
> +			to_intel_plane(crtc->base.primary);
> +		struct intel_plane_state *plane_state =
> +			to_intel_plane_state(plane->base.state);
>  
> -		if (!crtc->state->active)
> +		if (!crtc_state->uapi.active)
>  			continue;
>  
> -		drm_WARN(dev, !crtc->primary->state->fb,
> -			 "re-used BIOS config but lost an fb on crtc %d\n",
> -			 crtc->base.id);
> +		drm_WARN(dev, !plane_state->uapi.fb,
> +			 "re-used BIOS config but lost an fb on [PLANE:%d:%s]\n",
> +			 plane->base.base.id, plane->base.name);
>  	}
>  
>  
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/
  2021-06-09  8:56 ` [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/ Ville Syrjala
@ 2021-06-09 11:49   ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 11:49 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 11:56:32AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Clear out the straggler 'intel_crtc' variables.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/icl_dsi.c        |  4 +-
>  drivers/gpu/drm/i915/display/intel_crtc.c     |  8 ++--
>  drivers/gpu/drm/i915/display/intel_ddi.c      |  6 +--
>  drivers/gpu/drm/i915/display/intel_display.c  |  6 +--
>  .../drm/i915/display/intel_display_debugfs.c  | 28 ++++++-------
>  drivers/gpu/drm/i915/display/intel_dp.c       |  4 +-
>  drivers/gpu/drm/i915/display/intel_dp_mst.c   |  4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      | 20 ++++-----
>  drivers/gpu/drm/i915/display/intel_hdmi.c     | 42 +++++++++----------
>  drivers/gpu/drm/i915/display/intel_lvds.c     |  4 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c     |  4 +-
>  drivers/gpu/drm/i915/display/intel_tv.c       | 13 +++---
>  drivers/gpu/drm/i915/display/skl_scaler.c     | 27 ++++++------
>  drivers/gpu/drm/i915/display/vlv_dsi.c        | 13 +++---
>  drivers/gpu/drm/i915/i915_irq.c               | 22 +++++-----
>  15 files changed, 100 insertions(+), 105 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
> index 16812488c5dd..55ceae6a8de5 100644
> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
> @@ -729,8 +729,8 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> -	enum pipe pipe = intel_crtc->pipe;
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	enum pipe pipe = crtc->pipe;
>  	u32 tmp;
>  	enum port port;
>  	enum transcoder dsi_trans;
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index 95ff1707b4bd..448c4d99ac35 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -163,12 +163,12 @@ static void intel_crtc_free(struct intel_crtc *crtc)
>  	kfree(crtc);
>  }
>  
> -static void intel_crtc_destroy(struct drm_crtc *crtc)
> +static void intel_crtc_destroy(struct drm_crtc *_crtc)
>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(_crtc);
>  
> -	drm_crtc_cleanup(crtc);
> -	kfree(intel_crtc);
> +	drm_crtc_cleanup(&crtc->base);
> +	kfree(crtc);
>  }
>  
>  static int intel_crtc_late_register(struct drm_crtc *crtc)
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 390869bd6b63..313fd86c827b 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3577,7 +3577,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
>  				    struct intel_crtc_state *pipe_config)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>  	enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	u32 temp, flags = 0;
> @@ -3640,7 +3640,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
>  			pipe_config->output_types |= BIT(INTEL_OUTPUT_DP);
>  		pipe_config->lane_count =
>  			((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
> -		intel_dp_get_m_n(intel_crtc, pipe_config);
> +		intel_dp_get_m_n(crtc, pipe_config);
>  
>  		if (DISPLAY_VER(dev_priv) >= 11) {
>  			i915_reg_t dp_tp_ctl = dp_tp_ctl_reg(encoder, pipe_config);
> @@ -3670,7 +3670,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
>  			pipe_config->mst_master_transcoder =
>  					REG_FIELD_GET(TRANS_DDI_MST_TRANSPORT_SELECT_MASK, temp);
>  
> -		intel_dp_get_m_n(intel_crtc, pipe_config);
> +		intel_dp_get_m_n(crtc, pipe_config);
>  
>  		pipe_config->infoframes.enable |=
>  			intel_hdmi_infoframes_enabled(encoder, pipe_config);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 62221243fca9..bd54b99929a1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2717,10 +2717,10 @@ void hsw_disable_ips(const struct intel_crtc_state *crtc_state)
>  	intel_wait_for_vblank(dev_priv, crtc->pipe);
>  }
>  
> -static void intel_crtc_dpms_overlay_disable(struct intel_crtc *intel_crtc)
> +static void intel_crtc_dpms_overlay_disable(struct intel_crtc *crtc)
>  {
> -	if (intel_crtc->overlay)
> -		(void) intel_overlay_switch_off(intel_crtc->overlay);
> +	if (crtc->overlay)
> +		(void) intel_overlay_switch_off(crtc->overlay);
>  
>  	/* Let userspace switch the overlay on again. In most cases userspace
>  	 * has to recompute where to put it anyway.
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 88bb05d5c483..c6c8f66c0176 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1225,7 +1225,7 @@ static int i915_ddb_info(struct seq_file *m, void *unused)
>  
>  static void drrs_status_per_crtc(struct seq_file *m,
>  				 struct drm_device *dev,
> -				 struct intel_crtc *intel_crtc)
> +				 struct intel_crtc *crtc)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct i915_drrs *drrs = &dev_priv->drrs;
> @@ -1237,7 +1237,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
>  	drm_for_each_connector_iter(connector, &conn_iter) {
>  		bool supported = false;
>  
> -		if (connector->state->crtc != &intel_crtc->base)
> +		if (connector->state->crtc != &crtc->base)
>  			continue;
>  
>  		seq_printf(m, "%s:\n", connector->name);
> @@ -1252,7 +1252,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
>  
>  	seq_puts(m, "\n");
>  
> -	if (to_intel_crtc_state(intel_crtc->base.state)->has_drrs) {
> +	if (to_intel_crtc_state(crtc->base.state)->has_drrs) {
>  		struct intel_panel *panel;
>  
>  		mutex_lock(&drrs->mutex);
> @@ -1298,16 +1298,16 @@ static int i915_drrs_status(struct seq_file *m, void *unused)
>  {
>  	struct drm_i915_private *dev_priv = node_to_i915(m->private);
>  	struct drm_device *dev = &dev_priv->drm;
> -	struct intel_crtc *intel_crtc;
> +	struct intel_crtc *crtc;
>  	int active_crtc_cnt = 0;
>  
>  	drm_modeset_lock_all(dev);
> -	for_each_intel_crtc(dev, intel_crtc) {
> -		if (intel_crtc->base.state->active) {
> +	for_each_intel_crtc(dev, crtc) {
> +		if (crtc->base.state->active) {
>  			active_crtc_cnt++;
>  			seq_printf(m, "\nCRTC %d:  ", active_crtc_cnt);
>  
> -			drrs_status_per_crtc(m, dev, intel_crtc);
> +			drrs_status_per_crtc(m, dev, crtc);
>  		}
>  	}
>  	drm_modeset_unlock_all(dev);
> @@ -2064,7 +2064,7 @@ i915_fifo_underrun_reset_write(struct file *filp,
>  			       size_t cnt, loff_t *ppos)
>  {
>  	struct drm_i915_private *dev_priv = filp->private_data;
> -	struct intel_crtc *intel_crtc;
> +	struct intel_crtc *crtc;
>  	struct drm_device *dev = &dev_priv->drm;
>  	int ret;
>  	bool reset;
> @@ -2076,15 +2076,15 @@ i915_fifo_underrun_reset_write(struct file *filp,
>  	if (!reset)
>  		return cnt;
>  
> -	for_each_intel_crtc(dev, intel_crtc) {
> +	for_each_intel_crtc(dev, crtc) {
>  		struct drm_crtc_commit *commit;
>  		struct intel_crtc_state *crtc_state;
>  
> -		ret = drm_modeset_lock_single_interruptible(&intel_crtc->base.mutex);
> +		ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex);
>  		if (ret)
>  			return ret;
>  
> -		crtc_state = to_intel_crtc_state(intel_crtc->base.state);
> +		crtc_state = to_intel_crtc_state(crtc->base.state);
>  		commit = crtc_state->uapi.commit;
>  		if (commit) {
>  			ret = wait_for_completion_interruptible(&commit->hw_done);
> @@ -2095,12 +2095,12 @@ i915_fifo_underrun_reset_write(struct file *filp,
>  		if (!ret && crtc_state->hw.active) {
>  			drm_dbg_kms(&dev_priv->drm,
>  				    "Re-arming FIFO underruns on pipe %c\n",
> -				    pipe_name(intel_crtc->pipe));
> +				    pipe_name(crtc->pipe));
>  
> -			intel_crtc_arm_fifo_underrun(intel_crtc, crtc_state);
> +			intel_crtc_arm_fifo_underrun(crtc, crtc_state);
>  		}
>  
> -		drm_modeset_unlock(&intel_crtc->base.mutex);
> +		drm_modeset_unlock(&crtc->base.mutex);
>  
>  		if (ret)
>  			return ret;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 5c9222283044..9ff5420fa64c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4741,7 +4741,7 @@ static void intel_dp_set_drrs_state(struct drm_i915_private *dev_priv,
>  				    int refresh_rate)
>  {
>  	struct intel_dp *intel_dp = dev_priv->drrs.dp;
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	enum drrs_refresh_rate_type index = DRRS_HIGH_RR;
>  
>  	if (refresh_rate <= 0) {
> @@ -4755,7 +4755,7 @@ static void intel_dp_set_drrs_state(struct drm_i915_private *dev_priv,
>  		return;
>  	}
>  
> -	if (!intel_crtc) {
> +	if (!crtc) {
>  		drm_dbg_kms(&dev_priv->drm,
>  			    "DRRS: intel_crtc not initialized\n");
>  		return;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index b170e272bdee..70fe90beaf6c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -308,9 +308,9 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,
>  	 * connector
>  	 */
>  	if (new_crtc) {
> -		struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc);
> +		struct intel_crtc *crtc = to_intel_crtc(new_crtc);
>  		struct intel_crtc_state *crtc_state =
> -			intel_atomic_get_new_crtc_state(state, intel_crtc);
> +			intel_atomic_get_new_crtc_state(state, crtc);
>  
>  		if (!crtc_state ||
>  		    !drm_atomic_crtc_needs_modeset(&crtc_state->uapi) ||
> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
> index cef1061fd6cb..97bb3edca9c9 100644
> --- a/drivers/gpu/drm/i915/display/intel_fdi.c
> +++ b/drivers/gpu/drm/i915/display/intel_fdi.c
> @@ -96,10 +96,10 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
>  	}
>  }
>  
> -int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
> -				  struct intel_crtc_state *pipe_config)
> +int ilk_fdi_compute_config(struct intel_crtc *crtc,
> +			   struct intel_crtc_state *pipe_config)
>  {
> -	struct drm_device *dev = intel_crtc->base.dev;
> +	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_private *i915 = to_i915(dev);
>  	const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
>  	int lane, link_bw, fdi_dotclock, ret;
> @@ -125,7 +125,7 @@ int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
>  	intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,
>  			       link_bw, &pipe_config->fdi_m_n, false, false);
>  
> -	ret = ilk_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);
> +	ret = ilk_check_fdi_lanes(dev, crtc->pipe, pipe_config);
>  	if (ret == -EDEADLK)
>  		return ret;
>  
> @@ -691,9 +691,9 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,
>  
>  void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state)
>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
> -	enum pipe pipe = intel_crtc->pipe;
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum pipe pipe = crtc->pipe;
>  	i915_reg_t reg;
>  	u32 temp;
>  
> @@ -726,11 +726,11 @@ void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state)
>  	}
>  }
>  
> -void ilk_fdi_pll_disable(struct intel_crtc *intel_crtc)
> +void ilk_fdi_pll_disable(struct intel_crtc *crtc)
>  {
> -	struct drm_device *dev = intel_crtc->base.dev;
> +	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> -	enum pipe pipe = intel_crtc->pipe;
> +	enum pipe pipe = crtc->pipe;
>  	i915_reg_t reg;
>  	u32 temp;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 7e51c98c475e..852af2b23540 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -270,8 +270,8 @@ static void ibx_write_infoframe(struct intel_encoder *encoder,
>  {
>  	const u32 *data = frame;
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  	int i;
>  
> @@ -286,13 +286,13 @@ static void ibx_write_infoframe(struct intel_encoder *encoder,
>  	intel_de_write(dev_priv, reg, val);
>  
>  	for (i = 0; i < len; i += 4) {
> -		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe),
> +		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe),
>  			       *data);
>  		data++;
>  	}
>  	/* Write every possible data byte to force correct ECC calculation. */
>  	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
> -		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
> +		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe), 0);
>  
>  	val |= g4x_infoframe_enable(type);
>  	val &= ~VIDEO_DIP_FREQ_MASK;
> @@ -349,8 +349,8 @@ static void cpt_write_infoframe(struct intel_encoder *encoder,
>  {
>  	const u32 *data = frame;
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  	int i;
>  
> @@ -368,13 +368,13 @@ static void cpt_write_infoframe(struct intel_encoder *encoder,
>  	intel_de_write(dev_priv, reg, val);
>  
>  	for (i = 0; i < len; i += 4) {
> -		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe),
> +		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe),
>  			       *data);
>  		data++;
>  	}
>  	/* Write every possible data byte to force correct ECC calculation. */
>  	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
> -		intel_de_write(dev_priv, TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
> +		intel_de_write(dev_priv, TVIDEO_DIP_DATA(crtc->pipe), 0);
>  
>  	val |= g4x_infoframe_enable(type);
>  	val &= ~VIDEO_DIP_FREQ_MASK;
> @@ -427,8 +427,8 @@ static void vlv_write_infoframe(struct intel_encoder *encoder,
>  {
>  	const u32 *data = frame;
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  	int i;
>  
> @@ -444,13 +444,13 @@ static void vlv_write_infoframe(struct intel_encoder *encoder,
>  
>  	for (i = 0; i < len; i += 4) {
>  		intel_de_write(dev_priv,
> -			       VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
> +			       VLV_TVIDEO_DIP_DATA(crtc->pipe), *data);
>  		data++;
>  	}
>  	/* Write every possible data byte to force correct ECC calculation. */
>  	for (; i < VIDEO_DIP_DATA_SIZE; i += 4)
>  		intel_de_write(dev_priv,
> -			       VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), 0);
> +			       VLV_TVIDEO_DIP_DATA(crtc->pipe), 0);
>  
>  	val |= g4x_infoframe_enable(type);
>  	val &= ~VIDEO_DIP_FREQ_MASK;
> @@ -1040,10 +1040,10 @@ static void ibx_set_infoframes(struct intel_encoder *encoder,
>  			       const struct drm_connector_state *conn_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
> -	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  	u32 port = VIDEO_DIP_PORT(encoder->port);
>  
> @@ -1099,9 +1099,9 @@ static void cpt_set_infoframes(struct intel_encoder *encoder,
>  			       const struct drm_connector_state *conn_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> -	i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  
>  	assert_hdmi_port_disabled(intel_hdmi);
> @@ -1148,9 +1148,9 @@ static void vlv_set_infoframes(struct intel_encoder *encoder,
>  			       const struct drm_connector_state *conn_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> -	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
> +	i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe);
>  	u32 val = intel_de_read(dev_priv, reg);
>  	u32 port = VIDEO_DIP_PORT(encoder->port);
>  
> @@ -1465,14 +1465,12 @@ static int kbl_repositioning_enc_en_signal(struct intel_connector *connector,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>  	struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
> -	struct drm_crtc *crtc = connector->base.state->crtc;
> -	struct intel_crtc *intel_crtc = container_of(crtc,
> -						     struct intel_crtc, base);
> +	struct intel_crtc *crtc = to_intel_crtc(connector->base.state->crtc);
>  	u32 scanline;
>  	int ret;
>  
>  	for (;;) {
> -		scanline = intel_de_read(dev_priv, PIPEDSL(intel_crtc->pipe));
> +		scanline = intel_de_read(dev_priv, PIPEDSL(crtc->pipe));
>  		if (scanline > 100 && scanline < 200)
>  			break;
>  		usleep_range(25, 50);
> diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c
> index 7f40e9f60bc2..e0381b0fce91 100644
> --- a/drivers/gpu/drm/i915/display/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/display/intel_lvds.c
> @@ -411,12 +411,12 @@ static int intel_lvds_compute_config(struct intel_encoder *intel_encoder,
>  	struct intel_connector *intel_connector =
>  		lvds_encoder->attached_connector;
>  	struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>  	unsigned int lvds_bpp;
>  	int ret;
>  
>  	/* Should never happen!! */
> -	if (DISPLAY_VER(dev_priv) < 4 && intel_crtc->pipe == 0) {
> +	if (DISPLAY_VER(dev_priv) < 4 && crtc->pipe == 0) {
>  		drm_err(&dev_priv->drm, "Can't support LVDS on pipe A\n");
>  		return -EINVAL;
>  	}
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index e4f91d7a5c60..6cb27599ea03 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -1824,7 +1824,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state,
>  	struct drm_device *dev = encoder->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>  	u32 temp;
>  	bool input1, input2;
>  	int i;
> @@ -1835,7 +1835,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state,
>  	intel_sdvo_write_sdvox(intel_sdvo, temp);
>  
>  	for (i = 0; i < 2; i++)
> -		intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
> +		intel_wait_for_vblank(dev_priv, crtc->pipe);
>  
>  	success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2);
>  	/*
> diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c
> index aa52af7891f0..d02f09f7e750 100644
> --- a/drivers/gpu/drm/i915/display/intel_tv.c
> +++ b/drivers/gpu/drm/i915/display/intel_tv.c
> @@ -1420,7 +1420,7 @@ static void intel_tv_pre_enable(struct intel_atomic_state *state,
>  				const struct drm_connector_state *conn_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>  	struct intel_tv *intel_tv = enc_to_tv(encoder);
>  	const struct intel_tv_connector_state *tv_conn_state =
>  		to_intel_tv_connector_state(conn_state);
> @@ -1466,7 +1466,7 @@ static void intel_tv_pre_enable(struct intel_atomic_state *state,
>  		break;
>  	}
>  
> -	tv_ctl |= TV_ENC_PIPE_SEL(intel_crtc->pipe);
> +	tv_ctl |= TV_ENC_PIPE_SEL(crtc->pipe);
>  
>  	switch (tv_mode->oversample) {
>  	case 8:
> @@ -1571,8 +1571,7 @@ static int
>  intel_tv_detect_type(struct intel_tv *intel_tv,
>  		      struct drm_connector *connector)
>  {
> -	struct drm_crtc *crtc = connector->state->crtc;
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(connector->state->crtc);
>  	struct drm_device *dev = connector->dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	u32 tv_ctl, save_tv_ctl;
> @@ -1594,7 +1593,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
>  	/* Poll for TV detection */
>  	tv_ctl &= ~(TV_ENC_ENABLE | TV_ENC_PIPE_SEL_MASK | TV_TEST_MODE_MASK);
>  	tv_ctl |= TV_TEST_MODE_MONITOR_DETECT;
> -	tv_ctl |= TV_ENC_PIPE_SEL(intel_crtc->pipe);
> +	tv_ctl |= TV_ENC_PIPE_SEL(crtc->pipe);
>  
>  	tv_dac &= ~(TVDAC_SENSE_MASK | DAC_A_MASK | DAC_B_MASK | DAC_C_MASK);
>  	tv_dac |= (TVDAC_STATE_CHG_EN |
> @@ -1619,7 +1618,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
>  	intel_de_write(dev_priv, TV_DAC, tv_dac);
>  	intel_de_posting_read(dev_priv, TV_DAC);
>  
> -	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
> +	intel_wait_for_vblank(dev_priv, crtc->pipe);
>  
>  	type = -1;
>  	tv_dac = intel_de_read(dev_priv, TV_DAC);
> @@ -1652,7 +1651,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
>  	intel_de_posting_read(dev_priv, TV_CTL);
>  
>  	/* For unknown reasons the hw barfs if we don't do this vblank wait. */
> -	intel_wait_for_vblank(dev_priv, intel_crtc->pipe);
> +	intel_wait_for_vblank(dev_priv, crtc->pipe);
>  
>  	/* Restore interrupt config */
>  	if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
> diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
> index 394b7bbf48d8..911a113ee006 100644
> --- a/drivers/gpu/drm/i915/display/skl_scaler.c
> +++ b/drivers/gpu/drm/i915/display/skl_scaler.c
> @@ -96,9 +96,8 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  {
>  	struct intel_crtc_scaler_state *scaler_state =
>  		&crtc_state->scaler_state;
> -	struct intel_crtc *intel_crtc =
> -		to_intel_crtc(crtc_state->uapi.crtc);
> -	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->hw.adjusted_mode;
>  
> @@ -141,7 +140,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  			drm_dbg_kms(&dev_priv->drm,
>  				    "scaler_user index %u.%u: "
>  				    "Staged freeing scaler id %d scaler_users = 0x%x\n",
> -				    intel_crtc->pipe, scaler_user, *scaler_id,
> +				    crtc->pipe, scaler_user, *scaler_id,
>  				    scaler_state->scaler_users);
>  			*scaler_id = -1;
>  		}
> @@ -167,7 +166,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  		drm_dbg_kms(&dev_priv->drm,
>  			    "scaler_user index %u.%u: src %ux%u dst %ux%u "
>  			    "size is out of scaler range\n",
> -			    intel_crtc->pipe, scaler_user, src_w, src_h,
> +			    crtc->pipe, scaler_user, src_w, src_h,
>  			    dst_w, dst_h);
>  		return -EINVAL;
>  	}
> @@ -176,7 +175,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  	scaler_state->scaler_users |= (1 << scaler_user);
>  	drm_dbg_kms(&dev_priv->drm, "scaler_user index %u.%u: "
>  		    "staged scaling request for %ux%u->%ux%u scaler_users = 0x%x\n",
> -		    intel_crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h,
> +		    crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h,
>  		    scaler_state->scaler_users);
>  
>  	return 0;
> @@ -515,17 +514,17 @@ skl_program_plane_scaler(struct intel_plane *plane,
>  			  (crtc_w << 16) | crtc_h);
>  }
>  
> -static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
> +static void skl_detach_scaler(struct intel_crtc *crtc, int id)
>  {
> -	struct drm_device *dev = intel_crtc->base.dev;
> +	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	unsigned long irqflags;
>  
>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  
> -	intel_de_write_fw(dev_priv, SKL_PS_CTRL(intel_crtc->pipe, id), 0);
> -	intel_de_write_fw(dev_priv, SKL_PS_WIN_POS(intel_crtc->pipe, id), 0);
> -	intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(intel_crtc->pipe, id), 0);
> +	intel_de_write_fw(dev_priv, SKL_PS_CTRL(crtc->pipe, id), 0);
> +	intel_de_write_fw(dev_priv, SKL_PS_WIN_POS(crtc->pipe, id), 0);
> +	intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(crtc->pipe, id), 0);
>  
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  }
> @@ -535,15 +534,15 @@ static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
>   */
>  void skl_detach_scalers(const struct intel_crtc_state *crtc_state)
>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  	const struct intel_crtc_scaler_state *scaler_state =
>  		&crtc_state->scaler_state;
>  	int i;
>  
>  	/* loop through and disable scalers that aren't in use */
> -	for (i = 0; i < intel_crtc->num_scalers; i++) {
> +	for (i = 0; i < crtc->num_scalers; i++) {
>  		if (!scaler_state->scalers[i].in_use)
> -			skl_detach_scaler(intel_crtc, i);
> +			skl_detach_scaler(crtc, i);
>  	}
>  }
>  
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
> index 084c9c43b2ed..0ee4ff341e25 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
> @@ -780,10 +780,9 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
>  				 const struct drm_connector_state *conn_state)
>  {
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
> -	struct drm_crtc *crtc = pipe_config->uapi.crtc;
> -	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -	enum pipe pipe = intel_crtc->pipe;
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum pipe pipe = crtc->pipe;
>  	enum port port;
>  	u32 val;
>  	bool glk_cold_boot = false;
> @@ -1389,7 +1388,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
>  	struct drm_encoder *encoder = &intel_encoder->base;
>  	struct drm_device *dev = encoder->dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder));
>  	const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
>  	enum port port;
> @@ -1397,7 +1396,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
>  	u32 val, tmp;
>  	u16 mode_hdisplay;
>  
> -	drm_dbg_kms(&dev_priv->drm, "pipe %c\n", pipe_name(intel_crtc->pipe));
> +	drm_dbg_kms(&dev_priv->drm, "pipe %c\n", pipe_name(crtc->pipe));
>  
>  	mode_hdisplay = adjusted_mode->crtc_hdisplay;
>  
> @@ -1424,7 +1423,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
>  			intel_de_write(dev_priv, MIPI_CTRL(port),
>  				       tmp | READ_REQUEST_PRIORITY_HIGH);
>  		} else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
> -			enum pipe pipe = intel_crtc->pipe;
> +			enum pipe pipe = crtc->pipe;
>  
>  			tmp = intel_de_read(dev_priv, MIPI_CTRL(port));
>  			tmp &= ~BXT_PIPE_SELECT_MASK;
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index a11bdb667241..3cb0a65a996b 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2881,14 +2881,14 @@ static bool gen11_dsi_configure_te(struct intel_crtc *intel_crtc,
>  	return true;
>  }
>  
> -int bdw_enable_vblank(struct drm_crtc *crtc)
> +int bdw_enable_vblank(struct drm_crtc *_crtc)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -	enum pipe pipe = intel_crtc->pipe;
> +	struct intel_crtc *crtc = to_intel_crtc(_crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum pipe pipe = crtc->pipe;
>  	unsigned long irqflags;
>  
> -	if (gen11_dsi_configure_te(intel_crtc, true))
> +	if (gen11_dsi_configure_te(crtc, true))
>  		return 0;
>  
>  	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> @@ -2899,7 +2899,7 @@ int bdw_enable_vblank(struct drm_crtc *crtc)
>  	 * PSR is active as no frames are generated, so check only for PSR.
>  	 */
>  	if (HAS_PSR(dev_priv))
> -		drm_crtc_vblank_restore(crtc);
> +		drm_crtc_vblank_restore(&crtc->base);
>  
>  	return 0;
>  }
> @@ -2953,14 +2953,14 @@ void ilk_disable_vblank(struct drm_crtc *crtc)
>  	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
>  }
>  
> -void bdw_disable_vblank(struct drm_crtc *crtc)
> +void bdw_disable_vblank(struct drm_crtc *_crtc)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -	enum pipe pipe = intel_crtc->pipe;
> +	struct intel_crtc *crtc = to_intel_crtc(_crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum pipe pipe = crtc->pipe;
>  	unsigned long irqflags;
>  
> -	if (gen11_dsi_configure_te(intel_crtc, false))
> +	if (gen11_dsi_configure_te(crtc, false))
>  		return;
>  
>  	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() a bit
  2021-06-09 11:36   ` Rodrigo Vivi
@ 2021-06-09 12:15     ` Ville Syrjälä
  2021-06-09 21:05       ` Rodrigo Vivi
  0 siblings, 1 reply; 21+ messages in thread
From: Ville Syrjälä @ 2021-06-09 12:15 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 07:36:01AM -0400, Rodrigo Vivi wrote:
> On Wed, Jun 09, 2021 at 11:56:29AM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Sort out the mess with the local variables in
> > intel_find_initial_plane_obj(). Get rid of all aliasing pointers
> > and use standard naming/types.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 113 ++++++++++---------
> >  1 file changed, 62 insertions(+), 51 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 78815a1ac0ca..1615501685c9 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -1914,20 +1914,50 @@ static void intel_dpt_unpin(struct i915_address_space *vm)
> >  	i915_vma_put(dpt->vma);
> >  }
> >  
> > +static bool
> > +intel_reuse_initial_plane_obj(struct drm_i915_private *i915,
> > +			      const struct intel_initial_plane_config *plane_config,
> > +			      struct drm_framebuffer **fb,
> > +			      struct i915_vma **vma)
> > +{
> > +	struct intel_crtc *crtc;
> > +
> > +	for_each_intel_crtc(&i915->drm, crtc) {
> > +		struct intel_crtc_state *crtc_state =
> > +			to_intel_crtc_state(crtc->base.state);
> > +		struct intel_plane *plane =
> > +			to_intel_plane(crtc->base.primary);
> > +		struct intel_plane_state *plane_state =
> > +			to_intel_plane_state(plane->base.state);
> > +
> > +		if (!crtc_state->uapi.active)
> > +			continue;
> > +
> > +		if (!plane_state->ggtt_vma)
> > +			continue;
> > +
> > +		if (intel_plane_ggtt_offset(plane_state) == plane_config->base) {
> > +			*fb = plane_state->hw.fb;
> > +			*vma = plane_state->ggtt_vma;
> > +			return true;
> > +		}
> > +	}
> > +
> > +	return false;
> > +}
> > +
> >  static void
> > -intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > +intel_find_initial_plane_obj(struct intel_crtc *crtc,
> >  			     struct intel_initial_plane_config *plane_config)
> >  {
> > -	struct drm_device *dev = intel_crtc->base.dev;
> > +	struct drm_device *dev = crtc->base.dev;
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> > -	struct drm_crtc *c;
> > -	struct drm_plane *primary = intel_crtc->base.primary;
> > -	struct drm_plane_state *plane_state = primary->state;
> > -	struct intel_plane *intel_plane = to_intel_plane(primary);
> > -	struct intel_plane_state *intel_state =
> > -		to_intel_plane_state(plane_state);
> >  	struct intel_crtc_state *crtc_state =
> > -		to_intel_crtc_state(intel_crtc->base.state);
> > +		to_intel_crtc_state(crtc->base.state);
> > +	struct intel_plane *plane =
> > +		to_intel_plane(crtc->base.primary);
> > +	struct intel_plane_state *plane_state =
> > +		to_intel_plane_state(plane->base.state);
> >  	struct drm_framebuffer *fb;
> >  	struct i915_vma *vma;
> >  
> > @@ -1939,7 +1969,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >  	if (!plane_config->fb)
> >  		return;
> >  
> > -	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
> > +	if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
> >  		fb = &plane_config->fb->base;
> >  		vma = plane_config->vma;
> >  		goto valid_fb;
> > @@ -1949,25 +1979,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >  	 * Failed to alloc the obj, check to see if we should share
> >  	 * an fb with another CRTC instead
> >  	 */
> > -	for_each_crtc(dev, c) {
> > -		struct intel_plane_state *state;
> > -
> > -		if (c == &intel_crtc->base)
> > -			continue;
> > -
> > -		if (!to_intel_crtc_state(c->state)->uapi.active)
> > -			continue;
> > -
> > -		state = to_intel_plane_state(c->primary->state);
> > -		if (!state->ggtt_vma)
> > -			continue;
> > -
> > -		if (intel_plane_ggtt_offset(state) == plane_config->base) {
> > -			fb = state->hw.fb;
> > -			vma = state->ggtt_vma;
> > -			goto valid_fb;
> > -		}
> > -	}
> > +	if (intel_reuse_initial_plane_obj(dev_priv, plane_config, &fb, &vma))
> > +		goto valid_fb;
> >  
> >  	/*
> >  	 * We've failed to reconstruct the BIOS FB.  Current display state
> > @@ -1976,7 +1989,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >  	 * simplest solution is to just disable the primary plane now and
> >  	 * pretend the BIOS never had it enabled.
> >  	 */
> > -	intel_plane_disable_noatomic(intel_crtc, intel_plane);
> > +	intel_plane_disable_noatomic(crtc, plane);
> >  	if (crtc_state->bigjoiner) {
> >  		struct intel_crtc *slave =
> >  			crtc_state->bigjoiner_linked_crtc;
> > @@ -1986,40 +1999,38 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >  	return;
> >  
> >  valid_fb:
> > -	plane_state->rotation = plane_config->rotation;
> > -	intel_fb_fill_view(to_intel_framebuffer(fb), plane_state->rotation,
> > -			   &intel_state->view);
> > +	plane_state->uapi.rotation = plane_config->rotation;
> > +	intel_fb_fill_view(to_intel_framebuffer(fb),
> > +			   plane_state->uapi.rotation, &plane_state->view);
> >  
> >  	__i915_vma_pin(vma);
> > -	intel_state->ggtt_vma = i915_vma_get(vma);
> > -	if (intel_plane_uses_fence(intel_state) && i915_vma_pin_fence(vma) == 0)
> > -		if (vma->fence)
> > -			intel_state->flags |= PLANE_HAS_FENCE;
> > +	plane_state->ggtt_vma = i915_vma_get(vma);
> > +	if (intel_plane_uses_fence(plane_state) &&
> > +	    i915_vma_pin_fence(vma) == 0 && vma->fence)
> > +		plane_state->flags |= PLANE_HAS_FENCE;
> >  
> > -	plane_state->src_x = 0;
> > -	plane_state->src_y = 0;
> > -	plane_state->src_w = fb->width << 16;
> > -	plane_state->src_h = fb->height << 16;
> > +	plane_state->uapi.src_x = 0;
> > +	plane_state->uapi.src_y = 0;
> > +	plane_state->uapi.src_w = fb->width << 16;
> > +	plane_state->uapi.src_h = fb->height << 16;
> >  
> > -	plane_state->crtc_x = 0;
> > -	plane_state->crtc_y = 0;
> > -	plane_state->crtc_w = fb->width;
> > -	plane_state->crtc_h = fb->height;
> > +	plane_state->uapi.crtc_x = 0;
> > +	plane_state->uapi.crtc_y = 0;
> > +	plane_state->uapi.crtc_w = fb->width;
> > +	plane_state->uapi.crtc_h = fb->height;
> >  
> >  	if (plane_config->tiling)
> >  		dev_priv->preserve_bios_swizzle = true;
> >  
> > -	plane_state->fb = fb;
> > +	plane_state->uapi.fb = fb;
> 
> I believe we should have a separated patch for these plane_state uapi changes

There is no change here. &to_intel_plane_state(s)->uapi == s

> 
> >  	drm_framebuffer_get(fb);
> >  
> > -	plane_state->crtc = &intel_crtc->base;
> > -	intel_plane_copy_uapi_to_hw_state(intel_state, intel_state,
> > -					  intel_crtc);
> > +	plane_state->uapi.crtc = &crtc->base;
> > +	intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
> >  
> >  	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
> >  
> > -	atomic_or(to_intel_plane(primary)->frontbuffer_bit,
> > -		  &to_intel_frontbuffer(fb)->bits);
> > +	atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
> >  }
> >  
> >  unsigned int
> > -- 
> > 2.31.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Cleanup intel_crtc leftovers
  2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
                   ` (9 preceding siblings ...)
  2021-06-09 10:09 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
@ 2021-06-09 12:42 ` Patchwork
  10 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2021-06-09 12:42 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 30261 bytes --]

== Series Details ==

Series: drm/i915: Cleanup intel_crtc leftovers
URL   : https://patchwork.freedesktop.org/series/91228/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10196_full -> Patchwork_20321_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_20321_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_20321_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_20321_full:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes:
    - shard-skl:          [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl3/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl3/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes.html

  
Known issues
------------

  Here are the changes found in Patchwork_20321_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@preservation-s3@vcs0:
    - shard-skl:          [PASS][3] -> [INCOMPLETE][4] ([i915#198])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl10/igt@gem_ctx_isolation@preservation-s3@vcs0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl3/igt@gem_ctx_isolation@preservation-s3@vcs0.html

  * igt@gem_ctx_persistence@clone:
    - shard-snb:          NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#1099]) +3 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-snb5/igt@gem_ctx_persistence@clone.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-iclb:         [PASS][6] -> [FAIL][7] ([i915#2842])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb6/igt@gem_exec_fair@basic-none-share@rcs0.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb7/igt@gem_exec_fair@basic-none-share@rcs0.html
    - shard-glk:          [PASS][8] -> [FAIL][9] ([i915#2842])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-glk8/igt@gem_exec_fair@basic-none-share@rcs0.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-glk3/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-kbl:          [PASS][10] -> [FAIL][11] ([i915#2842]) +2 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-kbl6/igt@gem_exec_fair@basic-none@vcs0.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl7/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [PASS][12] -> [FAIL][13] ([i915#2842]) +1 similar issue
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-tglb6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-tglb1/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-kbl:          NOTRUN -> [FAIL][14] ([i915#2842])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl2/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_params@no-vebox:
    - shard-iclb:         NOTRUN -> [SKIP][15] ([fdo#109283])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@gem_exec_params@no-vebox.html

  * igt@gem_exec_whisper@basic-queues-priority:
    - shard-glk:          [PASS][16] -> [DMESG-WARN][17] ([i915#118] / [i915#95])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-glk8/igt@gem_exec_whisper@basic-queues-priority.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-glk3/igt@gem_exec_whisper@basic-queues-priority.html

  * igt@gem_mmap_gtt@big-copy:
    - shard-glk:          [PASS][18] -> [FAIL][19] ([i915#307])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-glk7/igt@gem_mmap_gtt@big-copy.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-glk5/igt@gem_mmap_gtt@big-copy.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-iclb:         NOTRUN -> [WARN][20] ([i915#2658])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@gem_pwrite@basic-exhaustion.html

  * igt@gem_userptr_blits@input-checking:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][21] ([i915#3002])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl4/igt@gem_userptr_blits@input-checking.html

  * igt@gem_userptr_blits@invalid-mmap-offset-unsync:
    - shard-iclb:         NOTRUN -> [SKIP][22] ([i915#3297])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@gem_userptr_blits@invalid-mmap-offset-unsync.html

  * igt@gem_vm_create@destroy-race:
    - shard-tglb:         [PASS][23] -> [INCOMPLETE][24] ([i915#3325])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-tglb7/igt@gem_vm_create@destroy-race.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-tglb3/igt@gem_vm_create@destroy-race.html

  * igt@gen9_exec_parse@bb-large:
    - shard-apl:          NOTRUN -> [FAIL][25] ([i915#3296])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl7/igt@gen9_exec_parse@bb-large.html

  * igt@i915_hangman@engine-error@vecs0:
    - shard-kbl:          NOTRUN -> [SKIP][26] ([fdo#109271]) +109 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl3/igt@i915_hangman@engine-error@vecs0.html

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
    - shard-apl:          NOTRUN -> [SKIP][27] ([fdo#109271] / [i915#1937])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl7/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp.html

  * igt@i915_pm_rpm@modeset-non-lpsp-stress:
    - shard-iclb:         NOTRUN -> [SKIP][28] ([fdo#110892])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@i915_pm_rpm@modeset-non-lpsp-stress.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-apl:          [PASS][29] -> [DMESG-WARN][30] ([i915#180]) +2 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl2/igt@i915_suspend@fence-restore-tiled2untiled.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl2/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@i915_suspend@forcewake:
    - shard-kbl:          [PASS][31] -> [DMESG-WARN][32] ([i915#180]) +3 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-kbl1/igt@i915_suspend@forcewake.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl3/igt@i915_suspend@forcewake.html

  * igt@kms_big_fb@y-tiled-8bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][33] ([fdo#110725] / [fdo#111614])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_big_fb@y-tiled-8bpp-rotate-90.html

  * igt@kms_big_fb@yf-tiled-64bpp-rotate-0:
    - shard-iclb:         NOTRUN -> [SKIP][34] ([fdo#110723])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_big_fb@yf-tiled-64bpp-rotate-0.html

  * igt@kms_ccs@pipe-a-ccs-on-another-bo:
    - shard-snb:          NOTRUN -> [SKIP][35] ([fdo#109271]) +469 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-snb5/igt@kms_ccs@pipe-a-ccs-on-another-bo.html

  * igt@kms_ccs@pipe-c-random-ccs-data:
    - shard-skl:          NOTRUN -> [SKIP][36] ([fdo#109271] / [fdo#111304])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl7/igt@kms_ccs@pipe-c-random-ccs-data.html

  * igt@kms_chamelium@vga-hpd-without-ddc:
    - shard-kbl:          NOTRUN -> [SKIP][37] ([fdo#109271] / [fdo#111827]) +7 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl6/igt@kms_chamelium@vga-hpd-without-ddc.html

  * igt@kms_color_chamelium@pipe-a-ctm-limited-range:
    - shard-apl:          NOTRUN -> [SKIP][38] ([fdo#109271] / [fdo#111827]) +28 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl1/igt@kms_color_chamelium@pipe-a-ctm-limited-range.html

  * igt@kms_color_chamelium@pipe-a-ctm-red-to-blue:
    - shard-iclb:         NOTRUN -> [SKIP][39] ([fdo#109284] / [fdo#111827]) +3 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_color_chamelium@pipe-a-ctm-red-to-blue.html

  * igt@kms_color_chamelium@pipe-d-degamma:
    - shard-skl:          NOTRUN -> [SKIP][40] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@kms_color_chamelium@pipe-d-degamma.html

  * igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes:
    - shard-snb:          NOTRUN -> [SKIP][41] ([fdo#109271] / [fdo#111827]) +26 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-snb2/igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes.html

  * igt@kms_content_protection@atomic-dpms:
    - shard-kbl:          NOTRUN -> [TIMEOUT][42] ([i915#1319]) +1 similar issue
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl2/igt@kms_content_protection@atomic-dpms.html

  * igt@kms_content_protection@content_type_change:
    - shard-iclb:         NOTRUN -> [SKIP][43] ([fdo#109300] / [fdo#111066])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_content_protection@content_type_change.html

  * igt@kms_content_protection@lic:
    - shard-apl:          NOTRUN -> [TIMEOUT][44] ([i915#1319]) +2 similar issues
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl8/igt@kms_content_protection@lic.html

  * igt@kms_content_protection@uevent:
    - shard-apl:          NOTRUN -> [FAIL][45] ([i915#2105])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl3/igt@kms_content_protection@uevent.html

  * igt@kms_cursor_crc@pipe-d-cursor-32x10-offscreen:
    - shard-iclb:         NOTRUN -> [SKIP][46] ([fdo#109278]) +10 similar issues
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_cursor_crc@pipe-d-cursor-32x10-offscreen.html

  * igt@kms_cursor_legacy@cursorb-vs-flipb-varying-size:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([fdo#109274] / [fdo#109278])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_cursor_legacy@cursorb-vs-flipb-varying-size.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-skl:          [PASS][48] -> [FAIL][49] ([i915#2346] / [i915#533])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@pipe-d-torture-bo:
    - shard-apl:          NOTRUN -> [SKIP][50] ([fdo#109271] / [i915#533]) +2 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl1/igt@kms_cursor_legacy@pipe-d-torture-bo.html

  * igt@kms_cursor_legacy@pipe-d-torture-move:
    - shard-skl:          NOTRUN -> [SKIP][51] ([fdo#109271]) +62 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@kms_cursor_legacy@pipe-d-torture-move.html

  * igt@kms_flip@2x-nonexisting-fb:
    - shard-iclb:         NOTRUN -> [SKIP][52] ([fdo#109274]) +3 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_flip@2x-nonexisting-fb.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:
    - shard-skl:          NOTRUN -> [SKIP][53] ([fdo#109271] / [i915#2672])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl7/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-skl:          [PASS][54] -> [FAIL][55] ([i915#49]) +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl9/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-shrfb-pgflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][56] ([fdo#109280]) +6 similar issues
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_frontbuffer_tracking@psr-2p-primscrn-shrfb-pgflip-blt.html

  * igt@kms_hdr@bpc-switch-suspend:
    - shard-skl:          [PASS][57] -> [FAIL][58] ([i915#1188])
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl2/igt@kms_hdr@bpc-switch-suspend.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl7/igt@kms_hdr@bpc-switch-suspend.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
    - shard-apl:          NOTRUN -> [FAIL][59] ([fdo#108145] / [i915#265]) +5 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl8/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-skl:          NOTRUN -> [FAIL][60] ([fdo#108145] / [i915#265])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl7/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
    - shard-kbl:          NOTRUN -> [FAIL][61] ([fdo#108145] / [i915#265]) +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl6/igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [PASS][62] -> [FAIL][63] ([fdo#108145] / [i915#265]) +1 similar issue
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl2/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-b-tiling-x:
    - shard-iclb:         NOTRUN -> [SKIP][64] ([i915#3536])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_plane_lowres@pipe-b-tiling-x.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
    - shard-apl:          NOTRUN -> [SKIP][65] ([fdo#109271] / [i915#2733])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl1/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-5:
    - shard-iclb:         NOTRUN -> [SKIP][66] ([i915#658])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-5.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-2:
    - shard-kbl:          NOTRUN -> [SKIP][67] ([fdo#109271] / [i915#658]) +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl2/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-2.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5:
    - shard-apl:          NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#658]) +8 similar issues
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl1/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         NOTRUN -> [SKIP][69] ([fdo#109642] / [fdo#111068] / [i915#658])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [PASS][70] -> [SKIP][71] ([fdo#109441]) +3 similar issues
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb6/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-snb:          NOTRUN -> [FAIL][72] ([i915#31])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-snb5/igt@kms_setmode@basic.html

  * igt@kms_sysfs_edid_timing:
    - shard-apl:          NOTRUN -> [FAIL][73] ([IGT#2])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl3/igt@kms_sysfs_edid_timing.html

  * igt@kms_writeback@writeback-pixel-formats:
    - shard-skl:          NOTRUN -> [SKIP][74] ([fdo#109271] / [i915#2437])
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@kms_writeback@writeback-pixel-formats.html

  * igt@nouveau_crc@pipe-c-source-rg:
    - shard-iclb:         NOTRUN -> [SKIP][75] ([i915#2530])
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@nouveau_crc@pipe-c-source-rg.html

  * igt@perf@unprivileged-single-ctx-counters:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([fdo#109289]) +2 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@perf@unprivileged-single-ctx-counters.html

  * igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name:
    - shard-apl:          NOTRUN -> [SKIP][77] ([fdo#109271]) +293 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl7/igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name.html

  * igt@sysfs_clients@fair-1:
    - shard-apl:          NOTRUN -> [SKIP][78] ([fdo#109271] / [i915#2994]) +5 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl6/igt@sysfs_clients@fair-1.html

  * igt@sysfs_clients@sema-25:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([i915#2994])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@sysfs_clients@sema-25.html

  * igt@sysfs_clients@split-50:
    - shard-kbl:          NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#2994])
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl4/igt@sysfs_clients@split-50.html

  
#### Possible fixes ####

  * igt@gem_ctx_ringsize@active@bcs0:
    - shard-skl:          [INCOMPLETE][81] ([i915#3316]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl8/igt@gem_ctx_ringsize@active@bcs0.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl4/igt@gem_ctx_ringsize@active@bcs0.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - shard-glk:          [FAIL][83] ([i915#2842]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-glk3/igt@gem_exec_fair@basic-pace@rcs0.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-glk5/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs1:
    - shard-kbl:          [FAIL][85] ([i915#2842]) -> [PASS][86]
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-kbl7/igt@gem_exec_fair@basic-pace@vcs1.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl3/igt@gem_exec_fair@basic-pace@vcs1.html

  * igt@gem_exec_whisper@basic-queues-forked-all:
    - shard-iclb:         [INCOMPLETE][87] ([i915#1895]) -> [PASS][88]
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb6/igt@gem_exec_whisper@basic-queues-forked-all.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@gem_exec_whisper@basic-queues-forked-all.html

  * igt@gem_mmap_gtt@cpuset-big-copy:
    - shard-iclb:         [FAIL][89] ([i915#307]) -> [PASS][90]
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb1/igt@gem_mmap_gtt@cpuset-big-copy.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb2/igt@gem_mmap_gtt@cpuset-big-copy.html

  * igt@gem_mmap_gtt@cpuset-big-copy-xy:
    - shard-iclb:         [FAIL][91] ([i915#2428]) -> [PASS][92]
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb7/igt@gem_mmap_gtt@cpuset-big-copy-xy.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb3/igt@gem_mmap_gtt@cpuset-big-copy-xy.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [FAIL][93] ([i915#644]) -> [PASS][94]
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-glk8/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-glk7/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@i915_suspend@forcewake:
    - shard-skl:          [INCOMPLETE][95] ([i915#636]) -> [PASS][96]
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl6/igt@i915_suspend@forcewake.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl7/igt@i915_suspend@forcewake.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1:
    - shard-skl:          [FAIL][97] ([i915#79]) -> [PASS][98]
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl7/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl9/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
    - shard-kbl:          [DMESG-WARN][99] ([i915#180]) -> [PASS][100] +8 similar issues
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl6/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
    - shard-apl:          [DMESG-WARN][101] ([i915#180]) -> [PASS][102]
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl3/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl1/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html

  * igt@kms_flip@plain-flip-fb-recreate@a-edp1:
    - shard-skl:          [FAIL][103] ([i915#2122]) -> [PASS][104] +1 similar issue
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl6/igt@kms_flip@plain-flip-fb-recreate@a-edp1.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl10/igt@kms_flip@plain-flip-fb-recreate@a-edp1.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence:
    - shard-skl:          [DMESG-WARN][105] ([i915#1982]) -> [PASS][106] +1 similar issue
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl9/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl10/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence.html

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
    - shard-skl:          [FAIL][107] ([fdo#108145] / [i915#265]) -> [PASS][108]
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl10/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl3/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html

  * igt@kms_psr@psr2_cursor_blt:
    - shard-iclb:         [SKIP][109] ([fdo#109441]) -> [PASS][110] +1 similar issue
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb1/igt@kms_psr@psr2_cursor_blt.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-kbl:          [DMESG-WARN][111] ([i915#180] / [i915#295]) -> [PASS][112]
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-kbl7/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-kbl3/igt@kms_vblank@pipe-a-ts-continuation-suspend.html

  * igt@perf@blocking:
    - shard-skl:          [FAIL][113] ([i915#1542]) -> [PASS][114]
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl8/igt@perf@blocking.html
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl2/igt@perf@blocking.html

  * igt@sysfs_heartbeat_interval@mixed@bcs0:
    - shard-skl:          [INCOMPLETE][115] ([i915#198]) -> [PASS][116]
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl9/igt@sysfs_heartbeat_interval@mixed@bcs0.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl8/igt@sysfs_heartbeat_interval@mixed@bcs0.html

  
#### Warnings ####

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][117] ([i915#1804] / [i915#2684]) -> [WARN][118] ([i915#2684])
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb4/igt@i915_pm_rc6_residency@rc6-idle.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb5/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@i915_selftest@live@execlists:
    - shard-iclb:         [DMESG-FAIL][119] ([i915#3462]) -> [INCOMPLETE][120] ([i915#2782] / [i915#3462])
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb7/igt@i915_selftest@live@execlists.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb4/igt@i915_selftest@live@execlists.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
    - shard-iclb:         [SKIP][121] ([i915#2920]) -> [SKIP][122] ([i915#658]) +2 similar issues
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-iclb2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-iclb5/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][123], [FAIL][124], [FAIL][125], [FAIL][126]) ([fdo#109271] / [i915#180] / [i915#3002] / [i915#3363]) -> ([FAIL][127], [FAIL][128], [FAIL][129]) ([i915#180] / [i915#3002] / [i915#3363])
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl8/igt@runner@aborted.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl3/igt@runner@aborted.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl2/igt@runner@aborted.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-apl8/igt@runner@aborted.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl8/igt@runner@aborted.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl2/igt@runner@aborted.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-apl6/igt@runner@aborted.html
    - shard-skl:          ([FAIL][130], [FAIL][131], [FAIL][132]) ([i915#1436] / [i915#3002] / [i915#3363]) -> ([FAIL][133], [FAIL][134], [FAIL][135]) ([i915#1436] / [i915#2426] / [i915#3002] / [i915#3363])
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl7/igt@runner@aborted.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl6/igt@runner@aborted.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10196/shard-skl5/igt@runner@aborted.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl10/igt@runner@aborted.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl2/igt@runner@aborted.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/shard-skl10/igt@runner@aborted.html

  
  [IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#110725]: https://bugs.freedesktop.org/show_bug.cgi?id=110725
  [fdo#110892]: https://bugs.freedesktop.org/show_bug.cgi?id=110892
  [fdo#111066]: https://bugs.freedesktop.org/show_bug.cgi?id=111066
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111304]: https://bugs.freedesktop.org/show_bug.cgi?id=111304
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
  [i915#1895]: htt

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20321/index.html

[-- Attachment #1.2: Type: text/html, Size: 36126 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() a bit
  2021-06-09 12:15     ` Ville Syrjälä
@ 2021-06-09 21:05       ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 21:05 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 03:15:54PM +0300, Ville Syrjälä wrote:
> On Wed, Jun 09, 2021 at 07:36:01AM -0400, Rodrigo Vivi wrote:
> > On Wed, Jun 09, 2021 at 11:56:29AM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Sort out the mess with the local variables in
> > > intel_find_initial_plane_obj(). Get rid of all aliasing pointers
> > > and use standard naming/types.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_display.c | 113 ++++++++++---------
> > >  1 file changed, 62 insertions(+), 51 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > > index 78815a1ac0ca..1615501685c9 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > @@ -1914,20 +1914,50 @@ static void intel_dpt_unpin(struct i915_address_space *vm)
> > >  	i915_vma_put(dpt->vma);
> > >  }
> > >  
> > > +static bool
> > > +intel_reuse_initial_plane_obj(struct drm_i915_private *i915,
> > > +			      const struct intel_initial_plane_config *plane_config,
> > > +			      struct drm_framebuffer **fb,
> > > +			      struct i915_vma **vma)
> > > +{
> > > +	struct intel_crtc *crtc;
> > > +
> > > +	for_each_intel_crtc(&i915->drm, crtc) {
> > > +		struct intel_crtc_state *crtc_state =
> > > +			to_intel_crtc_state(crtc->base.state);
> > > +		struct intel_plane *plane =
> > > +			to_intel_plane(crtc->base.primary);
> > > +		struct intel_plane_state *plane_state =
> > > +			to_intel_plane_state(plane->base.state);
> > > +
> > > +		if (!crtc_state->uapi.active)
> > > +			continue;
> > > +
> > > +		if (!plane_state->ggtt_vma)
> > > +			continue;
> > > +
> > > +		if (intel_plane_ggtt_offset(plane_state) == plane_config->base) {
> > > +			*fb = plane_state->hw.fb;
> > > +			*vma = plane_state->ggtt_vma;
> > > +			return true;
> > > +		}
> > > +	}
> > > +
> > > +	return false;
> > > +}
> > > +
> > >  static void
> > > -intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > > +intel_find_initial_plane_obj(struct intel_crtc *crtc,
> > >  			     struct intel_initial_plane_config *plane_config)
> > >  {
> > > -	struct drm_device *dev = intel_crtc->base.dev;
> > > +	struct drm_device *dev = crtc->base.dev;
> > >  	struct drm_i915_private *dev_priv = to_i915(dev);
> > > -	struct drm_crtc *c;
> > > -	struct drm_plane *primary = intel_crtc->base.primary;
> > > -	struct drm_plane_state *plane_state = primary->state;
> > > -	struct intel_plane *intel_plane = to_intel_plane(primary);
> > > -	struct intel_plane_state *intel_state =
> > > -		to_intel_plane_state(plane_state);
> > >  	struct intel_crtc_state *crtc_state =
> > > -		to_intel_crtc_state(intel_crtc->base.state);
> > > +		to_intel_crtc_state(crtc->base.state);
> > > +	struct intel_plane *plane =
> > > +		to_intel_plane(crtc->base.primary);
> > > +	struct intel_plane_state *plane_state =
> > > +		to_intel_plane_state(plane->base.state);
> > >  	struct drm_framebuffer *fb;
> > >  	struct i915_vma *vma;
> > >  
> > > @@ -1939,7 +1969,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >  	if (!plane_config->fb)
> > >  		return;
> > >  
> > > -	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
> > > +	if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
> > >  		fb = &plane_config->fb->base;
> > >  		vma = plane_config->vma;
> > >  		goto valid_fb;
> > > @@ -1949,25 +1979,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >  	 * Failed to alloc the obj, check to see if we should share
> > >  	 * an fb with another CRTC instead
> > >  	 */
> > > -	for_each_crtc(dev, c) {
> > > -		struct intel_plane_state *state;
> > > -
> > > -		if (c == &intel_crtc->base)
> > > -			continue;
> > > -
> > > -		if (!to_intel_crtc_state(c->state)->uapi.active)
> > > -			continue;
> > > -
> > > -		state = to_intel_plane_state(c->primary->state);
> > > -		if (!state->ggtt_vma)
> > > -			continue;
> > > -
> > > -		if (intel_plane_ggtt_offset(state) == plane_config->base) {
> > > -			fb = state->hw.fb;
> > > -			vma = state->ggtt_vma;
> > > -			goto valid_fb;
> > > -		}
> > > -	}
> > > +	if (intel_reuse_initial_plane_obj(dev_priv, plane_config, &fb, &vma))
> > > +		goto valid_fb;
> > >  
> > >  	/*
> > >  	 * We've failed to reconstruct the BIOS FB.  Current display state
> > > @@ -1976,7 +1989,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >  	 * simplest solution is to just disable the primary plane now and
> > >  	 * pretend the BIOS never had it enabled.
> > >  	 */
> > > -	intel_plane_disable_noatomic(intel_crtc, intel_plane);
> > > +	intel_plane_disable_noatomic(crtc, plane);
> > >  	if (crtc_state->bigjoiner) {
> > >  		struct intel_crtc *slave =
> > >  			crtc_state->bigjoiner_linked_crtc;
> > > @@ -1986,40 +1999,38 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >  	return;
> > >  
> > >  valid_fb:
> > > -	plane_state->rotation = plane_config->rotation;
> > > -	intel_fb_fill_view(to_intel_framebuffer(fb), plane_state->rotation,
> > > -			   &intel_state->view);
> > > +	plane_state->uapi.rotation = plane_config->rotation;
> > > +	intel_fb_fill_view(to_intel_framebuffer(fb),
> > > +			   plane_state->uapi.rotation, &plane_state->view);
> > >  
> > >  	__i915_vma_pin(vma);
> > > -	intel_state->ggtt_vma = i915_vma_get(vma);
> > > -	if (intel_plane_uses_fence(intel_state) && i915_vma_pin_fence(vma) == 0)
> > > -		if (vma->fence)
> > > -			intel_state->flags |= PLANE_HAS_FENCE;
> > > +	plane_state->ggtt_vma = i915_vma_get(vma);
> > > +	if (intel_plane_uses_fence(plane_state) &&
> > > +	    i915_vma_pin_fence(vma) == 0 && vma->fence)
> > > +		plane_state->flags |= PLANE_HAS_FENCE;
> > >  
> > > -	plane_state->src_x = 0;
> > > -	plane_state->src_y = 0;
> > > -	plane_state->src_w = fb->width << 16;
> > > -	plane_state->src_h = fb->height << 16;
> > > +	plane_state->uapi.src_x = 0;
> > > +	plane_state->uapi.src_y = 0;
> > > +	plane_state->uapi.src_w = fb->width << 16;
> > > +	plane_state->uapi.src_h = fb->height << 16;
> > >  
> > > -	plane_state->crtc_x = 0;
> > > -	plane_state->crtc_y = 0;
> > > -	plane_state->crtc_w = fb->width;
> > > -	plane_state->crtc_h = fb->height;
> > > +	plane_state->uapi.crtc_x = 0;
> > > +	plane_state->uapi.crtc_y = 0;
> > > +	plane_state->uapi.crtc_w = fb->width;
> > > +	plane_state->uapi.crtc_h = fb->height;
> > >  
> > >  	if (plane_config->tiling)
> > >  		dev_priv->preserve_bios_swizzle = true;
> > >  
> > > -	plane_state->fb = fb;
> > > +	plane_state->uapi.fb = fb;
> > 
> > I believe we should have a separated patch for these plane_state uapi changes
> 
> There is no change here. &to_intel_plane_state(s)->uapi == s

Duh! of course...


Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>



> 
> > 
> > >  	drm_framebuffer_get(fb);
> > >  
> > > -	plane_state->crtc = &intel_crtc->base;
> > > -	intel_plane_copy_uapi_to_hw_state(intel_state, intel_state,
> > > -					  intel_crtc);
> > > +	plane_state->uapi.crtc = &crtc->base;
> > > +	intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
> > >  
> > >  	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
> > >  
> > > -	atomic_or(to_intel_plane(primary)->frontbuffer_bit,
> > > -		  &to_intel_frontbuffer(fb)->bits);
> > > +	atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
> > >  }
> > >  
> > >  unsigned int
> > > -- 
> > > 2.31.1
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit
  2021-06-09 11:46   ` Rodrigo Vivi
@ 2021-06-09 21:06     ` Rodrigo Vivi
  0 siblings, 0 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2021-06-09 21:06 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Wed, Jun 09, 2021 at 07:46:28AM -0400, Rodrigo Vivi wrote:
> On Wed, Jun 09, 2021 at 11:56:31AM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Sort out the mess with the local variables in
> > intel_fbdev_init_bios(). Get rid of all aliasing pointers,
> > use standard naming/types, and introduc a few more locals
> 
>                                          ^ typo
> 
> > in the loops to avoid the hard to read long struct walks.
> > 
> > While at we also polish the debugs a bit to use the
> > canonical [CRTC:%d:%s] style.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_fbdev.c | 94 +++++++++++++---------
> >  1 file changed, 56 insertions(+), 38 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > index 4af40229f5ec..df05d285f0bd 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > @@ -335,32 +335,43 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
> >   * fbcon), so we just find the biggest and use that.
> >   */
> >  static bool intel_fbdev_init_bios(struct drm_device *dev,
> > -				 struct intel_fbdev *ifbdev)
> > +				  struct intel_fbdev *ifbdev)
> >  {
> >  	struct drm_i915_private *i915 = to_i915(dev);
> >  	struct intel_framebuffer *fb = NULL;
> > -	struct drm_crtc *crtc;
> > -	struct intel_crtc *intel_crtc;
> > +	struct intel_crtc *crtc;
> >  	unsigned int max_size = 0;
> >  
> >  	/* Find the largest fb */
> > -	for_each_crtc(dev, crtc) {
> > +	for_each_intel_crtc(dev, crtc) {
> > +		struct intel_crtc_state *crtc_state =
> > +			to_intel_crtc_state(crtc->base.state);
> > +		struct intel_plane *plane =
> > +			to_intel_plane(crtc->base.primary);
> > +		struct intel_plane_state *plane_state =
> > +			to_intel_plane_state(plane->base.state);
> >  		struct drm_i915_gem_object *obj =
> > -			intel_fb_obj(crtc->primary->state->fb);
> > -		intel_crtc = to_intel_crtc(crtc);
> > +			intel_fb_obj(plane_state->uapi.fb);
> 
> oh, here we have again that plane_state uapi change that I don't understand
> and I'm not seeing any mention in any commit msg..

sorry...

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> 
> >  
> > -		if (!crtc->state->active || !obj) {
> > +		if (!crtc_state->uapi.active) {
> >  			drm_dbg_kms(&i915->drm,
> > -				    "pipe %c not active or no fb, skipping\n",
> > -				    pipe_name(intel_crtc->pipe));
> > +				    "[CRTC:%d:%s] not active, skipping\n",
> > +				    crtc->base.base.id, crtc->base.name);
> > +			continue;
> > +		}
> > +
> > +		if (!obj) {
> > +			drm_dbg_kms(&i915->drm,
> > +				    "[PLANE:%d:%s] no fb, skipping\n",
> > +				    plane->base.base.id, plane->base.name);
> >  			continue;
> >  		}
> >  
> >  		if (obj->base.size > max_size) {
> >  			drm_dbg_kms(&i915->drm,
> > -				    "found possible fb from plane %c\n",
> > -				    pipe_name(intel_crtc->pipe));
> > -			fb = to_intel_framebuffer(crtc->primary->state->fb);
> > +				    "found possible fb from [PLANE:%d:%s]\n",
> > +				    plane->base.base.id, plane->base.name);
> > +			fb = to_intel_framebuffer(plane_state->uapi.fb);
> >  			max_size = obj->base.size;
> >  		}
> >  	}
> > @@ -372,60 +383,62 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> >  	}
> >  
> >  	/* Now make sure all the pipes will fit into it */
> > -	for_each_crtc(dev, crtc) {
> > +	for_each_intel_crtc(dev, crtc) {
> > +		struct intel_crtc_state *crtc_state =
> > +			to_intel_crtc_state(crtc->base.state);
> > +		struct intel_plane *plane =
> > +			to_intel_plane(crtc->base.primary);
> >  		unsigned int cur_size;
> >  
> > -		intel_crtc = to_intel_crtc(crtc);
> > -
> > -		if (!crtc->state->active) {
> > +		if (!crtc_state->uapi.active) {
> >  			drm_dbg_kms(&i915->drm,
> > -				    "pipe %c not active, skipping\n",
> > -				    pipe_name(intel_crtc->pipe));
> > +				    "[CRTC:%d:%s] not active, skipping\n",
> > +				    crtc->base.base.id, crtc->base.name);
> >  			continue;
> >  		}
> >  
> > -		drm_dbg_kms(&i915->drm, "checking plane %c for BIOS fb\n",
> > -			    pipe_name(intel_crtc->pipe));
> > +		drm_dbg_kms(&i915->drm, "checking [PLANE:%d:%s] for BIOS fb\n",
> > +			    plane->base.base.id, plane->base.name);
> >  
> >  		/*
> >  		 * See if the plane fb we found above will fit on this
> >  		 * pipe.  Note we need to use the selected fb's pitch and bpp
> >  		 * rather than the current pipe's, since they differ.
> >  		 */
> > -		cur_size = crtc->state->adjusted_mode.crtc_hdisplay;
> > +		cur_size = crtc_state->uapi.adjusted_mode.crtc_hdisplay;
> >  		cur_size = cur_size * fb->base.format->cpp[0];
> >  		if (fb->base.pitches[0] < cur_size) {
> >  			drm_dbg_kms(&i915->drm,
> > -				    "fb not wide enough for plane %c (%d vs %d)\n",
> > -				    pipe_name(intel_crtc->pipe),
> > +				    "fb not wide enough for [PLANE:%d:%s] (%d vs %d)\n",
> > +				    plane->base.base.id, plane->base.name,
> >  				    cur_size, fb->base.pitches[0]);
> >  			fb = NULL;
> >  			break;
> >  		}
> >  
> > -		cur_size = crtc->state->adjusted_mode.crtc_vdisplay;
> > +		cur_size = crtc_state->uapi.adjusted_mode.crtc_vdisplay;
> >  		cur_size = intel_fb_align_height(&fb->base, 0, cur_size);
> >  		cur_size *= fb->base.pitches[0];
> >  		drm_dbg_kms(&i915->drm,
> > -			    "pipe %c area: %dx%d, bpp: %d, size: %d\n",
> > -			    pipe_name(intel_crtc->pipe),
> > -			    crtc->state->adjusted_mode.crtc_hdisplay,
> > -			    crtc->state->adjusted_mode.crtc_vdisplay,
> > +			    "[CRTC:%d:%s] area: %dx%d, bpp: %d, size: %d\n",
> > +			    crtc->base.base.id, crtc->base.name,
> > +			    crtc_state->uapi.adjusted_mode.crtc_hdisplay,
> > +			    crtc_state->uapi.adjusted_mode.crtc_vdisplay,
> >  			    fb->base.format->cpp[0] * 8,
> >  			    cur_size);
> >  
> >  		if (cur_size > max_size) {
> >  			drm_dbg_kms(&i915->drm,
> > -				    "fb not big enough for plane %c (%d vs %d)\n",
> > -				    pipe_name(intel_crtc->pipe),
> > +				    "fb not big enough for [PLANE:%d:%s] (%d vs %d)\n",
> > +				    plane->base.base.id, plane->base.name,
> >  				    cur_size, max_size);
> >  			fb = NULL;
> >  			break;
> >  		}
> >  
> >  		drm_dbg_kms(&i915->drm,
> > -			    "fb big enough for plane %c (%d >= %d)\n",
> > -			    pipe_name(intel_crtc->pipe),
> > +			    "fb big enough [PLANE:%d:%s] (%d >= %d)\n",
> > +			    plane->base.base.id, plane->base.name,
> >  			    max_size, cur_size);
> >  	}
> >  
> > @@ -441,15 +454,20 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> >  	drm_framebuffer_get(&ifbdev->fb->base);
> >  
> >  	/* Final pass to check if any active pipes don't have fbs */
> > -	for_each_crtc(dev, crtc) {
> > -		intel_crtc = to_intel_crtc(crtc);
> > +	for_each_intel_crtc(dev, crtc) {
> > +		struct intel_crtc_state *crtc_state =
> > +			to_intel_crtc_state(crtc->base.state);
> > +		struct intel_plane *plane =
> > +			to_intel_plane(crtc->base.primary);
> > +		struct intel_plane_state *plane_state =
> > +			to_intel_plane_state(plane->base.state);
> >  
> > -		if (!crtc->state->active)
> > +		if (!crtc_state->uapi.active)
> >  			continue;
> >  
> > -		drm_WARN(dev, !crtc->primary->state->fb,
> > -			 "re-used BIOS config but lost an fb on crtc %d\n",
> > -			 crtc->base.id);
> > +		drm_WARN(dev, !plane_state->uapi.fb,
> > +			 "re-used BIOS config but lost an fb on [PLANE:%d:%s]\n",
> > +			 plane->base.base.id, plane->base.name);
> >  	}
> >  
> >  
> > -- 
> > 2.31.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-06-09 21:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  8:56 [Intel-gfx] [PATCH 0/6] drm/i915: Cleanup intel_crtc leftovers Ville Syrjala
2021-06-09  8:56 ` [Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask() Ville Syrjala
2021-06-09 11:25   ` Rodrigo Vivi
2021-06-09  8:56 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clean up intel_get_load_detect_pipe() a bit Ville Syrjala
2021-06-09 11:27   ` Rodrigo Vivi
2021-06-09  8:56 ` [Intel-gfx] [PATCH 3/6] drm/i915: Clean up intel_find_initial_plane_obj() " Ville Syrjala
2021-06-09 11:36   ` Rodrigo Vivi
2021-06-09 12:15     ` Ville Syrjälä
2021-06-09 21:05       ` Rodrigo Vivi
2021-06-09  8:56 ` [Intel-gfx] [PATCH 4/6] drm/i915: Clean up pre-skl wm calling convention Ville Syrjala
2021-06-09 11:44   ` Rodrigo Vivi
2021-06-09  8:56 ` [Intel-gfx] [PATCH 5/6] drm/i915: Clean up intel_fbdev_init_bios() a bit Ville Syrjala
2021-06-09 11:46   ` Rodrigo Vivi
2021-06-09 21:06     ` Rodrigo Vivi
2021-06-09  8:56 ` [Intel-gfx] [PATCH 6/6] drm/i915: s/intel_crtc/crtc/ Ville Syrjala
2021-06-09 11:49   ` Rodrigo Vivi
2021-06-09  9:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Cleanup intel_crtc leftovers Patchwork
2021-06-09  9:41 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-06-09 10:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-06-09 10:09 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2021-06-09 12:42 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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.