From: Dorota Czaplejewicz <dorota.czaplejewicz@collabora.co.uk>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [1/2] drm/i915: Extract intel_wm_plane_visible()
Date: Tue, 21 Mar 2017 10:58:33 +0100 [thread overview]
Message-ID: <20170321105833.2bab647d@collabora.co.uk> (raw)
In-Reply-To: <20170314151050.12194-1-ville.syrjala@linux.intel.com>
I have tested this patch series (with [2/2] drm/i915: Fix SKL cursor watermarks, X-Patchwork-Id: 143965, 143966) and I can confirm it fixes https://bugs.freedesktop.org/show_bug.cgi?id=100195
Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@collabora.co.uk>
On Tue, 14 Mar 2017 17:10:49 +0200
ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> All platforms that lack double buffered watermarks will need to
> handle the legacy cursor updates in the same way. So let's extract the
> logic to determine the plane visibility into a small helper. For
> simplicity we'll make the function DTRT for any plane, but only apply
> the special sauce for cursor planes.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_pm.c | 39 +++++++++++++++++++++++++++------------
> 1 file changed, 27 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 2ca38ae4421e..3b0d379b6f38 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -655,6 +655,29 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz,
> return wm_size;
> }
>
> +static bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
> + const struct intel_plane_state *plane_state)
> +{
> + struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
> +
> + /* FIXME check the 'enable' instead */
> + if (!crtc_state->base.active)
> + return false;
> +
> + /*
> + * Treat cursor with fb as always visible since cursor updates
> + * can happen faster than the vrefresh rate, and the current
> + * watermark code doesn't handle that correctly. Cursor updates
> + * which set/clear the fb or change the cursor size are going
> + * to get throttled by intel_legacy_cursor_update() to work
> + * around this problem with the watermark code.
> + */
> + if (plane->id == PLANE_CURSOR)
> + return plane_state->base.fb != NULL;
> + else
> + return plane_state->base.visible;
> +}
> +
> static struct intel_crtc *single_enabled_crtc(struct drm_i915_private *dev_priv)
> {
> struct intel_crtc *crtc, *enabled = NULL;
> @@ -1961,7 +1984,7 @@ static uint32_t ilk_compute_pri_wm(const struct intel_crtc_state *cstate,
> uint32_t method1, method2;
> int cpp;
>
> - if (!cstate->base.active || !pstate->base.visible)
> + if (!intel_wm_plane_visible(cstate, pstate))
> return 0;
>
> cpp = pstate->base.fb->format->cpp[0];
> @@ -1990,7 +2013,7 @@ static uint32_t ilk_compute_spr_wm(const struct intel_crtc_state *cstate,
> uint32_t method1, method2;
> int cpp;
>
> - if (!cstate->base.active || !pstate->base.visible)
> + if (!intel_wm_plane_visible(cstate, pstate))
> return 0;
>
> cpp = pstate->base.fb->format->cpp[0];
> @@ -2013,15 +2036,7 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,
> {
> int cpp;
>
> - /*
> - * Treat cursor with fb as always visible since cursor updates
> - * can happen faster than the vrefresh rate, and the current
> - * watermark code doesn't handle that correctly. Cursor updates
> - * which set/clear the fb or change the cursor size are going
> - * to get throttled by intel_legacy_cursor_update() to work
> - * around this problem with the watermark code.
> - */
> - if (!cstate->base.active || !pstate->base.fb)
> + if (!intel_wm_plane_visible(cstate, pstate))
> return 0;
>
> cpp = pstate->base.fb->format->cpp[0];
> @@ -2038,7 +2053,7 @@ static uint32_t ilk_compute_fbc_wm(const struct intel_crtc_state *cstate,
> {
> int cpp;
>
> - if (!cstate->base.active || !pstate->base.visible)
> + if (!intel_wm_plane_visible(cstate, pstate))
> return 0;
>
> cpp = pstate->base.fb->format->cpp[0];
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-03-21 9:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 15:10 [PATCH 1/2] drm/i915: Extract intel_wm_plane_visible() ville.syrjala
2017-03-14 15:10 ` [PATCH 2/2] drm/i915: Fix SKL cursor watermarks ville.syrjala
2017-03-15 10:46 ` [2/2] " Tahvanainen, Jari
2017-03-22 9:01 ` [PATCH 2/2] " Maarten Lankhorst
2017-03-22 9:51 ` Ander Conselvan De Oliveira
2017-03-22 20:20 ` Ville Syrjälä
2017-03-14 20:23 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Extract intel_wm_plane_visible() Patchwork
2017-03-21 9:58 ` Dorota Czaplejewicz [this message]
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=20170321105833.2bab647d@collabora.co.uk \
--to=dorota.czaplejewicz@collabora.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@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 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.