All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 03/13] drm/i915: Introduce crtc_state->update_planes bitmask
Date: Wed, 14 Nov 2018 23:07:19 +0200	[thread overview]
Message-ID: <20181114210729.16185-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20181114210729.16185-1-ville.syrjala@linux.intel.com>

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

Keep track which planes need updating during the commit. For now this
is just (was_visible || is_visible) but I'll have need to update
invisible planes later on for skl plane ddbs and for pre-skl pipe
gamma/csc control (which lives in the primary plane control register).

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_atomic.c       | 1 +
 drivers/gpu/drm/i915/intel_atomic_plane.c | 8 ++++----
 drivers/gpu/drm/i915/intel_display.c      | 5 ++++-
 drivers/gpu/drm/i915/intel_drv.h          | 3 +++
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index a5a2c8fe58a7..8cb02f28d30c 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -184,6 +184,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
 	crtc_state->fifo_changed = false;
 	crtc_state->wm.need_postvbl_update = false;
 	crtc_state->fb_bits = 0;
+	crtc_state->update_planes = 0;
 
 	return &crtc_state->base;
 }
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 7d3685075201..010269a12390 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -137,6 +137,9 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
 	if (state->visible && state->fb->format->format == DRM_FORMAT_NV12)
 		crtc_state->nv12_planes |= BIT(intel_plane->id);
 
+	if (state->visible || old_plane_state->base.visible)
+		crtc_state->update_planes |= BIT(intel_plane->id);
+
 	return intel_plane_atomic_calc_changes(old_crtc_state,
 					       &crtc_state->base,
 					       old_plane_state,
@@ -171,14 +174,11 @@ void intel_update_planes_on_crtc(struct intel_atomic_state *old_state,
 				 struct intel_crtc_state *old_crtc_state,
 				 struct intel_crtc_state *new_crtc_state)
 {
+	u32 update_mask = new_crtc_state->update_planes;
 	struct intel_plane_state *new_plane_state;
 	struct intel_plane *plane;
-	u32 update_mask;
 	int i;
 
-	update_mask = old_crtc_state->active_planes;
-	update_mask |= new_crtc_state->active_planes;
-
 	for_each_new_intel_plane_in_state(old_state, plane, new_plane_state, i) {
 		if (crtc->pipe != plane->pipe ||
 		    !(update_mask & BIT(plane->id)))
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3c760a2eacc8..065c8befc6f8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10808,8 +10808,10 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
 			continue;
 
 		plane_state->linked_plane = NULL;
-		if (plane_state->slave && !plane_state->base.visible)
+		if (plane_state->slave && !plane_state->base.visible) {
 			crtc_state->active_planes &= ~BIT(plane->id);
+			crtc_state->update_planes |= BIT(plane->id);
+		}
 
 		plane_state->slave = false;
 	}
@@ -10850,6 +10852,7 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
 		linked_state->slave = true;
 		linked_state->linked_plane = plane;
 		crtc_state->active_planes |= BIT(linked->id);
+		crtc_state->update_planes |= BIT(linked->id);
 		DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name);
 	}
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 18b419f7f7fe..b0a24a81780a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -925,6 +925,9 @@ struct intel_crtc_state {
 	u8 active_planes;
 	u8 nv12_planes;
 
+	/* bitmask of planes that will be updated during the commit */
+	u8 update_planes;
+
 	/* HDMI scrambling status */
 	bool hdmi_scrambling;
 
-- 
2.18.1

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

  parent reply	other threads:[~2018-11-14 21:07 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 21:07 [PATCH v2 00/13] drm/i915: Program SKL+ watermarks/ddb more carefully Ville Syrjala
2018-11-14 21:07 ` [PATCH v2 01/13] drm/i915: Reorganize plane register writes to make them more atomic Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 02/13] drm/i915: Move single buffered plane register writes to the end Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-14 21:07 ` Ville Syrjala [this message]
2018-11-19 23:14   ` [PATCH v2 03/13] drm/i915: Introduce crtc_state->update_planes bitmask Matt Roper
2018-11-21 19:10     ` Ville Syrjälä
2018-11-27 16:37   ` [PATCH v3 " Ville Syrjala
2018-11-14 21:07 ` [PATCH v2 04/13] drm/i915: Pass the new crtc_state to ->disable_plane() Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 05/13] drm/i915: Fix latency==0 handling for level 0 watermark on skl+ Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-21 19:09     ` Ville Syrjälä
2018-11-14 21:07 ` [PATCH v2 06/13] drm/i915: Remove some useless zeroing on skl+ wm calculations Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 07/13] drm/i915: Pass the entire skl_plane_wm to skl_compute_transition_wm() Ville Syrjala
2018-11-19 23:14   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 08/13] drm/i915: Clean up skl+ vs. icl+ watermark computation Ville Syrjala
2018-11-20 22:44   ` Matt Roper
2018-11-21 19:05     ` Ville Syrjälä
2018-11-21 21:05       ` Matt Roper
2018-11-27 16:57   ` [PATCH v3 " Ville Syrjala
2018-11-14 21:07 ` [PATCH v2 09/13] drm/i915: Don't pass dev_priv around so much Ville Syrjala
2018-11-20 22:45   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 10/13] drm/i915: Move ddb/wm programming into plane update/disable hooks on skl+ Ville Syrjala
2018-11-19 18:23   ` [PATCH v4 " Ville Syrjala
2018-11-21  0:48   ` [PATCH v2 " Matt Roper
2018-11-21 19:01     ` Ville Syrjälä
2018-11-27 16:59   ` [PATCH v5 " Ville Syrjala
2018-11-14 21:07 ` [PATCH v2 11/13] drm/i915: Commit skl+ planes in an order that avoids ddb overlaps Ville Syrjala
2018-11-26 23:28   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 12/13] drm/i915: Rename the confusing 'plane_id' to 'color_plane' Ville Syrjala
2018-11-26 23:30   ` Matt Roper
2018-11-14 21:07 ` [PATCH v2 13/13] drm/i915: Pass the plane to icl_program_input_csc_coeff() Ville Syrjala
2018-11-15 11:18   ` Shankar, Uma
2018-11-15 12:37   ` Maarten Lankhorst
2018-11-26 23:38   ` Matt Roper
2018-11-14 21:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Program SKL+ watermarks/ddb more carefully (rev7) Patchwork
2018-11-14 21:19 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-14 21:36 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-15  5:21 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-15 14:23   ` Ville Syrjälä
2018-11-15 15:23     ` Ville Syrjälä
2018-11-19 18:48 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Program SKL+ watermarks/ddb more carefully (rev8) Patchwork
2018-11-19 18:53 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-19 19:07 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-20  1:52 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-20 18:55 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-21  6:05 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-21 19:19   ` Ville Syrjälä
2018-11-23 15:07 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-23 17:45 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-27 17:44 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Program SKL+ watermarks/ddb more carefully (rev11) Patchwork
2018-11-27 17:48 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-27 18:05 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-28  0:11 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-28 20:18 ` [PATCH v2 00/13] drm/i915: Program SKL+ watermarks/ddb more carefully Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181114210729.16185-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.