From: chix.ding@intel.com
To: intel-gfx@lists.freedesktop.org
Cc: yetundex.adebisi@intel.com, Chi Ding <chix.ding@intel.com>
Subject: [RFC 4/5] Add optimal field in intel_crtc_wm_state for VLV
Date: Wed, 1 Jun 2016 08:10:20 +0100 [thread overview]
Message-ID: <1464765021-16206-5-git-send-email-chix.ding@intel.com> (raw)
In-Reply-To: <1464765021-16206-1-git-send-email-chix.ding@intel.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
This patch prepares for two-level watermark support in the next commit
Change the code to use the optimal field
This patch adds optimal field, but doesn't change the code to use
two-level watermark yet
The patch is based on Maarten Lankhorst's code and created by Chi Ding
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Chi Ding <chix.ding@intel.com>
cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
cc: matthew.d.roper@intel.com
cc: yetundex.adebisi@intel.com
---
drivers/gpu/drm/i915/intel_drv.h | 23 ++++++++++++++---------
drivers/gpu/drm/i915/intel_pm.c | 11 +++++++++--
2 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 31118e1..6d2e628 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -420,6 +420,16 @@ struct skl_pipe_wm {
uint32_t linetime;
};
+struct vlv_wm_state {
+ struct vlv_pipe_wm wm[3];
+ struct vlv_sr_wm sr[3];
+ uint16_t fifo_size[I915_MAX_PLANES];
+ uint8_t num_active_planes;
+ uint8_t num_levels;
+ uint8_t level;
+ bool cxsr;
+};
+
struct intel_crtc_wm_state {
union {
struct {
@@ -440,6 +450,10 @@ struct intel_crtc_wm_state {
} ilk;
struct {
+ struct vlv_wm_state optimal;
+ } vlv;
+
+ struct {
/* gen9+ only needs 1-step wm programming */
struct skl_pipe_wm optimal;
@@ -621,15 +635,6 @@ struct intel_crtc_state {
uint32_t gamma_mode;
};
-struct vlv_wm_state {
- struct vlv_pipe_wm wm[3];
- struct vlv_sr_wm sr[3];
- uint16_t fifo_size[I915_MAX_PLANES];
- uint8_t num_active_planes;
- uint8_t num_levels;
- uint8_t level;
- bool cxsr;
-};
struct intel_crtc {
struct drm_crtc base;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 5515328..89eb139 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1093,7 +1093,7 @@ static int vlv_compute_wm(struct intel_crtc_state *cstate)
{
struct intel_crtc *crtc = to_intel_crtc(cstate->base.crtc);
struct drm_device *dev = crtc->base.dev;
- struct vlv_wm_state *wm_state = &crtc->wm_state;
+ struct vlv_wm_state *wm_state = &cstate->wm.vlv.optimal;
struct intel_plane *plane;
int sr_fifo_size = INTEL_INFO(dev)->num_pipes * 512 - 1;
int level;
@@ -1335,6 +1335,7 @@ static void vlv_update_wm(struct drm_crtc *crtc)
struct vlv_wm_values wm = {};
vlv_compute_wm(intel_crtc->config);
+ intel_crtc->wm_state = intel_crtc->config->wm.vlv.optimal;
vlv_merge_wm(dev, &wm);
if (memcmp(&dev_priv->wm.vlv, &wm, sizeof(wm)) == 0) {
@@ -1377,6 +1378,7 @@ static void vlv_update_wm(struct drm_crtc *crtc)
chv_set_memory_dvfs(dev_priv, true);
dev_priv->wm.vlv = wm;
+
}
#define single_plane_enabled(mask) is_power_of_2(mask)
@@ -4286,10 +4288,15 @@ void vlv_wm_get_hw_state(struct drm_device *dev)
mutex_unlock(&dev_priv->rps.hw_lock);
}
- for_each_pipe(dev_priv, pipe)
+ for_each_intel_crtc(dev, crtc) {
+ pipe = crtc->pipe;
+ to_intel_crtc_state(crtc->base.state)->wm.vlv.optimal
+ = crtc->wm_state;
+
DRM_DEBUG_KMS("Initial watermarks: pipe %c, plane=%d, cursor=%d, sprite0=%d, sprite1=%d\n",
pipe_name(pipe), wm->pipe[pipe].primary, wm->pipe[pipe].cursor,
wm->pipe[pipe].sprite[0], wm->pipe[pipe].sprite[1]);
+ }
DRM_DEBUG_KMS("Initial watermarks: SR plane=%d, SR cursor=%d level=%d cxsr=%d\n",
wm->sr.plane, wm->sr.cursor, wm->level, wm->cxsr);
--
1.8.0.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-01 7:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 7:10 Atomic and two-level watermark support for VLV and CHV chix.ding
2016-06-01 7:10 ` [RFC 1/5] Remove unused parameters from intel_plane_wm_parameters chix.ding
2016-06-03 22:58 ` Matt Roper
2016-06-01 7:10 ` [RFC 2/5] Rename skl_plane_id to wm_plane_id chix.ding
2016-06-03 22:58 ` Matt Roper
2016-06-01 7:10 ` [RFC 3/5] Move fifo_size from intel_plane_wm_parameters to vlv_wm_state chix.ding
2016-06-03 23:03 ` Matt Roper
2016-06-01 7:10 ` chix.ding [this message]
2016-06-01 7:10 ` [RFC 5/5] Add intermediate field in intel_crtc_wm_state and handlers for two-level watermark for VLV/CHV chix.ding
2016-06-01 7:44 ` ✗ Ro.CI.BAT: warning for series starting with [RFC,1/5] Remove unused parameters from intel_plane_wm_parameters 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=1464765021-16206-5-git-send-email-chix.ding@intel.com \
--to=chix.ding@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=yetundex.adebisi@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;
as well as URLs for NNTP newsgroup(s).