]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix wm latency==0 disable on skl+
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 5 Feb 2019 15:50:53 +0000 (17:50 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 5 Feb 2019 19:56:18 +0000 (21:56 +0200)
commita86c440e4af3c1a53a62f00660dcafded7744810
treeaa60a72d271bfa2a256eb021cf47371b22b072ce
parenta5a0d9f14c3ba17bb9614945408cf9ac6b66dd88
drm/i915: Fix wm latency==0 disable on skl+

When adding the early latency==0 check back I neglected to
realize that we no longer have a way to return a failure
from the wm computation like we had in the past (since we
now calculate wms before ddb allocations). Also plane_en
being false doesn't actually indicate that the level is
invalid as it wil also happen when the plane is not
enabled.

skl_allocate_pipe_ddb() starts scanning from the maximum
watermark level and it stops as soon as it finds a level
that is deemed viable. The assumption being that if level
n+1 is valid then level n is valid as well. Thus if we
now disable any watermark level by zeroing its latency
the code will think that level to be actually valid
and won't confirm whether the actually enabled lower
watermark level(s) actually fit into the allotted ddb
space. This results in hilarious watermark values that
exceed the ddb allocation of the plane.

The way we must now indicate a failure is to assign an
unreasoanbly big value to min_ddb_alloc which will then
make skl_allocate_pipe_ddb() reject the entire level.

v2: Also do the same for the lines>31 case (Matt)
v3: Make 'blocks' u32 (Matt)

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190205155053.10081-1-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/intel_pm.c