|
@@ -1715,13 +1715,6 @@ struct ilk_wm_maximums {
|
|
uint16_t fbc;
|
|
uint16_t fbc;
|
|
};
|
|
};
|
|
|
|
|
|
-/* used in computing the new watermarks state */
|
|
|
|
-struct intel_wm_config {
|
|
|
|
- unsigned int num_pipes_active;
|
|
|
|
- bool sprites_enabled;
|
|
|
|
- bool sprites_scaled;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* For both WM_PIPE and WM_LP.
|
|
* For both WM_PIPE and WM_LP.
|
|
* mem_value must be in 0.1us units.
|
|
* mem_value must be in 0.1us units.
|
|
@@ -2251,24 +2244,6 @@ static void skl_setup_wm_latency(struct drm_device *dev)
|
|
intel_print_wm_latency(dev, "Gen9 Plane", dev_priv->wm.skl_latency);
|
|
intel_print_wm_latency(dev, "Gen9 Plane", dev_priv->wm.skl_latency);
|
|
}
|
|
}
|
|
|
|
|
|
-static void ilk_compute_wm_config(struct drm_device *dev,
|
|
|
|
- struct intel_wm_config *config)
|
|
|
|
-{
|
|
|
|
- struct intel_crtc *intel_crtc;
|
|
|
|
-
|
|
|
|
- /* Compute the currently _active_ config */
|
|
|
|
- for_each_intel_crtc(dev, intel_crtc) {
|
|
|
|
- const struct intel_pipe_wm *wm = &intel_crtc->wm.active.ilk;
|
|
|
|
-
|
|
|
|
- if (!wm->pipe_enabled)
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
- config->sprites_enabled |= wm->sprites_enabled;
|
|
|
|
- config->sprites_scaled |= wm->sprites_scaled;
|
|
|
|
- config->num_pipes_active++;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* Compute new watermarks for the pipe */
|
|
/* Compute new watermarks for the pipe */
|
|
static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
|
|
static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
|
|
struct drm_atomic_state *state)
|
|
struct drm_atomic_state *state)
|
|
@@ -2917,11 +2892,12 @@ skl_get_total_relative_data_rate(const struct intel_crtc_state *cstate)
|
|
|
|
|
|
static void
|
|
static void
|
|
skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
|
|
skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
|
|
- const struct intel_wm_config *config,
|
|
|
|
struct skl_ddb_allocation *ddb /* out */)
|
|
struct skl_ddb_allocation *ddb /* out */)
|
|
{
|
|
{
|
|
struct drm_crtc *crtc = cstate->base.crtc;
|
|
struct drm_crtc *crtc = cstate->base.crtc;
|
|
struct drm_device *dev = crtc->dev;
|
|
struct drm_device *dev = crtc->dev;
|
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(dev);
|
|
|
|
+ struct intel_wm_config *config = &dev_priv->wm.config;
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
struct intel_plane *intel_plane;
|
|
struct intel_plane *intel_plane;
|
|
enum pipe pipe = intel_crtc->pipe;
|
|
enum pipe pipe = intel_crtc->pipe;
|
|
@@ -3096,15 +3072,6 @@ static bool skl_ddb_allocation_changed(const struct skl_ddb_allocation *new_ddb,
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-static void skl_compute_wm_global_parameters(struct drm_device *dev,
|
|
|
|
- struct intel_wm_config *config)
|
|
|
|
-{
|
|
|
|
- struct drm_crtc *crtc;
|
|
|
|
-
|
|
|
|
- list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
|
|
|
|
- config->num_pipes_active += to_intel_crtc(crtc)->active;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static bool skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
|
|
static bool skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
|
|
struct intel_crtc_state *cstate,
|
|
struct intel_crtc_state *cstate,
|
|
struct intel_plane *intel_plane,
|
|
struct intel_plane *intel_plane,
|
|
@@ -3507,14 +3474,13 @@ static void skl_flush_wm_values(struct drm_i915_private *dev_priv,
|
|
}
|
|
}
|
|
|
|
|
|
static bool skl_update_pipe_wm(struct drm_crtc *crtc,
|
|
static bool skl_update_pipe_wm(struct drm_crtc *crtc,
|
|
- struct intel_wm_config *config,
|
|
|
|
struct skl_ddb_allocation *ddb, /* out */
|
|
struct skl_ddb_allocation *ddb, /* out */
|
|
struct skl_pipe_wm *pipe_wm /* out */)
|
|
struct skl_pipe_wm *pipe_wm /* out */)
|
|
{
|
|
{
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state);
|
|
struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state);
|
|
|
|
|
|
- skl_allocate_pipe_ddb(cstate, config, ddb);
|
|
|
|
|
|
+ skl_allocate_pipe_ddb(cstate, ddb);
|
|
skl_compute_pipe_wm(cstate, ddb, pipe_wm);
|
|
skl_compute_pipe_wm(cstate, ddb, pipe_wm);
|
|
|
|
|
|
if (!memcmp(&intel_crtc->wm.active.skl, pipe_wm, sizeof(*pipe_wm)))
|
|
if (!memcmp(&intel_crtc->wm.active.skl, pipe_wm, sizeof(*pipe_wm)))
|
|
@@ -3527,7 +3493,6 @@ static bool skl_update_pipe_wm(struct drm_crtc *crtc,
|
|
|
|
|
|
static void skl_update_other_pipe_wm(struct drm_device *dev,
|
|
static void skl_update_other_pipe_wm(struct drm_device *dev,
|
|
struct drm_crtc *crtc,
|
|
struct drm_crtc *crtc,
|
|
- struct intel_wm_config *config,
|
|
|
|
struct skl_wm_values *r)
|
|
struct skl_wm_values *r)
|
|
{
|
|
{
|
|
struct intel_crtc *intel_crtc;
|
|
struct intel_crtc *intel_crtc;
|
|
@@ -3557,7 +3522,7 @@ static void skl_update_other_pipe_wm(struct drm_device *dev,
|
|
if (!intel_crtc->active)
|
|
if (!intel_crtc->active)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- wm_changed = skl_update_pipe_wm(&intel_crtc->base, config,
|
|
|
|
|
|
+ wm_changed = skl_update_pipe_wm(&intel_crtc->base,
|
|
&r->ddb, &pipe_wm);
|
|
&r->ddb, &pipe_wm);
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -3600,7 +3565,6 @@ static void skl_update_wm(struct drm_crtc *crtc)
|
|
struct skl_wm_values *results = &dev_priv->wm.skl_results;
|
|
struct skl_wm_values *results = &dev_priv->wm.skl_results;
|
|
struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state);
|
|
struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state);
|
|
struct skl_pipe_wm *pipe_wm = &cstate->wm.optimal.skl;
|
|
struct skl_pipe_wm *pipe_wm = &cstate->wm.optimal.skl;
|
|
- struct intel_wm_config config = {};
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear all dirty flags */
|
|
/* Clear all dirty flags */
|
|
@@ -3608,15 +3572,13 @@ static void skl_update_wm(struct drm_crtc *crtc)
|
|
|
|
|
|
skl_clear_wm(results, intel_crtc->pipe);
|
|
skl_clear_wm(results, intel_crtc->pipe);
|
|
|
|
|
|
- skl_compute_wm_global_parameters(dev, &config);
|
|
|
|
-
|
|
|
|
- if (!skl_update_pipe_wm(crtc, &config, &results->ddb, pipe_wm))
|
|
|
|
|
|
+ if (!skl_update_pipe_wm(crtc, &results->ddb, pipe_wm))
|
|
return;
|
|
return;
|
|
|
|
|
|
skl_compute_wm_results(dev, pipe_wm, results, intel_crtc);
|
|
skl_compute_wm_results(dev, pipe_wm, results, intel_crtc);
|
|
results->dirty[intel_crtc->pipe] = true;
|
|
results->dirty[intel_crtc->pipe] = true;
|
|
|
|
|
|
- skl_update_other_pipe_wm(dev, crtc, &config, results);
|
|
|
|
|
|
+ skl_update_other_pipe_wm(dev, crtc, results);
|
|
skl_write_wm_values(dev_priv, results);
|
|
skl_write_wm_values(dev_priv, results);
|
|
skl_flush_wm_values(dev_priv, results);
|
|
skl_flush_wm_values(dev_priv, results);
|
|
|
|
|
|
@@ -3629,20 +3591,18 @@ static void ilk_program_watermarks(struct drm_i915_private *dev_priv)
|
|
struct drm_device *dev = dev_priv->dev;
|
|
struct drm_device *dev = dev_priv->dev;
|
|
struct intel_pipe_wm lp_wm_1_2 = {}, lp_wm_5_6 = {}, *best_lp_wm;
|
|
struct intel_pipe_wm lp_wm_1_2 = {}, lp_wm_5_6 = {}, *best_lp_wm;
|
|
struct ilk_wm_maximums max;
|
|
struct ilk_wm_maximums max;
|
|
- struct intel_wm_config config = {};
|
|
|
|
|
|
+ struct intel_wm_config *config = &dev_priv->wm.config;
|
|
struct ilk_wm_values results = {};
|
|
struct ilk_wm_values results = {};
|
|
enum intel_ddb_partitioning partitioning;
|
|
enum intel_ddb_partitioning partitioning;
|
|
|
|
|
|
- ilk_compute_wm_config(dev, &config);
|
|
|
|
-
|
|
|
|
- ilk_compute_wm_maximums(dev, 1, &config, INTEL_DDB_PART_1_2, &max);
|
|
|
|
- ilk_wm_merge(dev, &config, &max, &lp_wm_1_2);
|
|
|
|
|
|
+ ilk_compute_wm_maximums(dev, 1, config, INTEL_DDB_PART_1_2, &max);
|
|
|
|
+ ilk_wm_merge(dev, config, &max, &lp_wm_1_2);
|
|
|
|
|
|
/* 5/6 split only in single pipe config on IVB+ */
|
|
/* 5/6 split only in single pipe config on IVB+ */
|
|
if (INTEL_INFO(dev)->gen >= 7 &&
|
|
if (INTEL_INFO(dev)->gen >= 7 &&
|
|
- config.num_pipes_active == 1 && config.sprites_enabled) {
|
|
|
|
- ilk_compute_wm_maximums(dev, 1, &config, INTEL_DDB_PART_5_6, &max);
|
|
|
|
- ilk_wm_merge(dev, &config, &max, &lp_wm_5_6);
|
|
|
|
|
|
+ config->num_pipes_active == 1 && config->sprites_enabled) {
|
|
|
|
+ ilk_compute_wm_maximums(dev, 1, config, INTEL_DDB_PART_5_6, &max);
|
|
|
|
+ ilk_wm_merge(dev, config, &max, &lp_wm_5_6);
|
|
|
|
|
|
best_lp_wm = ilk_find_best_result(dev, &lp_wm_1_2, &lp_wm_5_6);
|
|
best_lp_wm = ilk_find_best_result(dev, &lp_wm_1_2, &lp_wm_5_6);
|
|
} else {
|
|
} else {
|