From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/7] drm/i915: Program gen4 watermarks atomically
Date: Mon, 7 Aug 2017 12:48:26 +0200 [thread overview]
Message-ID: <20170807104828.21046-6-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20170807104828.21046-1-maarten.lankhorst@linux.intel.com>
We're already calculating the watermarks correctly, now we have to
program them too.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index f2062f589f41..3484ce40f2b0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2266,20 +2266,20 @@ static int i965_compute_pipe_wm(struct intel_crtc_state *crtc_state)
return 0;
}
-static void i965_update_wm(struct intel_crtc *crtc)
+static void i965_program_watermarks(struct drm_i915_private *dev_priv)
{
- struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+ struct intel_crtc *crtc;
+ struct i9xx_wm_state *wm_state = NULL;
int srwm = 1;
int cursor_sr = 16;
bool cxsr_enabled = false;
- crtc->wm.active.i9xx = crtc->config->wm.i9xx.optimal;
-
- /* Calc sr entries for one plane configs */
crtc = single_enabled_crtc(dev_priv);
- if (crtc && crtc->wm.active.i9xx.cxsr) {
- struct i9xx_wm_state *wm_state = &crtc->wm.active.i9xx;
+ if (crtc)
+ wm_state = &crtc->wm.active.i9xx;
+ /* Calc sr entries for one plane configs */
+ if (wm_state && wm_state->cxsr) {
srwm = wm_state->sr.plane;
cursor_sr = wm_state->sr.cursor;
@@ -2569,8 +2569,10 @@ static void i9xx_initial_watermarks(struct intel_atomic_state *state,
pnv_program_watermarks(dev_priv);
else if (INTEL_INFO(dev_priv)->num_pipes == 1)
i845_program_watermarks(intel_crtc);
- else
+ else if (INTEL_GEN(dev_priv) < 4)
i9xx_program_watermarks(dev_priv);
+ else
+ i965_program_watermarks(dev_priv);
mutex_unlock(&dev_priv->wm.wm_mutex);
}
@@ -2589,8 +2591,10 @@ static void i9xx_optimize_watermarks(struct intel_atomic_state *state,
pnv_program_watermarks(dev_priv);
else if (INTEL_INFO(dev_priv)->num_pipes == 1)
i845_program_watermarks(intel_crtc);
- else
+ else if (INTEL_GEN(dev_priv) < 4)
i9xx_program_watermarks(dev_priv);
+ else
+ i965_program_watermarks(dev_priv);
mutex_unlock(&dev_priv->wm.wm_mutex);
}
@@ -9019,7 +9023,8 @@ void intel_init_pm(struct drm_i915_private *dev_priv)
}
} else if (IS_GEN4(dev_priv)) {
dev_priv->display.compute_pipe_wm = i965_compute_pipe_wm;
- dev_priv->display.update_wm = i965_update_wm;
+ dev_priv->display.initial_watermarks = i9xx_initial_watermarks;
+ dev_priv->display.optimize_watermarks = i9xx_optimize_watermarks;
} else if (IS_GEN3(dev_priv)) {
dev_priv->display.compute_pipe_wm = i9xx_compute_pipe_wm;
dev_priv->display.compute_intermediate_wm = i9xx_compute_intermediate_wm;
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-07 10:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 10:48 [PATCH 0/7] drm/i915: Convert gen4- watermarks to atomic Maarten Lankhorst
2017-08-07 10:48 ` [PATCH 1/7] drm/i915: Calculate gen3- watermarks semi-atomically Maarten Lankhorst
2017-08-08 11:00 ` [PATCH] drm/i915: Calculate gen3- watermarks semi-atomically, v2 Maarten Lankhorst
2017-08-08 12:51 ` [PATCH 1/7] drm/i915: Calculate gen3- watermarks semi-atomically Mahesh Kumar
2017-09-07 12:39 ` Maarten Lankhorst
2017-08-07 10:48 ` [PATCH 2/7] drm/i915: Program gen3- watermarks atomically Maarten Lankhorst
2017-08-07 10:48 ` [PATCH 3/7] drm/i915: Convert pineview watermarks to atomic, v2 Maarten Lankhorst
2017-08-07 10:48 ` [PATCH 4/7] drm/i915: Calculate gen4 watermarks semiatomically Maarten Lankhorst
2017-08-07 10:48 ` Maarten Lankhorst [this message]
2017-08-07 10:48 ` [PATCH 6/7] drm/i915: Kill off intel_crtc_active Maarten Lankhorst
2017-08-07 10:48 ` [PATCH 7/7] drm/i915: Rip out legacy watermark infrastructure Maarten Lankhorst
2017-08-07 12:17 ` ✗ Fi.CI.BAT: failure for drm/i915: Convert gen4- watermarks to atomic. (rev2) Patchwork
2017-08-08 9:26 ` Maarten Lankhorst
2017-08-08 11:19 ` ✗ Fi.CI.BAT: failure for drm/i915: Convert gen4- watermarks to atomic. (rev3) 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=20170807104828.21046-6-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@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