From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 4/6] drm/i915: Program gen4 watermarks atomically
Date: Wed, 13 Sep 2017 10:40:22 +0200 [thread overview]
Message-ID: <20170913084024.25501-5-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20170913084024.25501-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 093c4b35522a..ddef0568c477 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2293,20 +2293,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_wm;
cursor_sr = wm_state->sr.cursor_wm;
@@ -2598,8 +2598,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);
}
@@ -2618,8 +2620,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);
}
@@ -9218,7 +9222,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.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-13 8:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 8:40 [PATCH v2 0/6] drm/i915: Convert gen4- watermarks to atomic Maarten Lankhorst
2017-09-13 8:40 ` [PATCH v2 1/6] drm/i915: Calculate gen3- watermarks semi-atomically, v3 Maarten Lankhorst
2017-09-13 8:40 ` [PATCH v2 2/6] drm/i915: Program gen3- watermarks atomically Maarten Lankhorst
2017-09-13 8:40 ` [PATCH v2 3/6] drm/i915: Calculate gen4 watermarks semiatomically Maarten Lankhorst
2017-09-13 8:40 ` Maarten Lankhorst [this message]
2017-09-13 8:40 ` [PATCH v2 5/6] drm/i915: Kill off intel_crtc_active Maarten Lankhorst
2017-09-13 8:40 ` [PATCH v2 6/6] drm/i915: Rip out legacy watermark infrastructure Maarten Lankhorst
2017-09-13 8:57 ` ✓ Fi.CI.BAT: success for drm/i915: Convert gen4- watermarks to atomic. (rev4) Patchwork
2017-09-13 11:29 ` ✗ Fi.CI.IGT: failure " 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=20170913084024.25501-5-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