From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/14] drm/i915: Rework watermark readout to use plane api
Date: Thu, 17 Oct 2019 16:37:49 +0300 [thread overview]
Message-ID: <20191017133749.GU1208@intel.com> (raw)
In-Reply-To: <20191017132105.15528-1-maarten.lankhorst@linux.intel.com>
On Thu, Oct 17, 2019 at 03:20:52PM +0200, Maarten Lankhorst wrote:
> Instead of unconditionally verifying the cursor plane, handle it in the
> same way as any other plane, and use our existing api to verify.
>
> While at it, ensure that on gen9+ we verify active_planes mask as well.
> This should give the correct results for planar YUV planes too, as we
> update active_planes for them.
Why is that hidden in the watermark verification code? We already have
intel_verify_planes() which seems like a better fit.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 83 ++++++--------------
> 1 file changed, 23 insertions(+), 60 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 164ded862148..945ab2180614 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -12932,7 +12932,8 @@ static void verify_wm_state(struct intel_crtc *crtc,
> struct skl_pipe_wm *sw_wm;
> struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry;
> const enum pipe pipe = crtc->pipe;
> - int plane, level, max_level = ilk_wm_max_level(dev_priv);
> + int level, max_level = ilk_wm_max_level(dev_priv);
> + struct intel_plane *plane;
>
> if (INTEL_GEN(dev_priv) < 9 || !new_crtc_state->base.active)
> return;
> @@ -12956,63 +12957,25 @@ static void verify_wm_state(struct intel_crtc *crtc,
> hw->ddb.enabled_slices);
>
> /* planes */
> - for_each_universal_plane(dev_priv, pipe, plane) {
> + for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
> struct skl_plane_wm *hw_plane_wm, *sw_plane_wm;
> + enum pipe plane_pipe = pipe;
>
> - hw_plane_wm = &hw->wm.planes[plane];
> - sw_plane_wm = &sw_wm->planes[plane];
> -
> - /* Watermarks */
> - for (level = 0; level <= max_level; level++) {
> - if (skl_wm_level_equals(&hw_plane_wm->wm[level],
> - &sw_plane_wm->wm[level]))
> - continue;
> -
> - DRM_ERROR("mismatch in WM pipe %c plane %d level %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> - pipe_name(pipe), plane + 1, level,
> - sw_plane_wm->wm[level].plane_en,
> - sw_plane_wm->wm[level].plane_res_b,
> - sw_plane_wm->wm[level].plane_res_l,
> - hw_plane_wm->wm[level].plane_en,
> - hw_plane_wm->wm[level].plane_res_b,
> - hw_plane_wm->wm[level].plane_res_l);
> - }
> + hw_plane_wm = &hw->wm.planes[plane->id];
> + sw_plane_wm = &sw_wm->planes[plane->id];
>
> - if (!skl_wm_level_equals(&hw_plane_wm->trans_wm,
> - &sw_plane_wm->trans_wm)) {
> - DRM_ERROR("mismatch in trans WM pipe %c plane %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> - pipe_name(pipe), plane + 1,
> - sw_plane_wm->trans_wm.plane_en,
> - sw_plane_wm->trans_wm.plane_res_b,
> - sw_plane_wm->trans_wm.plane_res_l,
> - hw_plane_wm->trans_wm.plane_en,
> - hw_plane_wm->trans_wm.plane_res_b,
> - hw_plane_wm->trans_wm.plane_res_l);
> - }
> -
> - /* DDB */
> - hw_ddb_entry = &hw->ddb_y[plane];
> - sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[plane];
> -
> - if (!skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry)) {
> - DRM_ERROR("mismatch in DDB state pipe %c plane %d (expected (%u,%u), found (%u,%u))\n",
> - pipe_name(pipe), plane + 1,
> - sw_ddb_entry->start, sw_ddb_entry->end,
> - hw_ddb_entry->start, hw_ddb_entry->end);
> + if (!plane->get_hw_state(plane, &plane_pipe)) {
> + WARN(new_crtc_state->active_planes & BIT(plane->id),
> + "pipe %c %s should be visible, but isn't\n",
> + pipe_name(pipe), plane->base.name);
> + continue;
> }
> - }
>
> - /*
> - * cursor
> - * If the cursor plane isn't active, we may not have updated it's ddb
> - * allocation. In that case since the ddb allocation will be updated
> - * once the plane becomes visible, we can skip this check
> - */
> - if (1) {
> - struct skl_plane_wm *hw_plane_wm, *sw_plane_wm;
> + WARN_ON(plane_pipe != pipe);
>
> - hw_plane_wm = &hw->wm.planes[PLANE_CURSOR];
> - sw_plane_wm = &sw_wm->planes[PLANE_CURSOR];
> + WARN(!(new_crtc_state->active_planes & BIT(plane->id)),
> + "pipe %c %s should be invisible, but visible.\n",
> + pipe_name(pipe), plane->base.name);
>
> /* Watermarks */
> for (level = 0; level <= max_level; level++) {
> @@ -13020,8 +12983,8 @@ static void verify_wm_state(struct intel_crtc *crtc,
> &sw_plane_wm->wm[level]))
> continue;
>
> - DRM_ERROR("mismatch in WM pipe %c cursor level %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> - pipe_name(pipe), level,
> + DRM_ERROR("mismatch in WM pipe %c %s level %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> + pipe_name(pipe), plane->base.name, level,
> sw_plane_wm->wm[level].plane_en,
> sw_plane_wm->wm[level].plane_res_b,
> sw_plane_wm->wm[level].plane_res_l,
> @@ -13032,8 +12995,8 @@ static void verify_wm_state(struct intel_crtc *crtc,
>
> if (!skl_wm_level_equals(&hw_plane_wm->trans_wm,
> &sw_plane_wm->trans_wm)) {
> - DRM_ERROR("mismatch in trans WM pipe %c cursor (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> - pipe_name(pipe),
> + DRM_ERROR("mismatch in trans WM pipe %c %s (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
> + pipe_name(pipe), plane->base.name,
> sw_plane_wm->trans_wm.plane_en,
> sw_plane_wm->trans_wm.plane_res_b,
> sw_plane_wm->trans_wm.plane_res_l,
> @@ -13043,12 +13006,12 @@ static void verify_wm_state(struct intel_crtc *crtc,
> }
>
> /* DDB */
> - hw_ddb_entry = &hw->ddb_y[PLANE_CURSOR];
> - sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[PLANE_CURSOR];
> + hw_ddb_entry = &hw->ddb_y[plane->id];
> + sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[plane->id];
>
> if (!skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry)) {
> - DRM_ERROR("mismatch in DDB state pipe %c cursor (expected (%u,%u), found (%u,%u))\n",
> - pipe_name(pipe),
> + DRM_ERROR("mismatch in DDB state pipe %c %s (expected (%u,%u), found (%u,%u))\n",
> + pipe_name(pipe), plane->base.name,
> sw_ddb_entry->start, sw_ddb_entry->end,
> hw_ddb_entry->start, hw_ddb_entry->end);
> }
> --
> 2.23.0
>
> _______________________________________________
> 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
next prev parent reply other threads:[~2019-10-17 13:37 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 13:20 [PATCH 01/14] drm/i915: Rework watermark readout to use plane api Maarten Lankhorst
2019-10-17 13:20 ` [PATCH 02/14] drm/i915: Introduce intel_atomic_get_plane_state_after_check(), v2 Maarten Lankhorst
2019-10-17 13:20 ` [PATCH 03/14] drm/i915: Handle a few more cases for crtc hw/uapi split, v2 Maarten Lankhorst
2019-10-18 10:33 ` Ville Syrjälä
2019-10-17 13:20 ` [PATCH 04/14] drm/i915: Add aliases for uapi and hw to crtc_state Maarten Lankhorst
2019-10-18 10:36 ` Ville Syrjälä
2019-10-18 12:09 ` Maarten Lankhorst
2019-10-18 13:09 ` Ville Syrjälä
2019-10-17 13:20 ` [PATCH 05/14] drm/i915: Perform manual conversions for crtc uapi/hw split Maarten Lankhorst
2019-10-18 8:11 ` Maarten Lankhorst
2019-10-18 8:13 ` [PATCH] drm/i915: Perform manual conversions for crtc uapi/hw split, v2 Maarten Lankhorst
2019-10-22 18:16 ` Ville Syrjälä
2019-10-24 12:12 ` Maarten Lankhorst
2019-10-24 12:12 ` [Intel-gfx] " Maarten Lankhorst
2019-10-24 12:23 ` Ville Syrjälä
2019-10-24 12:23 ` [Intel-gfx] " Ville Syrjälä
2019-10-24 12:35 ` Maarten Lankhorst
2019-10-24 12:35 ` [Intel-gfx] " Maarten Lankhorst
2019-10-17 13:20 ` [PATCH 06/14] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw Maarten Lankhorst
2019-10-18 12:59 ` Ville Syrjälä
2019-10-17 13:20 ` [PATCH 07/14] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> uapi Maarten Lankhorst
2019-10-22 18:24 ` Ville Syrjälä
2019-10-17 13:20 ` [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v2 Maarten Lankhorst
2019-10-22 18:32 ` Ville Syrjälä
2019-10-23 15:06 ` Maarten Lankhorst
2019-10-23 15:06 ` [Intel-gfx] " Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 09/14] drm/i915: Add aliases for uapi and hw to plane_state Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 10/14] drm/i915: Perform manual conversions for plane uapi/hw split Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 11/14] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 12/14] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 13/14] drm/i915: Complete plane hw and uapi split, v2 Maarten Lankhorst
2019-10-17 13:21 ` [PATCH 14/14] drm/i915: Remove special case slave handling during hw programming, v2 Maarten Lankhorst
2019-10-18 14:52 ` Maarten Lankhorst
2019-10-22 10:31 ` [PATCH] drm/i915: Remove special case slave handling during hw programming, v3 Maarten Lankhorst
2019-10-22 18:14 ` Ville Syrjälä
2019-10-23 10:31 ` Maarten Lankhorst
2019-10-23 10:31 ` [Intel-gfx] " Maarten Lankhorst
2019-10-17 13:37 ` Ville Syrjälä [this message]
2019-10-17 14:11 ` [PATCH 01/14] drm/i915: Rework watermark readout to use plane api Maarten Lankhorst
2019-10-17 18:25 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/14] " Patchwork
2019-10-17 18:50 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-10-18 8:27 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/14] drm/i915: Rework watermark readout to use plane api (rev2) Patchwork
2019-10-18 8:46 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-18 10:57 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-10-18 14:03 ` Maarten Lankhorst
2019-10-22 18:53 ` ✗ Fi.CI.BUILD: failure for series starting with [01/14] drm/i915: Rework watermark readout to use plane api (rev3) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2019-10-24 12:47 [PATCH 01/14] drm/i915: Rework watermark readout to use plane api Maarten Lankhorst
2019-10-24 14:33 ` Ville Syrjälä
2019-10-24 15:16 ` Maarten Lankhorst
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=20191017133749.GU1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox