From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/9] drm/i915: Pass dev_priv to skl_needs_memory_bw_wa()
Date: Fri, 21 Dec 2018 19:14:33 +0200 [thread overview]
Message-ID: <20181221171436.8218-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20181221171436.8218-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
skl_needs_memory_bw_wa() doesn't look at the passed in state at all.
Possibly it should, but for now let's make life simpler by just
passing in dev_priv.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7464552c05f4..40cb18c61e11 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3633,14 +3633,9 @@ static u8 intel_enabled_dbuf_slices_num(struct drm_i915_private *dev_priv)
* FIXME: We still don't have the proper code detect if we need to apply the WA,
* so assume we'll always need it in order to avoid underruns.
*/
-static bool skl_needs_memory_bw_wa(struct intel_atomic_state *state)
+static bool skl_needs_memory_bw_wa(struct drm_i915_private *dev_priv)
{
- struct drm_i915_private *dev_priv = to_i915(state->base.dev);
-
- if (IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv))
- return true;
-
- return false;
+ return IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv);
}
static bool
@@ -3792,7 +3787,7 @@ bool intel_can_enable_sagv(struct drm_atomic_state *state)
latency = dev_priv->wm.skl_latency[level];
- if (skl_needs_memory_bw_wa(intel_state) &&
+ if (skl_needs_memory_bw_wa(dev_priv) &&
plane->base.state->fb->modifier ==
I915_FORMAT_MOD_X_TILED)
latency += 15;
@@ -4580,9 +4575,6 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
const struct drm_plane_state *pstate = &intel_pstate->base;
const struct drm_framebuffer *fb = pstate->fb;
uint32_t interm_pbpl;
- struct intel_atomic_state *state =
- to_intel_atomic_state(cstate->base.state);
- bool apply_memory_bw_wa = skl_needs_memory_bw_wa(state);
/* only NV12 format has two planes */
if (color_plane == 1 && fb->format->format != DRM_FORMAT_NV12) {
@@ -4643,7 +4635,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
wp->y_min_scanlines = 4;
}
- if (apply_memory_bw_wa)
+ if (skl_needs_memory_bw_wa(dev_priv))
wp->y_min_scanlines *= 2;
wp->plane_bytes_per_line = wp->width * wp->cpp;
@@ -4697,9 +4689,6 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *cstate,
uint_fixed_16_16_t method1, method2;
uint_fixed_16_16_t selected_result;
uint32_t res_blocks, res_lines, min_ddb_alloc = 0;
- struct intel_atomic_state *state =
- to_intel_atomic_state(cstate->base.state);
- bool apply_memory_bw_wa = skl_needs_memory_bw_wa(state);
if (latency == 0)
return;
@@ -4710,7 +4699,7 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *cstate,
dev_priv->ipc_enabled)
latency += 4;
- if (apply_memory_bw_wa && wp->x_tiled)
+ if (skl_needs_memory_bw_wa(dev_priv) && wp->x_tiled)
latency += 15;
method1 = skl_wm_method1(dev_priv, wp->plane_pixel_rate,
--
2.19.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-12-21 17:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-21 17:14 [PATCH 0/9] skl+ watermark stuff Ville Syrjala
2018-12-21 17:14 ` [PATCH 1/9] drm/i915: Don't ignore level 0 lines watermark for glk+ Ville Syrjala
2019-01-28 8:40 ` Lisovskiy, Stanislav
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:14 ` [PATCH 2/9] drm/i915: Reinstate an early latency==0 check for skl+ Ville Syrjala
2019-01-28 8:34 ` Lisovskiy, Stanislav
2019-01-29 23:54 ` Matt Roper
2019-01-30 14:25 ` Ville Syrjälä
2018-12-21 17:14 ` [PATCH 3/9] drm/i915: Fix bits vs. bytes mixup in dbuf block size computation Ville Syrjala
2019-01-28 8:43 ` Lisovskiy, Stanislav
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:14 ` [PATCH 4/9] drm/i915: Fix > vs >= mismatch in watermark/ddb calculations Ville Syrjala
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:14 ` [PATCH 5/9] drm/i915: Account for minimum ddb allocation restrictions Ville Syrjala
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:14 ` Ville Syrjala [this message]
2019-01-29 23:54 ` [PATCH 6/9] drm/i915: Pass dev_priv to skl_needs_memory_bw_wa() Matt Roper
2018-12-21 17:14 ` [PATCH 7/9] drm/i915: Drop the definite article in front of SAGV Ville Syrjala
2018-12-21 17:40 ` Rodrigo Vivi
2018-12-21 17:14 ` [PATCH 8/9] drm/i915: Drop the pointless linetime==0 check Ville Syrjala
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:14 ` [PATCH 9/9] drm/i915: Use IS_GEN9_LP() for the linetime w/a check Ville Syrjala
2018-12-21 17:39 ` Rodrigo Vivi
2019-01-29 23:54 ` Matt Roper
2018-12-21 17:49 ` ✗ Fi.CI.SPARSE: warning for skl+ watermark stuff Patchwork
2018-12-21 18:05 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-21 23:15 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181221171436.8218-7-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox